A semantic layer defines metrics like revenue once so every AI agent gets the same answer. Architecture, real examples, and 2026 benchmarks.

Ka Ling Wu
Co-Founder & CEO, Upsolve AI
10 min

A semantic layer is a governed set of business definitions that sits between your data and everything that queries it: dashboards, spreadsheets, embedded apps, and now AI agents. It defines what “revenue,” “active customer,” and “churn” mean, and exactly how to compute them, once, so every tool returns the same number.
For twenty years that was a BI hygiene problem. In 2026 it is an AI accuracy problem. Hand a frontier model your raw schema and it will write fluent SQL against the wrong definition. Hand it a semantic layer and, in Cube’s paired benchmark across three frontier models, accuracy rose 17 to 23 points on every model tested. This guide covers what a semantic layer is, how the architecture works, real examples from five tools, what the benchmarks actually show, and how it differs from an ontology, a context layer, and a gold layer.
Key Takeaways |
|---|
|
What Is a Semantic Layer?
A semantic layer is a business representation of your data. It maps technical tables and columns to the terms your company uses, defines how metrics are calculated, and enforces who can see what. It does not store or move data. It compiles each request into the right SQL at query time.
Here is the problem it solves. Ask three teams for last quarter’s revenue and you can get three correct-looking answers:
Finance reports net revenue: recognized, excluding refunds, by fiscal quarter.
Sales reports bookings: signed contract value, by calendar quarter.
Product reports ARR: annualized recurring revenue, excluding usage overages.
None of these is wrong. The problem is that a column called fct_orders.amount cannot tell you which one the person asking means. A semantic layer writes that knowledge down once: “revenue” means net recognized revenue, here is the SQL, here is the source-of-truth table, and here is who owns the definition.
In simple terms, a semantic layer is a translator plus a rulebook. The translator turns rev_amt_usd_net into “net revenue.” The rulebook says refunds are excluded, trials are not customers, and the orders_v2 table replaced orders in March.
Why the Semantic Layer Matters More in 2026
In the BI era, a human analyst sat between the data and the decision. If a dashboard showed a strange number, someone noticed. AI agents remove that checkpoint. An agent can answer a thousand questions a day in Slack, and every one of them is a chance to pick a plausible definition that isn’t yours.
The data shows the cost is already real:
49% of data and analytics leaders say their companies occasionally or frequently draw incorrect conclusions from data with poor business context, according to Salesforce’s State of Data and Analytics report (n = 7,600+).
71% of data practitioners cite incorrect or hallucinated outputs reaching stakeholders as a top concern, per the dbt Labs State of Analytics Engineering 2026.
Only 21% of firms rate their data curation practices as well developed, but those firms are more than 3× as likely to be effective at realizing value from data and AI, according to MIT CISR research on the case for a semantic layer.
Budgets are following. A Futurum survey of 818 enterprises found 44.5% plan to increase semantic layer spending over the next 24 months and another 14.4% plan to adopt one for the first time. Only 6.1% have no plans.
Semantic Layer Architecture
Where the Semantic Layer Sits in the Stack
The semantic layer lives after transformation and before consumption:
Everything above the semantic layer is physical data. Everything below it asks for business concepts (“net revenue by region”) instead of tables.
Core Components of a Semantic Layer
Most semantic layers, whatever the vendor, are built from the same seven parts, usually organized into one or more semantic models:
Entities or logical tables: Business objects (customer, order, subscription) mapped to physical tables, with primary keys.
Dimensions: Attributes you can group or filter by, such as region, plan tier, or order month.
Measures and metrics: Aggregations (sum of amount) and the business metrics built from them (net revenue, churn rate, ARR). This part is often called the metrics layer.
Relationships: Approved join paths between entities, so the engine never fans out a join and double-counts.
Metadata: Descriptions, synonyms (“sales orders,” “bookings”), owners, and certification status. Much of this starts life in a data dictionary.
Access policies: Row- and column-level rules applied before the query runs.
Query engine: The planner that compiles a request into dialect-specific SQL, often with caching or pre-aggregation.
How a Query Flows Through It
Take the request “net revenue by region last quarter”:
The consumer (a BI tool or an agent) requests the metric
net_revenuegrouped byregion, filtered to last quarter.The semantic layer resolves the metric definition and finds the join path from
orderstocustomerstoregions.It applies the requester’s access policy, such as “EMEA managers see EMEA rows only.”
It generates SQL for your warehouse’s dialect and runs it.
It returns a governed result, labeled with the definition that produced it.
The key property is that the consumer never writes the join or the formula. That is why two tools can’t disagree.
The Four Types of Semantic Layer
Type | Examples | Where definitions live | Strength | Trade-off |
|---|---|---|---|---|
BI-tool semantic layer | LookML (Looker), Power BI semantic models, Tableau Semantics | Inside one BI tool | Tight UX, fast to adopt | Other tools can’t reuse it |
Platform-native | Snowflake semantic views, Databricks metric views | Inside the warehouse or lakehouse | Governance and proximity to data | Covers only that platform’s data |
Universal (headless) | dbt Semantic Layer (MetricFlow), Cube, AtScale | A standalone layer serving many tools | Define once, serve everywhere | Another system to model and run |
Context (agent-native) | Governed markdown glossaries, agent data models like Upsolve Data Models | Versioned context the agent reads | Encodes judgment, ambiguity, and “gotchas” | Probabilistic, not compiled |
Universal layers like dbt and the Cube semantic layer are the most portable, while platform-native layers are the easiest to govern. Our comparison of 14 semantic layer tools covers pricing and AI support for each.
The fourth type is new, and it matters. AngelList’s engineering team replaced semantic layer infrastructure with a markdown glossary, a generated model catalog, and skill files regenerated on every merge, covering about 27,000 columns. Their reasoning: an agent writes its own SQL, so what it needs is legible, current context rather than a query planner.
Semantic Layer Examples Across Five Tools
The same idea looks different in every tool. Here is what each one looks like in code, taken from official documentation.
dbt Semantic Layer (MetricFlow, v1.12+ spec). Semantic models are now declared inside model YAML:
Older projects use the legacy top-level semantic_models: and measures: spec, which dbt’s semantic model docs still describe. Our dbt Semantic Layer and MetricFlow walkthrough covers the new spec end to end.
Snowflake semantic view. A schema-level object defined in SQL DDL (CREATE SEMANTIC VIEW reference):
Databricks metric view. A Unity Catalog object written in YAML (metric views docs):
LookML (Looker). Measures live in view files (LookML measure types):
Power BI semantic model (DAX). Measures are defined in the model and reused by every report: Projected Sales = SUM('Reseller Sales'[Last Years Sales]) * 1.06.
Real-World Semantic Layer Results
Bilt Rewards moved entity relationships into the dbt Semantic Layer to power partner-facing analytics and cut its data costs by 80%.
Healthcare IQ built a semantic layer over roughly 6 million products from 25,000+ manufacturers and automated 80% of the effort to onboard new hospitals, per MIT CISR.
iFood reports queries running “up to 10x” faster after moving to Databricks metric views.
What the Benchmarks Say About Semantic Layers and AI
The case for a semantic layer used to rest on consistency. Now it rests on measured accuracy.
Raw schemas break even the best models. When Spider 2.0 launched with real enterprise databases (often 1,000+ columns each), the best agent solved 21.3% of tasks, compared with 91.2% on the older academic Spider 1.0. A GPT-4o agent managed about 12%. Purpose-built agents have since pushed the Spider 2.0-Snow leaderboard past 96%, mostly by exploring metadata, documentation, and sample values before writing SQL. The lesson is that context engineering closed the gap, not raw model size.
Context, not the model, drives accuracy. Cube’s paired benchmark ran the same 100 questions with and without a 4 KB semantic document (also published on arXiv):
Model | Schema only | Schema + semantic layer | Gain |
|---|---|---|---|
Claude Opus 4.7 | 50.5% | 67.7% | +17.2 pts |
Claude Sonnet 4.6 | 46.5% | 68.7% | +22.2 pts |
GPT-5.4 | 45.5% | 68.7% | +23.2 pts |
Upgrading the model barely mattered. Adding context did.
Compiled semantic layers fail loudly. dbt Labs’ April 2026 benchmark (11 questions, 20 runs each) found the dbt Semantic Layer answered 100% of in-scope questions correctly, compared with 51–63% for text-to-SQL. To be fair to text-to-SQL, once the team added three dbt models, it climbed to 84–90%. dbt’s own conclusion was “It’s both, for different things”: a compiled layer for governed metrics, flexible SQL for the long tail.
Business context documents work outside tech, too. In a peer-reviewed GSK pharmacovigilance study in JAMIA Open, GPT-4’s SQL accuracy rose from 8.3% with the schema alone to 78.3% with a business context document.
The pattern across every study: grounded agents fail loudly. They refuse or ask a clarifying question. Ungrounded agents fail silently, with a confident, specific, wrong number. Only one of those ends up in a board deck.
Gartner has put a number on the upside. In May 2026 it predicted that by 2027, organizations that prioritize semantics in AI-ready data will increase agentic AI accuracy by up to 80% and cut costs by up to 60%.
Semantic Layer vs Ontology vs Context Layer
These three terms show up on the same search results page, and vendors use them loosely. Here is how they differ (for the full picture, see our guides to data ontology and the context layer):
Semantic layer | Ontology | Context layer | |
|---|---|---|---|
Defines | How to compute business concepts | What things are and how they relate | Everything an agent needs to act correctly |
Typical contents | Metrics, dimensions, joins, filters | Entity types, properties, relationships, actions | Semantic layer + lineage, freshness, docs, verified answers, usage signals |
Deterministic? | Yes (compiles to SQL) | Structural, not computational | Mixed |
Example | dbt metric | Palantir Ontology objects and links | Atlan, DataHub, Upsolve’s Structure–Meaning–Trust model |
A useful rule of thumb: the semantic layer answers “how do I calculate ARR?” The ontology answers “what is a customer, and how does it connect to contracts and invoices?” The context layer answers what Atlan frames as “when, how, and under what rules can an AI agent use this metric?” The semantic layer is a subset of the context layer, not a competitor to it.
Is Snowflake or Databricks a Semantic Layer?
Is Snowflake a Semantic Layer?
Snowflake is a data platform, not a semantic layer, but it now includes one. Semantic views are schema-level objects that store logical tables, relationships, facts, dimensions, and metrics. Defining them became generally available in June 2025, and querying them with standard SQL went GA on March 2, 2026. Cortex Agents and Snowflake CoWork (formerly Snowflake Intelligence) read them to answer natural-language questions. Our guide to Snowflake semantic views covers the syntax and limits.
Is Databricks a Semantic Layer?
Same pattern. Databricks is a lakehouse platform whose native semantic layer is Unity Catalog business semantics, built on metric views. They reached general availability on April 2, 2026, and Databricks is open-sourcing the core into Apache Spark. Genie Agents, AI/BI dashboards, and partner tools query them with the MEASURE() function. See our Databricks metric views guide for syntax and BI tool support.
The catch for both is that a platform-native semantic layer only covers data inside that platform. Portability is what Apache Ossie, formerly the Open Semantic Interchange (OSI), is trying to solve. Its ecosystem lists more than 70 organizations, including Snowflake, Salesforce, dbt Labs, Databricks, and Microsoft, and it entered the Apache Incubator in July 2026.
Semantic Layer vs Gold Layer (and Where It Sits in ETL)
In a medallion architecture, the gold layer holds denormalized, read-optimized tables for reporting. The semantic layer is not a transformation step. It sits on top of gold (or silver) tables, after the “T” in ETL, and computes metrics at query time.
Gold layer | Semantic layer | |
|---|---|---|
What it is | Physical tables | Logic and metadata |
Built by | ETL/ELT (e.g., dbt models) | Metric and entity definitions |
Answers | Questions you anticipated | Any slice of a defined metric, consistently |
Changes require | Rebuilding tables | Editing a definition |
You usually need both. Gold tables make queries fast and clean. The semantic layer makes them consistent.
How to Build a Semantic Layer Without Boiling the Ocean
The most common way semantic layer projects fail is by trying to model everything before anyone can use anything. A better sequence, consistent with MIT CISR’s advice to start with priority data assets:
List the 10–20 most-asked and most-disputed metrics. Your Slack history and the data team’s ticket queue will tell you what they are.
Choose the form. Use a compiled layer for board-level metrics that must be exact. Use governed context for the long tail of questions.
Assign an owner to every definition. An unowned metric drifts back into five versions within a year.
Write golden questions with known answers. Run them whenever a definition changes. A semantic layer for agents isn’t done when it’s documented; it’s done when it’s tested.
Generate, don’t hand-maintain. Regenerate descriptions and catalogs from your dbt manifest or warehouse metadata on every merge. As AngelList put it, stale semantics are worse than none.
Pro tip: Start where agents fail. Every question an agent gets wrong or refuses tells you the next definition to write.
Don’t Have a Semantic Layer Yet? Start Here
Most teams we talk to don’t have a maintained semantic layer, and they shouldn’t have to build one for months before an agent can answer a question. That’s why Upsolve Data Models is designed around one principle: no semantic layer required.
Register your tables: Attach tables and fields with descriptions, types, and primary and foreign keys, directly on your warehouse.
Encode your vocabulary: Store canonical definitions (“ARR excludes usage overages”), analysis approaches, and output formats in a versioned system prompt with drafts and rollback.
Keep values fresh: Mark columns as selectable and Upsolve pre-caches their values nightly, so the agent knows your five contract statuses before it writes SQL.
If you already have a dbt project, import it. If you don’t, start from your warehouse and add definitions as gaps appear. Either way, there’s one definition of ARR, and every agent answer uses it.
Frequently Asked Questions
Is dbt a semantic layer?
dbt Core is a transformation tool, not a semantic layer. The dbt Semantic Layer, powered by MetricFlow, is. You define semantic models and metrics in YAML, and MetricFlow compiles them into SQL. MetricFlow has been open source under the Apache 2.0 license since October 2025.
Do AI agents need a semantic layer?
They need governed business context, and a semantic layer is the most proven form of it. Without one, agents infer meaning from column names. The benchmarks above show accuracy gains of 17 to 70 points when context is added. That context can be compiled metrics, governed documentation, or both.
What is the difference between a semantic layer and a metrics layer?
A metrics layer is the part of a semantic layer that governs metric calculations. The semantic layer is broader. It also models entities, relationships, dimensions, and access rules. In tools like MetricFlow, the two ship together.
How long does it take to build a semantic layer?
A useful first version takes days to weeks, not months. Start with your top 10–20 metrics and the tables behind them. Coverage then grows one definition at a time, driven by the questions people actually ask.
Does a semantic layer store data?
No. A semantic layer stores definitions and metadata, not data. It compiles each request into SQL that runs against your warehouse. Some tools add caching or pre-aggregations for speed, but the warehouse remains the source of truth.
What are the most popular semantic layer tools?
The most widely used are the dbt Semantic Layer, Cube, AtScale, LookML, Power BI semantic models, Snowflake semantic views, and Databricks metric views. The right choice depends on whether your data lives in one platform and how many tools need the same definitions.
Sources
Cube: Why Semantic Layers Make LLM Analytics Reliable: A Paired Benchmark Across Three Frontier Models (Apr 2026). https://cube.dev/blog/why-semantic-layers-make-llm-analytics-reliable-a-paired-benchmark-across-three-frontier-models
Rumiantsau & Fokeev (arXiv): Semantic Layers for Reliable LLM-Powered Data Analytics (same study as [1]). https://arxiv.org/abs/2604.25149
dbt Labs: Semantic Layer vs. Text-to-SQL: 2026 Benchmark Update (Apr 7, 2026). https://docs.getdbt.com/blog/semantic-layer-vs-text-to-sql-2026
Gartner: Top Predictions for Data and Analytics in 2026 (Mar 11, 2026). https://www.gartner.com/en/newsroom/press-releases/2026-03-11-gartner-announces-top-predictions-for-data-and-analytics-in-2026
Gartner: Lack of Semantics Causes Inaccurate AI Agents and Wasted Spending (May 11, 2026). https://www.gartner.com/en/newsroom/press-releases/2026-05-11-gartner-says-lack-of-semantics-causes-inaccurate-artificial-intelligence-agents-and-wasted-spending
Salesforce: State of Data and Analytics (Nov 2025). https://www.salesforce.com/news/stories/data-analytics-trends-2026/
dbt Labs: State of Analytics Engineering 2026 (Apr 14, 2026). https://www.getdbt.com/blog/new-dbt-labs-report-finds-ai-driven-acceleration-is-outpacing-trust-and-governance
MIT CISR: The Case for a Semantic Layer, Research Briefing XXVI-5 (May 2026). https://cisr.mit.edu/publication/2026_0501_SemanticLayer_LefebvreWixomLegnerVandermeulenBeath
MIT Sloan: Why a Semantic Layer Is Pivotal to Your AI Strategy (Aug 2026). https://mitsloan.mit.edu/ideas-made-to-matter/why-a-semantic-layer-pivotal-to-your-ai-strategy
Futurum Research: Enterprise Data Analytics Survey: 59% Investing in Semantic Layers (Mar 30, 2026). https://futurumgroup.com/press-release/enterprise-data-analytics-survey-finds-59-investing-in-semantic-layers-as-critical-ai-infrastructure/
AngelList Engineering: The Semantic Layer Nobody Maintains (Aug 28, 2026). https://www.angellist.com/blog/the-semantic-layer-nobody-maintains
dbt Labs: Semantic models documentation. https://docs.getdbt.com/docs/build/semantic-models
Snowflake: CREATE SEMANTIC VIEW reference. https://docs.snowflake.com/en/sql-reference/sql/create-semantic-view
Snowflake: Overview of semantic views. https://docs.snowflake.com/en/user-guide/views-semantic/overview
Databricks: Unity Catalog metric views documentation. https://docs.databricks.com/aws/en/uc-semantics/metric-views/
Databricks: Redefining Semantics in the Data Layer for the Future of BI and AI (Apr 2026). https://www.databricks.com/blog/redefining-semantics-data-layer-future-bi-and-ai
Google Cloud: LookML measure types. https://docs.cloud.google.com/looker/docs/reference/param-measure-types
dbt Labs: Bilt Rewards case study. https://getdbt.com/case-studies/bilt-rewards
Lei et al. (ICLR 2025): Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows. https://arxiv.org/abs/2411.07763
Spider 2.0: Official leaderboard. https://spider2-sql.github.io/
Painter et al. (JAMIA Open): Automating pharmacovigilance evidence generation: using LLMs to produce context-aware SQL (2025). https://academic.oup.com/jamiaopen/article/8/1/ooaf003/8005804
Palantir: Ontology overview. https://www.palantir.com/docs/foundry/ontology/overview/
Atlan: Context Layer vs Semantic Layer. https://atlan.com/know/context-layer-vs-semantic-layer/
Apache Ossie: Ossie Enters the Apache Incubator (Jul 2026). https://ossie.apache.org/updates/ossie-enters-apache-incubator/
Databricks: Medallion architecture glossary. https://www.databricks.com/glossary/medallion-architecture
dbt Labs: dbt Labs Affirms Commitment to Open Semantic Interchange by Open-Sourcing MetricFlow (Oct 2025). https://www.getdbt.com/blog/dbt-labs-affirms-commitment-to-open-semantic-interchange-by-open-sourcing-metricflow
Upsolve AI: Data Models. https://upsolve.ai/features/data-models

Try Upsolve for Embedded Dashboards & AI Insights
Embed dashboards and AI insights directly into your product, with no heavy engineering required.
Fast setup
Built for SaaS products
30‑day free trial






