Learn / Semantic § 02 of 05

§ 02 · Semantic

The contract between business meaning and database schema.

The semantic layer encodes metric definitions, dimensional relationships, and business logic in a machine-readable form that the agent can ground against. In the absence of one, agents produce syntactically valid SQL that is semantically wrong.

4 open standards 8 tools tracked

Why this layer carries the load

A consistent failure mode across platforms is syntactically valid SQL that is semantically incorrect: querying gross revenue when net revenue was intended, or applying deprecated segmentation logic. Without a semantic abstraction, agents must infer meaning from column names and table structures alone, which leads to frequent misinterpretation.

The semantic layer encodes metric definitions, dimensional relationships, and business logic in a machine-readable format. This is the single highest-leverage infrastructure investment for organizations pursuing agentic analytics. The first evaluation criterion for any platform should be: how does this system resolve ambiguity in business metric definitions?

The shift from self-service BI to agentic analytics changes what the semantic layer is for. In self-service, the semantic layer is a convenience: it lets business users pick from a dropdown instead of writing SQL. In agentic analytics, the semantic layer is a correctness boundary: without it, the agent will guess, and its guesses will look authoritative.

What's portable

The semantic layer has no single dominant spec yet. Four candidates carry most of the weight, with MetricFlow and Cube covering the majority of production deployments.

dbt Labs · Open core

dbt Semantic Layer (MetricFlow)

Metric definitions expressed in dbt project YAML, resolved to SQL at query time by MetricFlow. The most widely adopted standard for codifying metrics. A dbt MCP server exposes this layer directly to agents.

Specification →
Cube Dev · Open source

Cube semantic API

Cube exposes metric definitions and dimensional models through a REST, GraphQL, and SQL API. Purpose-built for programmatic consumers, which makes it a natural interface for agents that need deterministic metric resolution.

Specification →
Google · Open source

Malloy

A semantic query language that combines modeling and querying in a single declarative form. Valuable as a reference for where agent-native semantic languages are heading: the schema and the query share a grammar.

Specification →
ISO · Open standard

ISO SQL:2023

The baseline. SQL:2023 adds JSON, property graph queries, and multi-dimensional array features. Agents that emit standard SQL port across engines; agents trained on vendor extensions do not.

Specification →

Where semantics break

Metric ambiguity. "Revenue" means net of refunds in one department, gross in another, recognized-only in a third. An agent that answers "what was Q1 revenue?" without disambiguation is wrong most of the time, even when the SQL runs. Fix: every metric has one canonical definition, expressed in the semantic layer, with synonym mapping.

Deprecated logic still in use. A segmentation rule was replaced last quarter but the old view still exists in the warehouse. The agent, reasoning over schema alone, picks it up. Fix: the semantic layer is the source of truth; deprecated definitions are marked or removed; the agent only sees what's current.

Missing definitions. The semantic layer covers 40% of commonly asked questions; the other 60% the agent infers. Coverage gaps are where hallucination lives. Fix: measure semantic coverage against your actual question distribution, not against your schema.

Join logic the agent can't see. Business-critical joins (customer-to-account, order-to-cohort) often live in analyst scripts, not in modeled relationships. An agent that has to invent joins invents them wrong. Fix: formalize relationships in the semantic layer alongside metrics.