AI
Semantic layers for AI: why agents need one definition of your metrics
What a semantic layer is, why AI assistants and agents give wrong answers without one, what it should contain, and the options on Databricks, Snowflake, dbt and Power BI, with an approach to building it.

Hemant Walchale
· 3 min read
Ask two AI assistants “what was revenue last quarter?” and you can get two different numbers, both confidently stated. The model is rarely the problem. The problem is that “revenue” lives in the heads of a few analysts and in hundreds of slightly different SQL queries. A semantic layer writes that meaning down once, so people and AI use the same definitions.
Why AI gets metrics wrong without one
An assistant writing SQL from raw tables has to guess:
- The formula: is revenue gross or net of refunds? In which currency?
- The joins: which key connects orders to customers, and what happens to orders with no customer?
- The filters: are test accounts, cancelled orders or internal transactions excluded?
- The words: does “sales” mean revenue, units or bookings?
Each guess can be reasonable and still differ from the finance number. Across many prompts, the assistant becomes a source of conflicting figures, and trust collapses quickly.
What a semantic layer contains
- Metrics with their exact calculation (net revenue = order amounts − refunds, converted to USD).
- Dimensions to slice by (region, product, customer segment, fiscal calendar).
- Relationships between tables, so joins are defined once.
- Business names, descriptions and synonyms, so natural-language questions map to the right fields.
- Verified questions and answers, examples that show the AI how a correct query looks.
- Governance: the layer should inherit access rules from the underlying tables, not bypass them.
Options by platform
| Platform | Semantic layer |
|---|---|
| Databricks | Unity Catalog metric views, used by AI/BI dashboards and Genie |
| Snowflake | Semantic views, used by Cortex Analyst and Cortex Agents; table-level row access and masking policies propagate to them |
| dbt | dbt Semantic Layer, powered by MetricFlow (open-sourced under Apache 2.0 in October 2025) |
| Power BI and Microsoft Fabric | Semantic models |
The Open Semantic Interchange (OSI) initiative, led by Snowflake with partners including Salesforce, Sigma and dbt Labs, is working on a vendor-neutral format so definitions can move between tools without being rewritten.
How to build one without boiling the ocean
- Start from questions, not tables. List the 20 questions executives and the AI assistant will be asked most.
- Define the 10 to 15 metrics those questions need, agree each with its business owner, and record the owner.
- Model on gold tables (see medallion architecture), not raw data.
- Add synonyms and verified queries for each metric, using real phrasing from users.
- Test the assistant against known answers before release, and re-test whenever a definition changes.
- Expand by domain, the same way migrations move in waves.
The short version
A semantic layer gives metrics, relationships and business terms one governed definition, so dashboards and AI assistants return the same numbers. Use your platform’s native option (or dbt for multi-platform estates), start from the questions people ask, and test the assistant against known answers.
Related: AI agents on governed data, how to assess AI readiness, what is data lineage and our AI-ready data service.
Sources
- Unity Catalog metric views, Databricks documentation
- Best practices for semantic views, Snowflake documentation
- The dbt Semantic Layer, dbt documentation
- dbt Labs open sources MetricFlow and affirms commitment to Open Semantic Interchange, dbt Labs
Further reading from other practitioners
- What is an AI-ready semantic layer, and what does it unlock?, Aimpoint Digital
- How Databricks metric views bridge business context and data, Aimpoint Digital
- Snowflake semantic views: real-world insights and best practices, phData
- Getting the semantic model and layer right in the age of AI, Analytics8
Not sure where your own platform stands? Take the free 3-minute data platform scorecard, or see how we work on Databricks. Unfamiliar terms are explained in the data engineering glossary.