GenAI semantic layer
Defs
A semantic layer is a governed translation layer between raw data and business users. It maps technical fields to approved business definitions so every tool, dashboard, and AI agent resolves a metric the same way. In organizations using four or more BI platforms (61% of enterprises, per Forrester), it is the only mechanism that prevents the same metric from returning a different number depending on which tool, dashboard, or AI agent is asking. (atlan)
Q: What's the difference with an ontology?
A semantic layer answers "how much revenue did we make," an ontology answers "what is a customer" instead, resolving entities rather than metrics. Ontology is an important part of the semantic layer though, because it aids in resolving relations between entities.
Translation layer, or: why data and AI people confuse each other
An important word in the above definition that is sometimes overlooked is the word "translation":
A semantic layer intercepts queries between data stores and analytics tools and translates technical field names into governed business definitions. When an analyst queries “Monthly Active Users,” the semantic layer resolves that to the agreed SQL logic, regardless of which BI tool or AI agent issued the request. Think of it as a translation service that runs automatically.
The idea of semantics is not new of course and neither are semantic problems in data analytics. Data governance people were already concerned with making sure that dashboard A does not report let's say revenue X and dashboard B revenue Y. In other words, how do we make sure we talking about the same thing when we report on "revenue"? Which data sources are authoritive for "revenue"? Or do we distinguish different metrics? If yes, which metric is appropriate in which business context?
This is not an easy problem to solve in big enterprises. Often, a lot of this knowledge is distributed through the organization and lives in the head of business intelligence & analytics people.
It's not enough however, to just define metrics and an ontology and then say we have a semantic layer. This is more evident when we consider AI engineers building agents that need to operate on these business concepts. If an end user asks the agent about revenue, how does the correct data end up in the agent's context window? Indeed, the agent needs to be able to actually query the semantic layer!
In other words, the semantic layer is not just about definitions, it's an operational runtime that needs to be able to translate logical queries on governed business concepts into raw SQL (or something similar) on data.
"A semantic layer is operational, meaning that a semantic layer is actually taking a logical query and turning it into a physical query. And that’s where determinism comes into play. A glossary describes things. A semantic layer executes." (David Mariani, CTO of AtScale)
The semantic layer solves a mapping problem: the agent (e.g. using LLM + MCP) no longer needs to translate an open-ended user question in natural language into a SQL query on some database. Instead, the agent queries the semantic layer.
There is however still a mapping problem left: how does the LLM construct the correct logical query on the semantic layer with an unstructured user question as input? In other words, what's the integration interface between LLM and semantic layer?
Well, that's where MCP comes in.
Q: Not sure yet what's the consensus. Nice to do a POC here.
Domain specific MCP with narrow scoped semantic layer -> more feasible but doesn't solve the semantic confusion at scale. If the MCP is domain specific, the semantic information can also be encoded in the MCP server itself. In this setup, you could even argue MCP + LLM is an informal (and non-deterministic!) translation layer from user query to sql query.
In this more narrow setup, the AI system is the semantic layer!
pff
Query engine ?
Wie/wat maakt de vertaling in de praktijk?
PRECIES!
: Translates logical queries into physical queries
Daar zit precies volgens mij het misverstand. Mensen vanuit data land denkten bij semantische laag al snel aan: we moeten gewoon een ontology op entiteiten met heldere definities.
"semantiek via open API's beschikbaar gesteld " -> hoe sluit MCP hierop aan? Waar wordt open taal vraag vertaald naar een query die de semantische laag respecteert?
Hoe gaat MCP de semantische laag queryen?
Open interfaces. The Model Context Protocol, an open standard for connecting AI applications to data and tools, lets a semantic layer or catalog expose its definitions to any compatible agent. The specification also requires user consent and access controls, which matters for governed data.
Components
Atlan:
- Measures. The quantitative facts you aggregate, revenue, churn, active users, each with one agreed calculation instead of a different formula per tool.
- Dimensions. The qualitative attributes you slice and filter by: time, geography, customer segment, product line.
- Entities. The real-world business objects the layer resolves, customer, account, order, the things measures and dimensions describe.
- Relationships. How entities and underlying tables join beneath the surface, so a query doesn’t need to know the schema to ask the question.
- Hierarchies. Drill-down paths within a dimension, year to quarter to month, or product to product family to category.
Wat volgens mij snel vergeten wordt (maar wat ik wel in een paar bronnen zie terugkomen) is dat een semantische laag echt een operationele runtime is: het kan een logische query vertalen naar een "fysieke" SQL query die op de ruwe brondata werkt. MCP is één manier om de semantische laag te bevragen. De flow: user question in chat bot -> LLM extraheert logische query (daar komt al iets van "semantiek" aan te pas, maar die blijft nu nog impliciet in dit verhaal) -> roept MCP aan -> MCP roept semantische laag aan met logische query -> semantische laag vertaalt logische query naar "fysieke" SQL query. Die query moet ergens uitgevoerd worden (als de semantische laag in het dataplatform ingebouwd zit, zit er vaak meteen een query engine bij denk ik dan).
How "thick" is the semantic layer? Semantic vs context layer
https://atlan.com/know/context-layer-vs-semantic-layer
Atlan:
- Semantic layer = metric definitions + business glossary for BI consistency
- Context layer = governance rules + decision precedents + lineage for AI autonomy
- Primary users: Semantic layers serve human analysts via SQL and BI tools
- AI consumers: Context layers serve AI agents via MCP, APIs, and context graphs
- Atlan's approach: Atlan's active metadata platform can enrich semantic definitions with governance, lineage, and operational context, then expose that metadata to AI agents through MCP
The semantic layer gives AI agents deterministic answers to the question “What does this metric mean?” A context layer is the operational shell that wraps the semantic layer, providing the metadata an autonomous agent needs to act safely. The signals it wraps are what active metadata collects, and the difference between active metadata and a context layer is which of them an agent can act on.
MCP kan zowel toegang tot semantische laag als context laag geven. Op welke laag willen jullie zitten?
Toegangscontrole onderdeel van semantische laag?
OSI
https://www.snowflake.com/en/blog/open-semantic-interchanges-specs-finalized/
Where do they live?
| Layer | Where it lives | Best for | Key limitation |
|---|---|---|---|
| Physical (in-database) | Inside the warehouse (views, materialized tables) | Simple metric consistency in a single platform | Tied to one platform; breaks across tools |
| Logical (BI-embedded) | BI platform (Looker LookML, Tableau data model) | Team-level definitions inside one BI tool | Locked to that tool; siloed from other consumers |
| Universal (cross-tool) | Standalone middleware (AtScale, Cube) | Multi-tool consistency without rewriting SQL | No governance or lineage built in |
| Active (metadata-governed) | Metadata platform (Atlan) | Full-stack consistency + AI agent grounding | Requires investment in a catalog platform |