← Back to Journal
Answers

What Is a Semantic Layer for AI, and Why It Matters

Daniela Salgado · Published

What is a semantic layer for AI? It is the set of official definitions for your terms — what counts as an "active client," "revenue" or a "closed project" — that the AI checks before it answers, instead of guessing. Anthropic calls it "the compiled metric and dimension definitions"; making its AI consult them first changed its accuracy.

Why does AI guess when it doesn't have your definitions?

A language model knows a great deal about the world and nothing about how you name it. Ask it about "active clients" and it has to decide what that means: bought this month? Has a current contract? Opened an email? It picks a reasonable option and answers with confidence. If it picked a different one than yours, the answer sounds right and is wrong.

A semantic layer takes that decision away from the model. The definition is already written, once, and the AI reads it before replying.

What exactly did Anthropic measure?

In June 2026, Anthropic's data science and data engineering team published how it uses Claude to answer the whole company's data-analysis questions [1]. Three figures matter, and they should be read in context:

  • Without skills, Claude did not exceed 21% accuracy on their evals.
  • With skills, accuracy was "consistently above 95% in aggregate," and around 99% in certain domains.
  • Without maintenance, accuracy drifted from ~95% to ~65% over a month.

A skill, in Claude Code, is "a folder of markdown the agent reads on demand" [1][3]. What made the difference is what those skills require: Anthropic writes that its agents are "structurally required (by skill instruction) to leverage the semantic layer first" [1].

A necessary caveat: these are Anthropic's measurements, on its own data questions. They are not a Brain Kit® measurement and they do not promise the same number for your work. What they do show is the direction: the jump came from giving the model definitions and an order for using them, not from switching models.

Isn't more data or more examples enough?

It's the first thing people try, and Anthropic tested it. It gave its agent search access to thousands of SQL queries its team had already written. Accuracy moved by "less than a point in either direction" [1]. And in about 80% of the wrong answers, the right answer was already in that material.

Anthropic's conclusion: the bottleneck wasn't access to past work but mapping each question to what it actually means. In their words, analytics accuracy is "a context and verification problem, not a code generation issue" [1].

Their context-engineering guide puts it generally: aim for "the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome" [2]. A precise definition weighs little and says a lot. A thousand examples weigh a lot and settle nothing.

Why does a semantic layer decay?

Because what it describes changes. In Anthropic's case the data model changes daily, so skill documentation, "without active maintenance," is "wrong within weeks" [1]. Hence the drift from ~95% to ~65% in a month.

There's a second finding worth keeping in mind: Anthropic tried having a model auto-generate the definitions from raw tables and query logs, and it was "net-negative on our evals versus a smaller, human-curated layer" [1]. Their recommendation: let Claude help write the documentation, but have a human own each definition.

In other words, a semantic layer isn't installed once. It's tended.

How does it compare with other ways of using AI?

Blank AIMore data or examplesMaintained semantic layer
What it checks before answeringNothing of yours; what it knows about the worldRaw material it has to interpretYour definitions, in a fixed order
What happens with an ambiguous termPicks a reasonable interpretationStill picks, now with more materialUses the written definition
What Anthropic measured [1]Without skills: ≤21%Access to thousands of queries: under one point of changeWith skills: >95% in aggregate
What it needs to keep workingNothing, and nothing improvesMore materialA person updating the definitions

Does it work outside data analysis?

Anthropic's measurement is about data questions; there is no public figure for other uses, and none is made up here. What holds is the principle: when a term has a specific meaning in your work, the AI can only use it well if someone wrote it down.

That applies to anyone who works with their own words: what you call your phases, what counts as "done," what "client" means to you. In July we told how we got here by another route in Your Brain Already Had a Semantic Layer.

How do you start your own semantic layer?

  1. List ten words you use every day that an outsider would read differently.
  2. Write one definition per word, one or two lines, with an example of what counts and what doesn't.
  3. Give each one an owner and a date. One person answers for each definition and revisits it when the work changes.
  4. Make the AI read it first. In Claude Code, an instructions file or a skill that consults it before answering does this [3].
  5. Test it with real questions and compare answers with and without the definitions.

Frequently asked questions

What is a semantic layer for AI?
It is the set of official definitions for your terms (what counts as an "active client", "revenue" or a "closed project") that the AI checks before answering, instead of guessing. Anthropic describes it as "the compiled metric and dimension definitions."
How much does a semantic layer improve accuracy?
On Anthropic's data-analysis questions, Claude without skills did not exceed 21% accuracy; with skills that require it to use the semantic layer first, it rose above 95% in aggregate. That is Anthropic's measurement on its own data, not a guarantee for other uses.
Why does a semantic layer stop working?
Because definitions age. Anthropic watched its accuracy drift from ~95% to ~65% over a month when the documentation was not kept up with changes in its data.
Is it the same as giving the AI more data or more examples?
No. Anthropic gave its agent search access to thousands of past SQL queries and accuracy moved by less than a point. The problem was knowing what each question meant, not having more material.

Sources

  1. Anthropic — "How Anthropic enables self-service data analytics with Claude," Claude blog, June 3, 2026. https://claude.com/blog/how-anthropic-enables-self-service-data-analytics-with-claude
  2. Anthropic — "Effective context engineering for AI agents," Anthropic Engineering, September 29, 2025. https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
  3. Anthropic — "Extend Claude with skills," Claude Code documentation, accessed December 2, 2026. https://code.claude.com/docs/en/skills