In dbt Labs' April 2026 benchmark, frontier models answered 64.5% of business questions correctly with raw text-to-SQL, rising to 84–90% once the underlying data was modelled, and 98–100% once questions were routed through a semantic layer. Text-to-SQL fails silently with a plausible wrong number; a semantic layer fails loudly. Use each where it fits.

The numbers

dbt Labs' 2026 benchmark: accuracy on business questions, by approach
ApproachAccuracyWhat it means
Raw text-to-SQL (unmodelled tables)64.5%The model guesses joins, filters and which "revenue" you mean, from scratch, every time
Text-to-SQL against modelled data84.1–90.0%Better once tables are tidied and labelled, but still guessing which business logic applies
Semantic layer (modelled questions)98.2–100%The model picks from a certified, pre-agreed definition instead of writing new logic

The study, an April 2026 re-run of dbt Labs’ own benchmark, tested Claude Sonnet and Opus 4.6, GPT-5.3-Codex and GPT-5.2 against an eleven-question set on a synthetic insurance dataset, twenty runs per question. It’s worth noting what “modelled questions” means here: the semantic layer’s 98–100% applies to the kind of question it was actually built to answer, not to anything you could theoretically ask. That caveat isn’t a weakness in the finding so much as the entire point of the finding, which the next section explains.

A semantic layer closes most of the gap left by raw text-to-SQL, on the questions it has been modelled to answer. Illustrative diagram, data: dbt Labs, April 2026

Why the failure mode matters more than the score

A 65% accuracy rate sounds workable until you ask what the other 35% looks like. dbt Labs’ own framing is the important part: raw text-to-SQL “returns plausible but incorrect answers silently”. There’s no flag, no lower confidence tone, no visible hedge. A wrong join that quietly double-counts a table, or a filter the model guessed rather than confirmed, produces a number that reads exactly like a right one. A semantic layer inverts that failure mode. When a question falls outside what’s been modelled, a well-built one says so explicitly, rather than reaching for the nearest table and improvising. That’s a genuinely different kind of wrong: one you can see coming, and one that tells you when to stop trusting the output rather than letting you find out later, in a board meeting.

Independent evidence

The dbt Labs benchmark isn’t the only data point. An independent study on arXiv (Rumiantsau and Fokeev, 28 April 2026) ran a separate test: 100 questions against a synthetic retail dataset, across Claude Opus 4.7, Claude Sonnet 4.6 and GPT-5.4. Adding a compact, 4 KB semantic document to the prompt lifted accuracy by 17 to 23 percentage points, taking the models from 45.5–50.5% without it to 67.7–68.7% with it (p < 0.01). Two findings from that study matter beyond the headline number. First, the three models converged to a similar accuracy once the semantic context was added, which means the definitions did more work than the choice of model. Second, this was a much smaller, cheaper intervention than a full production semantic layer: a single short document, not a governed platform, still moved the needle substantially. That’s useful evidence that even a partial step (writing your key definitions down somewhere an AI tool can read them) is worth doing before a bigger project is scoped.

When text-to-SQL is fine

None of this makes text-to-SQL a bad tool; it makes it the wrong tool for a specific job. It remains genuinely useful for ad hoc exploration: an analyst poking at a new question that hasn’t been modelled yet, checking a hunch, or looking at data nobody has built a certified metric for. dbt Labs’ own recommendation, drawn from the same study, is directly usable as a rule of thumb: reserve the semantic layer for “board data, auditors, OKRs, KPIs, weekly reports”, and keep text-to-SQL for genuine ad hoc exploration where nothing has been defined yet and a rough, checkable answer is enough.

There’s a second, quieter reason text-to-SQL still earns its place: coverage. A semantic layer only answers questions it has been built to answer. However carefully you pick your twenty or so core metrics, someone will eventually ask something outside that list, a one-off question about a specific transaction, a new product line nobody has modelled yet, a hunch worth ten minutes of digging. Refusing that question outright, or waiting weeks for it to be added to the semantic model, pushes people back towards pasting exports into a chat tool, which is the exact behaviour a governed setup is meant to replace. The honest answer is to let text-to-SQL take those questions, clearly labelled as exploratory, while the growing list of things people ask repeatedly graduates into the semantic layer over time.

What this looks like in a real rollout

In practice, most businesses don’t choose one approach and switch off the other; they draw a boundary and move it as they learn. A sensible starting boundary looks like this: anything that appears in a board pack, a weekly report, or a recurring dashboard goes through the semantic layer, no exceptions, because that’s exactly the class of question the dbt benchmark shows going wrong most expensively. Anything genuinely new, unusual or exploratory goes through text-to-SQL, ideally against a sandboxed replica rather than the production warehouse, so an occasional bad guess costs nothing beyond a wasted query. The boundary isn’t fixed: when the same “exploratory” question gets asked for the third or fourth time, that’s the signal to promote it into a certified metric rather than leaving it to be silently re-guessed by the model every time it comes up.

Two practical habits keep this honest rather than aspirational. First, tag every AI-generated answer with which route produced it, semantic layer or free-form SQL, even if that’s just a line of small print under the answer. People make very different trust decisions about a number depending on which one they’re looking at, and they can only do that if the distinction is visible rather than hidden inside the tooling. Second, keep a running list of the questions text-to-SQL gets asked most often. That list is, in effect, a prioritised backlog for what to model next, and it turns an argument about “should we build a semantic layer” into a much smaller, evidence-based argument about which five metrics to add this quarter.

The hybrid set-up we recommend

The practical answer for most businesses isn’t choosing one over the other; it’s routing each kind of question to the tool suited to it. Semantic layer queries handle anything that will be asked more than once, reported regularly, or shown to someone outside the room: revenue, margin, active customers, churn. Free-form text-to-SQL stays available for exploration, ideally against a sandboxed copy of the data rather than production tables, so a wrong guess costs nothing more than a wasted query. The two aren’t in competition; a well-run analytics setup uses both, and the discipline is simply being honest about which questions belong in which bucket, and building an evaluation set of real questions so you can tell, concretely, whether either approach is actually working before you rely on it.

Building that evaluation set is worth doing before you build anything else. Write down twenty to thirty real questions people actually ask, along with the answer a careful human would give today, and re-run that same set every time the semantic layer changes or a model is upgraded. That’s the only reliable way to know whether a change made things better or quietly made them worse, and it costs an afternoon rather than a project.

Getting from a pile of raw tables to a working semantic layer for the numbers that matter usually takes a few weeks, not months, once the definitions themselves are agreed; our semantic layer service builds exactly this, in whichever platform your team already uses day to day, and our AI data readiness review is the right starting point if you’re not yet sure which twenty numbers to model first.

Which approach fits?

Is the data it needs in reasonable order?
Not yet, nobody could tell you where it all is

Fix the data first

Almost every approach below depends on knowing what data you have, where it lives and who owns it. Start there.

Once a short inventory exists, with an owner named for each system that matters, come back and answer again.

Yes, roughly, we know where the key data lives
What do you want AI to do?
Answer questions from documents
Do answers depend on how things connect, who, which, what's affected?
Yes, the connections are the point
Do different people see different documents?
Yes, access varies by person or team

GraphRAG, with permission-aware retrieval

The connections are the point, and different people are allowed to see different documents: the graph and the retrieval layer both need to respect that.

If access is the same for everyone who would plausibly ask, the governance layer adds cost without changing an answer. Use plain GraphRAG.

No, access is roughly the same for everyone who’d ask

GraphRAG on a knowledge graph

Your questions follow connections, who is affected, what links these records, what changes if this policy changes.

If the corpus is mostly "find the right paragraph", a knowledge graph is more than the question needs. Start with RAG.

No, it's mostly the right paragraph
Do different people see different documents?
Yes, access varies by person or team

RAG, with permission-aware retrieval

Retrieval over documents is enough, but different people are allowed to see different documents, so the retrieval layer has to filter by who is asking.

If access is roughly the same for everyone, the permission layer is unneeded complexity. Use plain RAG.

No, access is roughly the same for everyone who’d ask

RAG: retrieval over your documents

The question is answerable from the right paragraph, once it is found, and connections between records rarely matter.

If people keep asking "who else is affected" or "what does this link to", the answers need a graph, not a better search index.

Answer questions about numbers
Do your key numbers have one agreed definition?
No, finance and sales would give different answers

Semantic layer first

Finance, sales and marketing would each give a different number for the same name. Agree the definition once, before automating anything on top of it.

If every team already reads a number the same way, skip straight to governed text-to-SQL.

Yes, we already agree what they mean

Semantic layer + governed text-to-SQL

Definitions are already agreed: the remaining work is letting people ask in plain English against a model that always uses the certified metric.

If the definitions themselves are still contested between teams, text-to-SQL will just automate the disagreement. Settle the definitions first.

Take actions across tools
Are the steps predictable and easy to review?
Yes, a person could check each step in seconds

An agent with MCP connections and a human checkpoint

The steps are predictable enough that a person can review each one in seconds, a genuinely useful place for an agent to act, with a checkpoint before anything leaves draft.

If a reviewer can't tell whether a step is right without redoing the work themselves, the checkpoint is theatre. Start with drafts instead.

No, it varies a lot case to case

Start with an assistant that drafts, not acts

The steps vary a lot case to case, so a person needs to be making the real decisions for now, with AI preparing the draft.

Once the same handful of steps repeat predictably and a reviewer can check them at a glance, an agent with a human checkpoint is worth revisiting.

Write consistently in a house style
Would a tested prompt library with examples do it?
Probably, the style is fairly consistent already

A tested prompt library

The house style is fairly consistent already: a small library of tested prompts and examples, kept up to date, is the cheapest way to get it reliably.

If the style still drifts badly after a genuinely tested prompt library, that is the signal to consider fine-tuning, not the first move.

No, we’ve tried prompting and it still drifts

Fine-tuning: rarely the first step

A genuinely tested prompt library still drifts from the house style, and the cost of fine-tuning and keeping a tuned model current is worth it for the volume involved.

Most style problems are prompt and example problems, not model problems. Try a tested prompt library properly before this.

Frequently asked questions

Is text-to-SQL accurate enough to trust for business reporting?

Not on its own. In the most recent benchmark, raw text-to-SQL against unmodelled data answered 64.5% of business questions correctly, and the wrong 35% often looked just as plausible as the right answers. Use it for exploration, not for numbers that go in front of a board.

What's the actual difference between text-to-SQL and a semantic layer?

Text-to-SQL turns a plain-English question into a database query from scratch each time, guessing at joins and filters. A semantic layer holds pre-agreed metric definitions, joins and access rules that every query, human or AI, selects from by name instead of reinventing.

Why does the failure mode matter more than the accuracy number?

Because a silent failure is far more dangerous than a visible one. Text-to-SQL's wrong answers look exactly like its right ones, so nobody knows to check. A well-built semantic layer says explicitly when a question falls outside what's defined, which is a safer kind of wrong.

Does model choice matter more than the semantic layer?

Less than you'd expect. An April 2026 arXiv study found accuracy converging in a similar range across Claude and GPT models once a small semantic document was added, with the semantic context contributing more to the improvement than which frontier model ran the query.

Can we use both text-to-SQL and a semantic layer?

Yes, and it's usually the right set-up. Route metric and reporting questions through the semantic layer, and keep free-form text-to-SQL available in a sandbox for genuine ad hoc exploration where a defined metric doesn't yet exist.

How quickly can we get from raw text-to-SQL to a semantic layer?

For the twenty or so numbers a typical business actually reports on, a first working semantic model is usually achievable within three to four weeks, including agreeing the definitions, which is often the slower part of the two.

Sources

  1. Semantic Layer vs. Text-to-SQL: 2026 Benchmark Update. dbt Labs, April 2026.
  2. arXiv 2604.25149. arXiv, April 2026.
  3. Semantic Layer for AI Agents (2026). Cube, August 2026.