What is datahashi?
Same metric for humans and AI agents — without hallucinated SQL. A governed semantic layer that compiles structured queries to warehouse SQL.
Updated
datahashi is a governed semantic layer: one business model between your warehouse and everything that queries it — LLM/MCP agents, BI, embedded charts, internal services.
Consumers name metrics and dimensions. datahashi resolves the joins, applies policy, compiles fan-out-safe SQL, and pushes execution down to your warehouse. The job it exists for:
Same metric for humans and AI agents — without hallucinated SQL.
Why not just write SQL?
Every dashboard that writes its own JOIN and GROUP BY eventually disagrees with the next one. “Average order value by region” ends up with three definitions and nobody knows which is right.
Agents make it worse. An LLM invents a join, returns a confidently-wrong figure, and nobody notices until finance and product are already arguing.
A semantic layer moves that logic to one place:
- One definition per number.
revenueissum(amount)onOrder, once. Everyone who asks for it — dashboard or agent — gets the same SQL. - No hand-written joins. You declare how
Orderrelates toCustomer; the compiler walks the join graph to reachregion. Agents never invent that path. - Governance by construction. A consumer names a metric. There is no syntax in which to ask for a raw table, an arbitrary join, or a column a policy hides.
- Pushed down. datahashi generates SQL and the warehouse runs it. The layer stays thin. (Pre-computed rollups for hot queries are on the roadmap; today every query runs against your source.)
- Metered. Each query records what it scanned against the caller — so agent and BI cost are visible, not buried in warehouse bills.
How it fits together
You author a Semantic Model as YAML — entities, dimensions, measures, metrics — and publish it. Publishing freezes an immutable artifact: the model plus its policy bundle, versioned.
Consumers send a Semantic Query (a structured object, never SQL) over REST or MCP. The engine compiles it against the published artifact, applies row-level security, executes against your warehouse, and meters what it scanned.
Proof that it worked: dashboard X and agent Y return the same number for the same metric names.
Two processes run this, deliberately separated — see Architecture. The vocabulary above is defined precisely in the Semantic model glossary.
Next: Getting started.