Skip to main content

Analytics Agent Bench: Lessons From 150+ Runs

An analytics agent goes wrong on the business rules nobody documents. Ours were already in the SQL our analysts had run, and serving that SQL took the agent from 32% to 83% on 107 real questions.

Himanshu Sikaria

Himanshu Sikaria

Head of AI Labs & Field Engineering

December 1, 2026·21 min read

Editor’s note: An analytics agent was asked how much the sales pipeline one conference influenced. Given only the table definitions, it answered without hesitation, and its number was 4.4 times the right one. Himanshu Sikaria’s team then put 107 real business questions to that agent more than 150 times, changing one kind of context each run, to find out what fixes it. This is the full write-up with all 17 figures. The findings fit in the box below, and the evidence for each follows.

The findings in brief

  • Context that shows past decisions beat context that describes the data. With table definitions alone (bare schema), the agent got 32% right. With a metrics layer, metric definitions mined from analysts’ past queries and checked against the warehouse, it got 83%.
  • Documentation, hand-written semantic views and an ontology topped out at 44%. On the 61 questions that need a join, none of them passed 18%.
  • The same metric written as SQL beat the same logic written in English, 84% to 75%. All of the gap came from questions that need a join.
  • The setups people built by hand took about 160 hours and scored near the bottom. The two most accurate setups were also the two fastest.
  • A better model mattered less than better context. With past SQL, an open-weight model that started 8 points behind finished ahead.

In this piece: The problem · How we tested · The conference question · Describing the data · What worked · Why SQL worked · SQL or English · Cost and speed · Context or a better model · Getting to 100% · What we learned · Every answer


Every company wants self-serve analytics: anyone asks a question and gets a number they can trust. In practice, most answers still go through an analyst. The usual fix is to give an AI agent the context a human analyst would need: descriptions of tables and columns, documentation, definitions. That barely moves the agent’s accuracy, and writing it by hand doesn’t scale. We wanted to know exactly which context does move accuracy, and how to test that rigorously. We only tested context that AI generated from what the warehouse and dashboards already hold, because nobody will write it by hand at scale. So we asked an agent 107 real questions about our business, more than 150 times, changing one kind of context each time.

Headline results. Across all 107 questions, accuracy went from 32% with table definitions alone to 83% with context generated from the warehouse. On the 61 questions that need a join, it went from 11% to 82%.

Across all 107 questions, accuracy went from 32% with table definitions alone to 83% with context generated from the warehouse. On the 61 questions that need a join, it went from 11% to 82%. | Source: Context and Chaos


The problem that isn’t solved yet

Everyone is building agents that let people talk to their data. We tested ours on our own go-to-market data, which hundreds of people here query every day and which is as messy as any customer’s. We built a bench: real questions, each with a sealed right answer, put to the agent again and again with one thing changed at a time.

Here is an example to make this real. One question in our benchmark asks, “How much sales pipeline did a conference influence?” The answer has to count each customer account once.

The tables to answer it are all there: who registered, who attended, which accounts they belong to, which deals those accounts have. Give an AI agent the table definitions and it writes a tidy query and returns a number without hesitation.

The number is 4.4 times the right answer. The agent added up every deal for every person on every row. It counted deals that existed before the conference, and people who registered but never showed up. Anyone on our marketing team knows the three rules for this question:

  1. count each account once, however many of its people came;
  2. count only deals that started after the event;
  3. count only people who actually attended.

None of those rules is written in the tables. That is what goes wrong with most analytics agents. The model can write SQL. What it lacks are the decisions a business has made and never written down, and describing tables and columns doesn’t solve that. We wanted to know which kind of context actually gets those decisions to an agent, so we tested every kind we could find.


How we tested

The benchmark is 107 hard questions our own teams asked of that data: dashboard tiles, questions from business reviews, requests that landed on an analyst’s desk. Each has one right answer, usually a number, a count or a date. We sealed each answer by running the correct SQL against a frozen copy of the warehouse and checking it against the dashboard the business already trusts.

The questions: 107 questions from five parts of the business. The 107 questions came from five parts of the business: marketing events and campaigns (40), account and product usage (22), sales pipeline (21), customer success (17) and sales operations (7).

The 107 questions came from five parts of the business: marketing events and campaigns (40), account and product usage (22), sales pipeline (21), customer success (17) and sales operations (7). | Source: Context and Chaos

Every run used the same single read-only SQL tool, the same step limit and the same questions. Only the context placed in front of the agent changed. Code graded every answer: counts had to match exactly and amounts agree within half a percent, and a refusal counted as a miss.

With two exceptions, no person wrote the context. Every metric, past query and definition the agent saw was built by our systems from what the warehouse already had, mainly the log of queries our analysts had run. The exceptions are the comparisons: we wrote the semantic views by hand, and people built the ontology with a model’s help, to match how teams build them today.

The query log was the main source, but not the only one worth mining. Dashboards hold the definitions the business already agreed to show, so reverse-engineering the BI reports leaders read is the other half of the job.

How one run works. In each run the agent sees the question and the context under test, and queries a frozen copy of the warehouse. Only the grader sees the sealed answer.

In each run the agent sees the question and the context under test, and queries a frozen copy of the warehouse. Only the grader sees the sealed answer. | Source: Context and Chaos

Here are the pieces of context we compared, and how each one performed.

The setups. Eight setups, same model, same questions. The five that describe the data scored 31.8% to 43.9%. The three that show past SQL scored 70.1% to 83.2%.

Eight setups, same model, same questions. The five that describe the data scored 31.8% to 43.9%. The three that show past SQL scored 70.1% to 83.2%. | Source: Context and Chaos


First up: back to our original question

Before any averages, here is the conference question from the opening run through the setups. For each, we read the agent’s SQL to see which of the three rules it applied, and how far off its answer was.

How much pipeline did the conference influence, counting each account once?. Table definitions alone applied none of the three rules and landed at 4.4 times the right answer. Three ways of describing the data applied one rule (4.0 times). Past SQL applied two (1.7 times). Only the metrics layer applied all three and got it exactly right.

Table definitions alone applied none of the three rules and landed at 4.4 times the right answer. Three ways of describing the data applied one rule (4.0 times). Past SQL applied two (1.7 times). Only the metrics layer applied all three and got it exactly right. | Source: Context and Chaos

Describing the data got the agent one rule out of three, and three quite different ways of describing it landed on exactly the same wrong number. The rules that fixed the answer, the date cut-off and the attendance filter, arrived only in SQL that someone had already written. The rest of this piece shows the same pattern across all 107 questions.


Describing the data barely helped

We started where most teams start, and where most advice points: tell the agent more about the data.

  • Documentation gave the agent table and column descriptions, detailed READMEs, and the popular filters and joins mined from the query log. It reached 43.9%, 12 points above bare schema. The written descriptions alone reached 39.3%; the filters and joins added the rest.
  • Semantic views, 40 files written by hand, reached 38.3%. Each view declares how its tables join, but not when a join should be used, and the agent struggled to join one semantic view to another.
  • The ontology reached 33.6%, and took more than five minutes per question. It was a virtual knowledge graph. Most of our questions ask what happened, which means aggregates, and running aggregates through the knowledge graph was slow and didn’t lift accuracy.
  • Column profiling reached 34.6%. It made the agent far more willing to answer: refusals fell from 33 to 9. But only three of those became right answers. The rest became wrong ones. We call this confident drift.

Each of these tells the agent what the data is. None tells it a decision the business has made.


What worked: SQL that shows the decision

An analyst who has already written the right query for the conference question has already decided to count accounts once, cut off at the event date and drop the no-shows. The query carries those decisions. So does every query in the log that someone wrote, ran and kept using. The problem is separating that signal from the noise.

Giving the agent the five most relevant past queries took it from 31.8% to 70.1%. Trust what people reuse: ranking queries by how many analysts ran them reached 75.7%, at 1.3¢ per right answer, the cheapest we measured.

The metrics layer goes one step further. Our systems mine the query log for metrics, merge duplicates, run each metric’s SQL against the warehouse to check it, and serve the few that fit each question alongside trusted past SQL. It reached 83.2%, and broke nothing: every question bare schema got right, it got right too.

Describing the data vs showing the decision. Every setup that shows decisions as SQL scored above every setup that describes the data.

Every setup that shows decisions as SQL scored above every setup that describes the data. | Source: Context and Chaos


Why SQL worked: the hard questions need complex rules

Why did SQL work where descriptions didn’t? Most of the difference comes from one kind of question: the ones that need data from more than one table. With bare schema, the agent answered 31.8% of questions correctly. That average hides two very different results. On the 42 questions a single table can answer, it got 64% right. On the 61 that need data from more than one table, it got 11% right, and it refused to answer half of them.

Describing how the tables connect did not fix this, because the join was never the whole problem. The rules were missing, and on these questions the rules are more complex and span tables: count each account once, count only deals after the event, count only people who attended. That is where the agent struggled most. Semantic views and the ontology both spell out the joins, and both stayed under 20% on these questions. We tried five different ways of describing joins in all; every one landed between 15% and 18%. When we read the agent’s SQL, it often contained no join at all: the agent had found one wide table and answered from that.

We call this join blindness. Only past SQL and the metrics layer, both of which show joins that already worked, broke through it.

Questions that need a join are where setups differ. On questions that need a join, the setups that describe the data stalled between 11% and 18%. Past SQL reached 61% and the metrics layer 82%.

On questions that need a join, the setups that describe the data stalled between 11% and 18%. Past SQL reached 61% and the metrics layer 82%. | Source: Context and Chaos


Does it have to be SQL? Why not just English?

So is it the knowledge in the SQL that helps, or the SQL itself? Could the same rules, written in plain English, work as well? We tested it directly. We took the metrics layer and served every metric two ways: once as its name and SQL, once as its name and English prose carrying all the same logic. Nothing else changed.

SQL won, 84.1% to 74.8%. On questions that need a join, SQL got 50 of 61 right and English got 40. On single-table questions, they tied at 40 of 42. When the answer sits in one table, a sentence is enough. When it needs a join, the agent has to turn the sentence into SQL itself, every time, and every translation is another chance to drop a rule.

The same metric, in English and in SQL. The same conference metric, written as English and as SQL.

The same conference metric, written as English and as SQL. | Source: Context and Chaos

Taking each metric apart pointed the same way. Removing its English description cost nothing. Removing its SQL cost 8 points.

What each part of a metric is worth. Serving a metric as its name and SQL scored 84.1%. Serving it as its name and English scored 74.8%.

Serving a metric as its name and SQL scored 84.1%. Serving it as its name and English scored 74.8%. | Source: Context and Chaos

The same held at the level of a single table. In a separate test on 35 questions, with the same table scope and budget, we swapped only the notes on each table. The table’s own DDL, the SQL that created it, beat our pre-existing catalog description by 20 points, with half the queries. The gotchas live in the SQL; descriptions don’t carry them.

The table's own DDL beat its written description. On a separate 35-question test, a table's own DDL scored 68.6%, against 48.6% for its catalog description and 42.9% with no notes, using half the queries.

On a separate 35-question test, a table's own DDL scored 68.6%, against 48.6% for its catalog description and 42.9% with no notes, using half the queries. | Source: Context and Chaos


The most accurate setups were also the fastest

Accuracy is only part of the picture. An agent people use every day also has to be cheap and fast enough to run, so every run logged tokens, dollars and seconds per question. The two most accurate setups were also the two fastest: 29 and 22 seconds per question. Ranked past SQL produced the cheapest right answers, at 1.3¢. The metrics layer cost 3.9¢ per right answer, close to bare schema’s 3.4¢, for 2.6 times as many right answers.

The setups that describe the data were slower, and the slowest by far was the ontology: more than five minutes per question and 22.6¢ per right answer, about six times the metrics layer. Describing the data gives the agent more to read and no query that already works, so it searches more before it answers.

Accuracy against cost per right answer. Top left is best. The metrics layer got the most right (83.2%) at 3.9¢ per right answer. Ranked past SQL was cheapest at 1.3¢. The ontology cost 22.6¢.

Top left is best. The metrics layer got the most right (83.2%) at 3.9¢ per right answer. Ranked past SQL was cheapest at 1.3¢. The ontology cost 22.6¢. | Source: Context and Chaos

Accuracy, cost and time. One run of all 107 questions per setup. The two most accurate setups were also the fastest: 29 and 22 seconds per question.

One run of all 107 questions per setup. The two most accurate setups were also the fastest: 29 and 22 seconds per question. | Source: Context and Chaos

There is one more cost no token counter sees: the people who write the context. Nobody wrote our metrics layer; our systems mined it. The two setups people built, the semantic views (about 60 hours) and the ontology (about 100), scored near the bottom.

Who wrote the context. The two setups people built by hand took about 60 and 100 hours. The metrics layer took none to build and scored highest.

The two setups people built by hand took about 60 and 100 hours. The metrics layer took none to build and scored highest. | Source: Context and Chaos


Context or intelligence: which matters more?

New models arrive every few months. Could a smarter one make all this context unnecessary? Changing the model mattered less than changing the context. With bare schema, five models scored between 31.8% and 42.1%. Given past SQL, an open-weight model went from 31.8% to 70.1% and a leading closed model from 40.2% to 66.4%. The model that started ahead finished behind.

Better context beat a better model. With table definitions alone, the closed model led 40.2% to 31.8%. With past SQL, the open-weight model finished ahead, 70.1% to 66.4%.

With table definitions alone, the closed model led 40.2% to 31.8%. With past SQL, the open-weight model finished ahead, 70.1% to 66.4%. | Source: Context and Chaos


How to get to 100%

The configuration we ship missed 18 of 107. Most misses are rules about which rows belong: a cohort, an exclusion, a population. None came from a wrong value such as a stage name, because the metric SQL carries those. 46% of the remaining misses needed a definition nobody had ever written down, and only an owner can make that call.

The last stretch to 100% comes from a loop, not more documents. Read the trace of every miss, find the step where the agent guessed, and sort it into one of three kinds.

Three kinds of miss, and the smallest fix for each. Every miss falls into one of three kinds: a definition never written, one written but never served to the agent, or one served and ignored. Each has a different smallest fix.

Every miss falls into one of three kinds: a definition never written, one written but never served to the agent, or one served and ignored. Each has a different smallest fix. | Source: Context and Chaos

One fix can close several misses. Four of ours landed within 1% of the right answer, and all four trace to one missing rule that leaves out internal contacts. Write that rule once and four answers become right. Then rerun, and stop when the score stops moving.


What we learned

Two sets of lessons came out of this work: one on building the bench, one on building the agent.

On building the bench

  • Answers can leak into the context. Early on, the agent was partly looking up answers in SQL our team wrote for the answer keys. Removing it dropped one setup from 64.5% to 53.3%.
  • Freeze the warehouse. On live data the right answer changes every day, so every run queries the same read-only copy.
  • Grade the value, not the text. Code compares each answer with the sealed key: counts must match exactly, amounts within half a percent, and a fraction equals its percentage, so 0.67 and 67% are the same answer.
  • Best of many runs can say anything. 105 of 107 questions were answered right in at least one run, but the best single run got 90. We score one run, and treat gaps under about 7 points as noise: the same setup run twice moved by six questions.

The same lessons apply to any benchmark you read, ours included. Here are the eight questions we’d ask, answered for this one.

Eight questions to ask of any AI benchmark. Eight checks to run on any AI benchmark, each answered for this one.

Eight checks to run on any AI benchmark, each answered for this one. | Source: Context and Chaos

On building the agent

These are the seven rules from our playbook, starting with the one we would do first.

  1. Start with one domain. One domain is small enough to finish, and its open questions have someone who can settle them.
  2. Build the golden set before any context. Without sealed answers, you can’t tell a fix from luck.
  3. Fix the context before you change the model. Switching models moved our score far less than adding context.
  4. Write each business rule into a metric’s SQL. The past queries your analysts already ran carry the rules, and a sentence leaves the agent to translate them.
  5. Settle conflicts before the agent sees them: provenance first, then the owner. The definition most analysts ran recently, and that matches the warehouse, usually wins. A definition kept only in a spreadsheet leaves no query history, so whoever owns that number settles it. Never let the agent pick.
  6. Read the raw trace of every miss, and feed real usage back. The summary hides the step where the agent guessed, and context left alone goes stale within a quarter.
  7. Make the agent reliable on what happened before you ask it why. “What was pipeline last quarter?” needs metrics. “Why did it drop?” needs a model of how the business works on top of them, and it is only worth building once the numbers hold.

Every question, every setup

Averages hide which questions moved. Below, each column is one question and each row is one setup. Read it top to bottom: blue fills in as the context improves. The gray left in the bottom row is what we still miss.

All 107 answers, for each setup. Every answer from every setup, one column per question. Blue is right, dark gray is wrong, white is a refusal.

Every answer from every setup, one column per question. Blue is right, dark gray is wrong, white is a refusal. | Source: Context and Chaos


This piece is adapted from an essay I originally published on Frontier, where every figure is interactive: What we learned running an analytics agent bench 150+ times.


The Cats of Context & Chaos

Cartoon of an office. An excited orange cat in a pith helmet and explorer gear kneels by an open desk drawer and brushes dust off a sheet of SQL that reads SELECT customer_id FROM registrations WHERE attended = true, saying, I've unearthed the business rules. A grey professor cat in glasses and a tweed jacket replies, that's Dev's query from Tuesday. The caption reads, the business rules your AI needs are already in your team's SQL.

That's Dev's query from Tuesday. | Source: Context and Chaos




About Context & Chaos

Context & Chaos isn’t just a newsletter. It’s shared community space where practitioners, builders, and thinkers come together to share stories, lessons, and ideas about what truly matters in the world of data and AI: context engineering, governance, architecture, discovery, and the human side of doing meaningful work.

Our goal is simple, to create a space that cuts through the noise and celebrates the people behind the amazing things that are happening in the data & AI domain.

Whether you’re solving messy problems, experimenting with AI, or figuring out how to make data more human, Context & Chaos is your place to learn, reflect, and connect.


Got something on your mind? We’d love to hear from you.

Share this article