ArticlesResearch6 min read

ZLens took the same AI model from 59.5% to 87.5% on business questions

A pre-registered test on 200 questions from an insurance warehouse: what in ZLens moved accuracy, where it still lost, and why the numbers your CFO sees need a person’s sign-off on top.

Kranthi Kondapaka · DuckCode AI Labs

  • 59.5% → 87.5%exactly right on 200 business questions: the same AI model alone, then inside ZLens
  • 7 of 7AI models scored higher in ZLens once it had a model of the warehouse
  • 1 in 8answers still wrong at 87.5%, and nothing in the answer says which

Every data lead I talk to gets the same question now. Can we just let people ask the AI?

The honest answer is that it depends on two things. What the AI knows about your warehouse, and which numbers you can afford to have wrong. I wanted to measure the first one properly, so we published the test plan before we ran it.

The short version: one AI model answered 200 business questions. Writing SQL in one shot from the table definitions, it got 59.5% exactly right. Inside ZLens, working from a model of the warehouse and its metrics, it got 87.5%. Some things that sound helpful did not help. In a few places our own tool, ZLens, came out no better than a plain agent, or worse.

How we tested

We used a public insurance warehouse, ACME, from data.world’s benchmark data as dbt Labs packaged it. It has 29 tables, with money split across several of them and some misspelled names. It is also small, so it tests an awkward schema, not scale.

The questions came from AI agents that never saw ZLens, 550 of them across the study. For the final set, we published the test plan first. Then a GPT model wrote 200 answerable questions, plus 50 that this data cannot answer, where the right reply is to say so. Nothing in ZLens was changed because of the final set.

One AI model, Claude Sonnet 5.5, answered every question in each setup:

  1. One-shot SQL written from the table definitions.
  2. An agent with database tools that can look around before it answers.
  3. The same agent, also given our model of the warehouse and its metric definitions as plain text.
  4. ZLens at four levels: two reading the dbt project and two reading the warehouse catalog, all with the model and metrics.

The model of the warehouse was written before the test by a separate Claude agent that had never seen the questions. It worked from the dbt project’s SQL files, the table definitions and data.world’s ontology, and took about 11 minutes. ZLens did not draft it.

An answer counted only if it returned the reference rows. We report a strict grade and a lenient one, which also forgives a missing or different label column. A person audited a sample of the reference answers. We published hashes of the final question files before any system saw them, so anyone can check the released files are the ones we ran.

What moved accuracy: a model of the warehouse

Two things moved accuracy on the final set. Letting the AI look around the database added 11 points. Giving it a model of the warehouse, meaning which tables hold which business things and how they join, added 10 more. Every ZLens level beat one-shot SQL by a margin very unlikely to be chance (Holm-corrected p < 0.001).

Same AI model, same 200 questions: 59.5% alone, 87.5% in ZLens

Share answered exactly right on the final test (set 5), Claude Sonnet 5.5. The line under each bar is its 95% interval.

Share answered exactly right, set 5
SetupExactly right95% interval
One-shot SQL from the table definitions59.5%52.5% to 66.5%
Agent with database tools70.5%64.0% to 77.0%
Same agent + our model and metrics, as text80.5%75.0% to 86.0%
ZLens: warehouse catalog + model + metrics87.5%83.0% to 92.0%
Source: the paper’s set 5 results (pre-registered).

Under the strict grade, ZLens went 7 points further than the agent reading the same model as text. Under the lenient grade they tie, which I come back to below.

Adding a model of the warehouse lifted ZLens on all seven AI models

Correct answers out of 40 on an earlier test (set 3): gains of 8 to 18.

Correct answers out of 40, set 3
AI modelZLens, dbt project onlyWith a model of the warehouseGain
Qwen 3.8 27B, on a laptop1028+18
Claude Sonnet 52033+13
GPT-6 Luna1932+13
GPT-5.6 Terra1730+13
Claude Opus 5.52434+10
GPT-6 Sol2030+10
Claude Sonnet 5.52432+8
Source: the paper’s set 3 results.

The effect held for every AI model we tried. On an earlier set of 40 questions, ZLens with the model beat ZLens with only the dbt project for all seven, from a small open model on a laptop to Claude Opus 5.5 and GPT-6 Sol. Without the model, most misses were refusals to answer, not wrong numbers.

What did not help

We also tried a business layer on top of the model: metric definitions drafted and checked by AI agents from a business brief, then certified by a person. It sounds like it should be the best setup. It was not. On the final 200 questions it scored 83.0% against 87.5% without it. On the earlier set of 200 it scored 77% against 85.5%, and 13 of the 26 answers it labelled as governed were wrong.

What went wrong: its metrics got applied to questions they did not fit, and those wrong answers came out under an official label. More context helps only when it is applied to the right question.

The two levels that read the dbt project at query time scored 79.5% and 82.5%. The level that read the warehouse catalog, with the same model and metrics, scored 87.5%. So dbt does not need to be in the loop when people ask questions, although our model and metrics were written from a dbt project.

Where our own tool lost

We could have left these out. I think the useful part of a benchmark is where it breaks, so here they are.

  • The lead over the agent depends on the grade. Under the strict grade, ZLens beat the agent that had the same model and metrics as text by 7 points (95% interval +1.5 to +12.5, p = 0.02). Under the lenient grade they tie, 184 each.
  • Labels were not reliable enough. ZLens labels each answer by how it was made. At the levels built on dbt metrics, 36 of the 54 answers labelled governed were right under the strict grade. Our own target was 95%. We missed it.
  • Saying “I don’t know”. ZLens declined 39 to 45 of the 50 questions the data cannot answer, depending on the level. The agent with the same knowledge declined 46.
  • A smaller model. With Qwen 3.8 27B running on a laptop, ZLens and the agent did not differ significantly under the strict grade (145 against 141, p = 0.71). Under the lenient grade the agent was 8 points ahead.

Two limits matter when you read any of this. The warehouse is small, so these numbers say nothing about a 4,000-table account and cannot be compared with BIRD or Spider 2.0 scores. And no answer in the test was certified by a person, so it does not measure certified answers at all.

What this means if you run a data team

87.5% sounds good until you turn it around. One answer in eight is wrong, and nothing in the answer tells you which one. For a question someone is exploring, that is fine. For the revenue number in the board pack, it is not.

So I would not ask whether AI is accurate enough. I would split the questions. Let AI draft answers to the open-ended ones, and label them clearly as AI-generated. Take the 20 to 50 numbers that have to be exact, check each one against the report you trust today, and have a named person sign off on it. After that, when someone asks for one of those numbers, they get the signed-off answer, not a fresh guess.

That is how we built ZLens. Certified answers come first, then answers built from approved metric definitions, and only then SQL that the AI writes, labelled as AI-generated. You can upload the export of an existing report, and ZLens says whether its numbers match, or names the row and column where they differ. The test above is why the model of the warehouse comes first: with it, ZLens reached 87.5%, and an agent reading it as text reached 80.5%.

Check it yourself

Everything is public: the paper (24 pages), the test plan we published first, every run report, and how to reproduce the numbers. It is archived on Zenodo as doi.org/10.5281/zenodo.24329320. If you find a mistake in the reference answers or the grading, tell me and I will publish the correction.

To try ZLens on your own data, the open-source version runs on your machine:

npx -p @zlens/cli zlens notebook ./my-data

If your data is in Snowflake, ZLens for Snowflake runs inside your own account and reads only what you grant it. It is free on Snowflake Marketplace.

If you run a data team and want to try the certified-numbers approach on your own reports, write to me at hello@zlens.app.