The Semantic Layer Is the Context Your AI Agents Are Missing
Ask an agent for 'revenue last quarter' and it has to guess what you mean. A semantic layer turns that guess into a governed answer, and it may be the most underrated piece of the AI stack.
Ask an AI agent a simple question: what was revenue last quarter?
To answer it, the agent has to make a dozen decisions you never see. Gross or net? Fiscal or calendar quarter? Which currency? Which table? Including the acquisition or not? Point a capable model at a raw warehouse and it will make all of those choices quickly and confidently, and at least one of them will be wrong.
That isn't a model problem. It's a context problem.
What a semantic layer actually does
A semantic layer sits between raw data and the people (and now agents) who consume it. It defines, in one governed place:
- Metrics: what "revenue," "active customer" or "headcount" mean, including the business rules.
- Dimensions: the ways you're allowed to slice them: region, product, time period.
- Relationships: how tables join, so nobody has to rediscover it.
- Access rules: who can see what.
BI teams have built semantic layers for years so that every dashboard shows the same number. The same layer turns out to be exactly what AI agents need.
Why agents need it more than humans do
A human analyst who gets an odd number will pause, ask a colleague and check the definition. An agent won't. It will produce a plausible answer, format it nicely and move on, a million times if you ask it to.
A semantic layer changes the agent's job from writing SQL against tables it doesn't understand to choosing from metrics the business has already defined. That's a much easier problem, and one models are very good at.
How it fits with MCP
The cleanest architecture I've found looks like this:
- Warehouse or analytics platform holds the data.
- Semantic layer defines metrics, dimensions and access rules.
- MCP server exposes the semantic layer as a small set of tools, like
get_metricandlist_dimensions. - Agent chooses the right tool and parameters, then explains the result in plain language.
Each layer does one job. Definitions live in one place. And when the business changes what "active customer" means, every dashboard and every agent picks up the change at once.
A quick test for your organization
Pick your five most important metrics and ask three people to define them. If you get more than five answers, your organization isn't ready for AI agents yet, but you know exactly where to start.
An agent without a semantic layer is a very fast analyst on their first day. Give it the context a ten-year veteran carries in their head.
The unglamorous work of agreeing on definitions has always been the foundation of good analytics. In the age of AI, it's also the foundation of trustworthy agents.