Define once. Use everywhere.¶
Any database. Any agent. An Apache Ossie-native semantic layer for metrics.
Define metrics and semantic models once in Apache Ossie (formerly OSI). Dosi turns them into native SQL for 20 warehouse dialects — DuckDB, Postgres, Snowflake, ClickHouse, StarRocks, and more — and serves them to agents and people alike: CLI, MCP, REST + Arrow, Python.
The problem it solves¶
Every dashboard, query, notebook and now every agent re-implements what a metric means, and the copies drift: one filters cancelled orders, another doesn't, and a stray join quietly doubles the total. Dosi gives each metric one definition and generates the SQL from it, correct on every warehouse, with the double-counting mistakes engineered out.
See it in 30 seconds¶
Tell your coding agent, whether that is Claude Code, Codex, Cursor or another:
Install Dosi by following https://dosi.datus.ai/agent-install.md
Then just talk to it, in a folder with your data:
Connect to my data
Build a semantic model for this data
What is revenue by region and month?
Why was revenue lower in Q2 than in Q1?
The agent connects, writes and validates an Apache Ossie model, and answers every question through its metrics instead of guessing SQL. You never type a password into the chat. The quickstart runs this conversation on a 200k-order sample in under ten minutes.
Define metrics once in a model, then ask for them by name:
$ export DOSI_EXAMPLES=~/.local/share/dosi/examples
$ dosi list metrics --model $DOSI_EXAMPLES/orders/model.yaml
NAME KIND DATASETS DESCRIPTION
revenue aggregate orders Total order amount
order_count aggregate orders Number of orders
unique_customers aggregate orders Distinct purchasing customers
avg_order_value ratio orders Revenue per order (ratio)
total_margin expression order_lines, orders Revenue minus cost (expression over two aggregates)
line_count aggregate order_lines
line_product_margin expression order_lines, products
$ duckdb orders.duckdb < $DOSI_EXAMPLES/orders/seed.sql
$ dosi query --model $DOSI_EXAMPLES/orders/model.yaml \
--metrics revenue --group-by orders.status --order status \
--execute --db orders.duckdb
status revenue
cancelled 10
completed 23825.49
pending 0
3 rows
That path is where the install script puts the bundled example models, and dosi info prints it back. Loading the sample data takes the DuckDB CLI; the CLI tutorial goes through it step by step. Change --dialect snowflake and the SQL changes; your model doesn't.
Why Dosi¶
Built for agents¶
-
Lightweight, one experience everywhere
A single Rust binary with no runtime dependencies, installed in one line and running fully local. The CLI, REST + Arrow, MCP and Python share one compiler and one error contract, so building, validating and querying work the same in all four.
-
The MCP server exposes semantic tools, not database tools: the agent asks for metrics instead of writing
SUM(). Every failure returns a stable code, valid candidates and asuggested_retry, so the agent corrects the query instead of retrying blind. -
Every agent call is a compile, so the engine has to live in the request path. Dosi compiles a warm query in under a millisecond, generates leaner SQL, and runs an order of magnitude or more ahead of MetricFlow and Cube, with results streamed as Arrow end to end.
Numbers you can trust¶
-
Dosi refuses to emit an aggregate it cannot prove safe from join fan-out, and an ambiguous join path is an error listing every candidate, never a guess. Whether a metric can be summed, rolled up or attributed is derived from the model, not left to the LLM.
-
Open spec, 20 dialects, any agent
Dosi loads Apache Ossie (formerly OSI) YAML natively, with no sidecar format and no second copy of your semantics, and checks models against the upstream reference validator. One definition compiles to 20 warehouse dialects and serves any agent that speaks MCP or HTTP.
-
Aggregates and detail rows, one semantics
queryreturns aggregates andselectreturns detail rows through the same filters and join paths. Drilling down no longer means hand-writing SQL that quietly drops the metric's definition.
Analysis beyond a number¶
-
Expressive metrics, fewer of them
Derived, nested and parameterized metrics, plus period-over-period, rolling and cumulative windows, let a handful of stable definitions cover the core of a business. Level of detail lets a metric fix its own grain apart from the query's group-by, such as first-order revenue per customer rolled up by region.
-
Explain why a metric moved: split the change over its formula, then by the groups of any field. Each part gets its Shapley contribution, and the contributions add back to the total change, so the explanation can be checked.
-
Ontology on top of your metrics
An Apache Ossie ontology adds business concepts, rules and relationships on top of the semantic model, and Dosi compiles them down to the same SQL. An agent can then follow the company's own definitions to reason through a decision, not just fetch a number.
Start here¶
-
Install Dosi in Claude Code, Codex or any coding agent with one sentence, then connect, model and ask in plain language, in under ten minutes.
-
What is Apache Ossie & Why Dosi
The open spec Dosi is built on, the problem a semantic layer solves, and why the numbers are trustworthy.
-
The
dosiCLI,dosi-serverand the Python bindings, installed and verified in a couple of minutes, no database required. -
From the bundled model to real results you can verify by eye, with the CLI alone.
Dosi is a product of Datus. For access, licensing, or support, get in touch with the Datus team, or see Datus Studio, the commercial platform Dosi powers.