Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Synthetic data

Agent-ready data marts, next part: the earlier parts, confusable tables and document retrieval

In a one-run pilot, four models given only table and column names got 95% to 100% of scored answers right on 40 new questions written to say how to count, so documentation had no room to help

The earlier parts found that written documentation lifted accuracy on the study's own questions, but no test measured what any single part of it adds. A paper on grounding information for SQL generation, GRIPS, reports that "adding more pre-SQL information does not consistently help". This part takes that as its prompt and does not reproduce the paper. It planned six setups on 40 new questions from an independent author who never saw the documentation: the bare schema (the table and column names with their types, and no documentation), each of the four parts of the documentation alone (sources and relationships, metric definitions, marts and safe joins, allowed values) and all four together. A pilot of the bare schema came first, under a stop rule written before it: if the bare schema is right 90% of the time or more for three of the four models, stop, because near the top there is no room to show that a part helps.

All four models cleared that bar, so the round stopped as declared and the documentation setups never ran. The author's own queries, written without the documentation, return the answer key on all 40 questions, and the questions say how to count, as the author's rules required: one asks for transactions "regardless of their status or whether they were posted". On the study's earlier questions, which were written alongside the documentation, the same bare-schema request left Claude Sonnet 5.5 wrong on 4 of 36 answerable questions in each of its three runs, and the full documentation took it to 36 of 36.

Key figures per model
Claude Sonnet 5.5, bare schema, one run100%40 of 40 answers right. Without the 6 questions whose answer is no rows, 34 of 34.Claude Haiku 5.5, bare schema, one run100%31 of 31 answers right; 9 more hit the answer-length limit of 800 tokens on both tries, and are left out. Asked again after the pilot with a 4,000-token limit, 9 of 9 were right. Without the 6 questions whose answer is no rows, 26 of 26.GPT-6 Luna, bare schema, one run95%38 of 40 answers right: one query the validator refused and one wrong answer. Without the 6 questions whose answer is no rows, 32 of 34.Gemini 3.8 Flash, bare schema, one run100%40 of 40 answers right. Without the 6 questions whose answer is no rows, 34 of 34.

Main limitation The questions were written from the table and column names and a short description of the ledger, under rules that each one name its period and currency, never add CAD and USD, and have one correct answer from its own words. The documentation's opening paragraph says the same about periods and currencies, and the description and those rules were written knowing the documentation, so the ceiling is partly built in: it is not evidence that the documentation adds nothing. Questions from people who know the business but not the tables may leave room. One run per question, one synthetic warehouse.

The bare schema on the new questions, by model

Every model is at or above the bar, so the stop rule fired. It would fire even with Claude Haiku 5.5's 9 left-out answers counted as wrong (77.5%), because the other three are at 95% or more. Near the top the models cannot be ranked, so this chart ranks nothing.

Share of answers right, the bare schema, 40 questions, one run each.

Share of answers right with the bare schema on the new questions, per model, beside the stop rule's barClaude Sonnet 5.5: 100%. Claude Haiku 5.5: 100%, 77.5% with left-out answers counted as wrong. GPT-6 Luna: 95%. Gemini 3.8 Flash: 100%.Claude Sonnet 5.5: 100% of answers right (40 of 40)Claude Sonnet 5.5Claude Haiku 5.5: 100% of answers right (31 of 31); 77.5% with the 9 left-out answers counted as wrongClaude Haiku 5.5GPT-6 Luna: 95% of answers right (38 of 40)GPT-6 LunaGemini 3.8 Flash: 100% of answers right (40 of 40)Gemini 3.8 Flash0%50%90%100%Dashed line: the stop rule's bar.Hollow ring: left-out answers counted as wrong.
Show the data
The pilot, per model, from results-parts.json: answers by verdict, declared re-runs, the share right of answers that reached the scorer, and the count without the 6 questions whose answer is no rows.
ModelQuestionsRightWrong answerQuery refusedLeft outRe-runsShare rightWithout empty answers
Claude Sonnet 5.540400000100%34 of 34
Claude Haiku 5.5403100910100%26 of 26
GPT-6 Luna4038110095%32 of 34
Gemini 3.8 Flash40400000100%34 of 34

Download results-parts.json · the questions and keys

Source: results-parts.json.

What was predicted, and what held

Four predictions were written into the design before any run. (1) The bare schema is high on these questions, at least 85% for both hosted models, because the author wrote them from column names: it held under the declared scoring, which leaves cut-off answers out, with Claude Sonnet 5.5 at 100% and Claude Haiku 5.5 at 100% of the 31 answers that reached the scorer. With its 9 cut-off answers counted as wrong, Claude Haiku 5.5 is at 77.5%, under the bar; asked again after the pilot with a larger answer-length limit, all 9 were right. Those 9 include the only two questions GPT-6 Luna missed, so the 31 scored are not a random sample of the set. (2) No single part beats the bare schema by an interval clear of zero for the two hosted models, (3) all four parts together are not clearly ahead of the best single part, and (4) if any part helps it is the allowed values or the metric definitions: none of these three was tested, because the stop rule ended the round before the documentation setups. They stay open for a harder question set.

For scale, what each setup would have added to the bare request, in words of context counted by whitespace (the bare request itself is 348 words):

Words each planned setup adds to the bare request, including the documentation's opening paragraph for every documented setup.
SetupWords added
Sources and relationships419
Metric definitions267
Marts and safe joins308
Allowed values118
All four parts956

The one wrong answer

Chosen by a rule: the first wrong answer in question order. It was the only one in the pilot. The other miss was a query the validator refused, and the answers cut off at the answer-length limit never reached the scorer. The query is shown as the model wrote it.

Question: Which organizations had more than 100000 whole CAD cents of net card spending during July 2026, spread across at least two accounts that each recorded a CAD purchase? Return organization identifier, number of accounts with purchases and net spending in whole CAD cents, in that order. Include all July CAD net spending linked to the organization; sort by net spending descending, then organization identifier ascending.

The answer

GPT-6 Luna, bare schema

The model kept only the days on which a card made a purchase, so the days that had only refunds dropped out of the net figure, although the question says to "Include all July CAD net spending linked to the organization". Every organization's figure comes out too high, by exactly the net spending of its days without a purchase (checked by a query after the results; for org_03, 15,721 cents). It returned org_03, 2, 269,590; org_04, 2, 259,427; org_05, 2, 256,624; org_01, 2, 245,277; org_02, 2, 211,447.

WITH account_spend AS (SELECT a.organization_id, s.account_id, SUM(s.net_spend_minor) AS net_spending_minor FROM card_spend_daily s JOIN accounts a ON a.account_id = s.account_id WHERE s.currency = 'CAD' AND s.spend_date >= DATE '2026-07-01' AND s.spend_date < DATE '2026-08-01' AND s.purchase_count > 0 GROUP BY a.organization_id, s.account_id) SELECT organization_id, COUNT(*) AS accounts_with_purchases, SUM(net_spending_minor) AS net_spending_cents FROM account_spend GROUP BY organization_id HAVING COUNT(*) >= 2 AND SUM(net_spending_minor) > 100000 ORDER BY net_spending_cents DESC, organization_id ASC

The answer key

Written from the question's text before any run

The key counts every day and returns org_03, 2, 253,869; org_04, 2, 250,691; org_05, 2, 243,071; org_01, 2, 230,735; org_02, 2, 203,006.

SELECT a.organization_id, COUNT(DISTINCT CASE WHEN s.purchase_count>0 THEN s.account_id END), SUM(s.net_spend_minor) AS n FROM card_spend_daily s JOIN accounts a ON a.account_id=s.account_id WHERE s.currency='CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' GROUP BY a.organization_id HAVING SUM(s.net_spend_minor)>100000 AND COUNT(DISTINCT CASE WHEN s.purchase_count>0 THEN s.account_id END)>=2 ORDER BY n DESC, a.organization_id

The rule it broke is written in the question itself.

What a team should do before testing its documentation

Limits

How it was checked

Decided after the pilot: its answers are scored and published as the round's results. The design kept pilot answers outside the score. The share right is the stop rule's own figure, declared before the pilot.

Claude Haiku 5.5 hit its answer-length limit on 10 questions. Each was re-run once, as declared; one answered, and 9 hit it again and are left out of its share and counted. Decided after the pilot and kept out of the stop rule: those 9 asked once more with a 4,000-token limit, and 9 of 9 were right. No hosted call returned an error.

The stop rule does not depend on how the left-out answers are counted: with them counted as wrong, the other three models still clear the bar.

Every answer replays with no model call: the warehouse is rebuilt from its files, every answer key query is run again and compared with the key stored beside the question, and every answer is scored again. The author's own queries are scored the same way, as a check made after the pilot; they return every key, as they did when the questions were frozen.

Use this at your company

To run the same test on your own warehouse, paste this into your AI assistant and give it read-only access to a copy of the tables and your data documentation.

This method comes from Diogo Travassos's study "Documentation parts" (https://diogotravassos.dev/agent-ready-data-marts/documentation-parts.html). If you can open links, read it first: it works the method through end to end, with its checks. The steps below stand on their own if you can't.

Help me find which parts of our data documentation help an AI model write correct SQL over our warehouse, and stop early if our questions leave no room to tell.

Method:
1. Split the documentation into its parts: for example where the data comes from and how tables relate, the metric definitions, which tables and joins are safe, and the allowed values of the coded columns.
2. Collect 30 to 40 questions from the people who ask them, without showing them the tables. Write the correct SQL for each from the question and the definitions, and confirm each answer before any model run.
3. Pilot first: ask each model every question once with the table and column names only. Before the pilot, write down a stop rule: if most models are right 90% of the time or more, stop, because the test has no room.
4. If the pilot leaves room, ask each question three times per model in each setup: names only, each part alone, and all parts together. Run every answer read-only and compare it with the known answer exactly.

Data you need: read-only access to a copy of the warehouse, the documentation, and questions written by people who did not see the tables.

Checks before trusting the result:
- Write the questions, the answers, the setups and the stop rule down before any run.
- Keep provider errors, timeouts and answers cut off at the output limit out of the shares, re-run each once, and report how many there were.
- Report each model on its own; never average models together.
- Compare all parts together with the best single part, choosing the best part again in every resample, so the choice is in the interval.

Report back: the pilot's share right per model and whether the stop rule fired; if it did not, each part's gain over names only and all parts against the best single part, with intervals from resampling the questions; the words each part adds; and the limits: who wrote the questions, how many runs, one warehouse.

In your report, say which study you followed and link it: https://diogotravassos.dev/agent-ready-data-marts/documentation-parts.html

Method and checks

Data and the questions

The same fully synthetic banking ledger as the earlier parts: 19 accounts, 34 cards and 625 transaction events in July 2026, plus the two marts. No customer or employer record is used.

An independent author who never saw the documentation, the allowed values, the study's pages or the earlier questions wrote 44 questions from the table schema and a plain description of the ledger, with no data rows, and wrote down a reading and a query for each. The author worked under rules that each question name its period and, for money, its currency, never add CAD and USD, have exactly one correct table of results once its words are understood, and state its columns and row order; the description and the rules were written knowing the documentation. The answer key for each question was written from its text alone under the documented definitions, before the author's query was read. 10 keys came back empty; the last 4 of those in the author's order were dropped before any model saw the set, and the other 6 stay, flagged. Answers are integers, with money in whole cents, or text labels. The questions, keys and the author's notes.

The six planned setups

The design calls them arms. The base is the published bare-schema request, unchanged: the rules, the allowed functions and the table listing with names and types. Each documented setup adds one system message: the documentation's opening paragraph (time zone, snapshot date, minor units, currencies kept apart) plus one part; the allowed-values setup adds the value lists under their published header; the last setup adds the whole documentation and the value lists. Only the bare setup ran. The parts come from the documentation and the value lists.

Models, prompts and runs
  • Claude Sonnet 5.5 and Claude Haiku 5.5 with the settings of the study's published current-model runs: an 800-token output ceiling, effort medium and a response schema that allows exactly the two answer shapes the prompt asks for. Sonnet runs with thinking limited to between tool calls and no tools offered; Haiku with its default thinking.
  • GPT-6 Luna through a command-line agent, reasoning effort medium, in an empty read-only folder; Gemini 3.8 Flash through its command-line tool in print mode. The system text and the question go in one message, and the final message is scored as it stands.
  • The pilot: the bare setup, all 40 questions, one run per model. The design planned 3 runs per question and setup on the two hosted models after it; the stop rule ended the round first. What was decided after the pilot is listed under How it was checked.
Scoring
  • The published rubric: the answer's SQL is validated and run in the published sandbox, and its rows must equal the answer key exactly, with no tolerance, so money must match to the cent. The validator is the published one, with EXISTS allowed.
  • Share: answers right over answers that reached the scorer. A provider error, a command-line failure, no final message, or an answer stopped at the output ceiling with no complete answer is a method failure, re-run once and left out if it fails again. An answer that is not valid or that the validator refuses is the model's and counts as wrong.
  • The stop rule, frozen before the pilot: the bare setup at 90% or more for 3 of the four models. The design's intervals compare setups, so none was computed for a round that ran one setup.
Files

The design and the frozen protocol were committed before any model run, with the questions; the protocol pins the questions, the documentation, the data, the code that builds and scores the requests and the design itself. The results are in results-parts.json. Replay needs no model call, but the question writing cannot be re-run from the download alone, and the replay checks the design file, which is not in the download, so it runs in the full project.

python3 -B replay_parts.py --check    # rebuild the database, score every answer with no model call, compare the results (full project)
python3 -B render_parts.py --check    # rebuild this page and check it is unchanged

The replay needs the same prerequisites as the earlier parts (Linux namespaces, bubblewrap and the pinned DuckDB and sqlglot).