Glossary
What is a semantic layer?
Last updated
A semantic layer is a governed set of business definitions, metrics, dimensions, relationships and access rules, that sits between your raw data and every report or AI tool, so they all calculate “revenue” the same way. Instead of each dashboard and each AI assistant writing its own query and its own assumptions, they all ask for “revenue” by name and get the same, agreed answer.
Why it matters
Without a semantic layer, an AI assistant asked “what was our revenue last month?” has to guess which tables to join and which rows to count, and a small, silent mistake produces a confident, wrong number. dbt Labs’ April 2026 benchmark re-run found that grounding questions in a semantic layer took accuracy on modelled business questions to 98.2% (Claude Sonnet 4.6) and 100% (GPT-5.3-Codex), against 84–90% for the same models writing raw text-to-SQL on the same data, and against just 64.5% for text-to-SQL in general. The failure mode matters as much as the score: text-to-SQL tends to fail silently, returning a plausible but incorrect answer, while a semantic layer fails loudly, saying “not defined” rather than inventing a figure.
A separate, independent study (arXiv, 28 April 2026) found that adding a small, 4 KB semantic document to a prompt improved accuracy by 17 to 23 percentage points across three frontier models, and that the semantic context mattered more to the result than which model was used. The practical conclusion holds either way: AI gets your numbers right once it has your definitions, and gets them wrong, confidently, without them.
How it works
A semantic layer typically holds three things: metrics (revenue, active customer, churn, each with a written formula and an owner), dimensions and relationships (how tables join, what a “customer” or “order” actually is), and access rules (who is allowed to see what). Every dashboard, spreadsheet tool and AI assistant then asks for a metric by name rather than writing its own SQL, so a question asked in a report, in Teams, or through an AI agent gets the same answer, and an undefined question gets an honest “not defined” instead of a guess.
Examples
A business where Finance, Operations and a Copilot assistant each produced a different number for “revenue” replaces all three with one certified Power BI semantic model: the twenty or so numbers the business runs on, each with a plain-English definition and an owner, with AI instructions and verified answers so Copilot and a Fabric data agent both pick from the same definitions. A dbt-and-Snowflake business instead defines the same metrics once in MetricFlow, and exposes them to an AI assistant through dbt’s own MCP server rather than letting it write ad hoc SQL.
Where should it live?
The honest answer, per Tasman Analytics’ May 2026 analysis, is that ownership and upkeep matter more than architecture: “a semantic layer that’s two months behind reality is worse than one that’s messy but current.” A few practical defaults follow from that.
| Your estate | Reach for | AI access |
|---|---|---|
| Microsoft 365 / Power BI (most UK SMEs) | A certified Power BI semantic model, with "prep for AI" turned on. | Copilot, Fabric data agents, Fabric IQ MCP. |
| dbt already in use | dbt Semantic Layer / MetricFlow. | dbt's local or remote MCP server. |
| Snowflake-centred | Snowflake semantic views. | Cortex Analyst, Snowflake's managed MCP server. |
| Databricks-centred | Unity Catalog metric views. | Genie Agents, Databricks' managed MCP. |
Whichever option fits, keeping the definitions in plain, version-controlled text means a future move to a portable format, such as the emerging Apache Ossie specification, is an export rather than a rewrite.
Common mistakes
Building the semantic layer somewhere nobody maintains it. A layer with no owner drifts out of date within months and becomes actively misleading.
Running two semantic layers in parallel. Definitions in both the BI tool and a separate metrics platform tend to disagree eventually; pick one home for each metric.
Letting AI write ad hoc SQL on top of the raw warehouse anyway. If an agent can bypass the semantic layer and query tables directly, the whole point of having one is undermined.
Trying to define everything at once. Twenty well-chosen, genuinely used metrics beat two hundred half-maintained ones.
Frequently asked questions
Do we need to replace our BI tool to get a semantic layer?
Usually not. Power BI, dbt, Snowflake and Databricks all have their own way of building one; the work is mostly agreeing definitions and building the model properly, not switching platforms.
How is this different from just writing good SQL views?
A view is code most people cannot read or govern. A semantic layer is a business-facing layer with named owners, plain-English definitions and access rules, queried by name rather than by writing SQL each time.
Can AI still answer questions the semantic layer doesn’t cover?
Some setups allow a fallback to raw exploration for genuinely ad hoc questions, but the safest pattern is an honest “that’s not a defined metric yet” for board-level and client-facing numbers, rather than letting AI invent one.
How long does it take to build a first semantic layer?
Agreeing the roughly twenty numbers a business actually runs on, and modelling them properly in the tool you already use, is typically a few weeks of focused work, not a multi-month platform programme.
How this connects
Related terms
Sources
- Semantic Layer vs. Text-to-SQL: 2026 Benchmark Update. dbt Labs, April 2026.
- Measuring the effect of a semantic layer on LLM accuracy. arXiv (2604.25149), April 2026.
- Where the semantic layer should actually live. Tasman Analytics, May 2026.