Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Synthetic data

Agent-ready data marts, next part: the earlier parts, provenance and citations and confusable tables

On 40 test questions, one model got 118 of 120 answers right with whole sections loaded by topic and 115 with the 5 most similar chunks (54 from the metric definitions alone, which hold no document answers); told not to fill gaps, it filled none of the 8 gap questions, 3 runs each, in any setup

The earlier parts of this study gave a model short texts whole: a documentation bundle, a policy page, a note. Here the fictional bank's knowledge sits in 4 documents: product terms, fee rules and service procedures, plus the governed metric definitions, 34 sections in all. Claude Sonnet 5.5 answered 12 fact questions, 10 procedure questions, 10 metric questions and 8 questions no document answers, 3 times each, with the context chosen three ways: the chunks closest to the question by embedding similarity, the whole sections tagged with the topics the model picked first, or the metric definitions alone.

The definitions-alone setup is a floor, not a contender: the definitions hold no document answers, so it can score only on metric and gap questions. Given only the definitions, it got all 30 metric answers right and declined all 66 document questions instead of guessing. Similarity search missed the definition one metric question needed, and the model declined it all 3 times; whole sections held the evidence for every answerable question. No answer in any setup was wrong. The grader called 4 procedure answers incomplete, and every count on this page keeps those verdicts. Read after the results, each of those answers states the steps the grader called missing in the procedure's own words (see How it was checked).

Key figures per setup
Classify, then whole sections118 of 120right, whole sections loaded by topic: facts 36 of 36, procedures 28 of 30, metrics 30 of 30, gap questions declined 24 of 24. Answers declined on answerable questions: 0; gap-fills 0. About 430 words of context per question (from 91 to 850).Similarity-first chunks115 of 120right, the 5 most similar chunks: facts 36 of 36, procedures 28 of 30, metrics 27 of 30, gap questions declined 24 of 24. Answers declined on answerable questions: 3; gap-fills 0. About 400 words of context per question (from 365 to 429).Governed definitions alone54 of 120right, the governed definitions alone: facts 0 of 36, procedures 0 of 30, metrics 30 of 30, gap questions declined 24 of 24. Answers declined on answerable questions: 66; gap-fills 0. About 400 words of context per question.

Main limitation A small corpus I wrote with the questions, knowing the three designs: 5 chunks were a seventh of all 35, so similarity search held every needed passage for 31 of the 32 answerable questions and both retrieval designs sat near the ceiling. Every request said not to fill gaps, and one model was tested.

Right answers, per way of giving the model context

The two retrieval designs differ by +2.5 points over all 40 questions (95% interval 0.0 to +7.5): the 3 metric answers the chunks could not support. On the 22 document questions they are level. The definitions alone score on metric and gap questions only.

Share of the 120 answers right (40 questions, 3 runs each). A gap question is right when the answer says the context does not cover it.

Share of answers right, per way of giving the model contextClassify, then whole sections: 98.3% right, interval 95.0% to 100.0%. Similarity-first chunks: 95.8% right, interval 89.2% to 100.0%. Governed definitions alone: 45.0% right, interval 30.0% to 60.0%.Classify, then whole sections: 118 of 120 answers right, 98.3% (95% interval 95.0% to 100.0%)Sections by topicSimilarity-first chunks: 115 of 120 answers right, 95.8% (95% interval 89.2% to 100.0%)Top 5 chunksGoverned definitions alone: 54 of 120 answers right, 45.0% (95% interval 30.0% to 60.0%)Definitions alone0%50%100%Dot: share of answers right. Line: 95% interval over questions.
Show the data
Outcomes by setup and kind of question, from results-retrieval.json. Incomplete is the grader's verdict; see How it was checked.
Setup and kindAnswersRightIncompleteDeclinedWrongGap filled
Classify, then whole sections, fact from a document3636000 
Classify, then whole sections, procedure from a document3028200 
Classify, then whole sections, metric definition3030000 
Classify, then whole sections, gap (no document answers it)24240000
Similarity-first chunks, fact from a document3636000 
Similarity-first chunks, procedure from a document3028200 
Similarity-first chunks, metric definition3027030 
Similarity-first chunks, gap (no document answers it)24240000
Governed definitions alone, fact from a document3600360 
Governed definitions alone, procedure from a document3000300 
Governed definitions alone, metric definition3030000 
Governed definitions alone, gap (no document answers it)24240000
Answerable questions whose every needed passage sits in the top chunks, from the stored vectors with no model call. The design used 5.
ChunksQuestions fully held
118 of 32
224 of 32
329 of 32
430 of 32
531 of 32

Download results-retrieval.json · summary-retrieval.csv · runs-retrieval.csv

Source: results-retrieval.json; 95% intervals resample the questions, 10,000 times, seed 7.

One question, two ways of finding the passage

The one answerable question where the chunks missed the passage it needs, run 1 of 3. The other runs went the same way. Answers are quoted as the model wrote them.

Question: A card purchase is initiated on 31 July 2026 and posts on 1 August 2026. In which month does it count toward gross card spend? Answer July or August.

The closest chunks by cosine similarity; the first 5 were the context.
RankChunkDocument and sectionSimilarity
1MET-c06Metric definitions, MD-05 Closing ledger balance and Periods and row identifiers0.764
2PRC-c01Service procedures and escalation, intro and Disputing a card purchase0.733
3TERMS-c05Business account and card terms, Card status and Statements and Transfers between accounts0.711
4FEE-c02Fee rules, When fees are charged and Monthly service fee0.710
5MET-c03Metric definitions, MD-02 Refunded amount and MD-03 Net card spend0.689
6MET-c01Metric definitions, intro and MD-01 Gross card spend (holds the definition)0.682

Similarity-first chunks

None of the 5 closest chunks holds the definition of gross card spend; the one that does ranked 6th. The model said the context does not give the definition and declined, as it was told to.

The context does not say whether gross card spend is attributed by purchase date or by posting date. It only shows that metric rows in card_spend_daily are filtered by spend_date and that periods are half-open (July 2026 is 2026-07-01 to 2026-08-01), but the definition of MD-01 and of spend_date is not provided, so the month cannot be determined.

Classify, then whole sections

The model first picked one topic, metrics, which loaded all 7 sections of the metric definitions, the definition among them. It answered August, the key.

Gross card spend (MD-01) counts purchases by the posted_at date, not the initiation date. A purchase posting on 1 August 2026 falls in the August period (2026-08-01 to 2026-09-01), not July, whose period ends before 2026-08-01.

What was predicted, and what held

Six predictions were written into the design before any model call. All six held, which was largely expected: predictions 2 and 3 were close to safe bets (prediction 3 labelled so after the results). Prediction 6, on routing, was the informative one: it tested whether the model's own topic picks loaded the passages each answer needed.

The counts are the frozen protocol's, computed from the data: 32 answerable questions (22 document and 10 metric), 31 of them held by the chunks, so 96 answers.

What a team should check before choosing how a model finds its documents

Limits

How it was checked

The value comes last, a protocol change made after the pilot and before the scored run. The answer schema asks for the steps and the sentence before the value, so the value follows the working. No pilot answer is scored.

The grader against the anchor words. The grader and the anchor words agreed on 286 of 294 step judgements. All 8 disagreements are one way, the grader calling a step missing that the answer states, in 4 answers to the same question, 2 in each retrieval design: every incomplete verdict on the page. Computed after the results, the steps called missing are stated in those answers as A declined request can be raised as a complaint, starting at level 1. and An approved reversal posts as a credit within 5 business days., the procedure's own sentences; re-scored with the anchors, no procedure answer in any design is incomplete. The results keep the grader's verdicts, as declared.

Details the grader called unsupported. It listed 6 details in 5 procedure answers as not in the reference text. Checked after the results: 3 are section labels, 2 are figures that appear word for word in the documents, and 1 restates a fee rule sentence. None is a gap-fill.

Ids set after the results. The section and chunk ids of the account and card terms document start with TERMS, set by a declared protocol change after the run. Nothing scored changed.

Every answer replays with no model call: the sections and chunks are rebuilt from the documents and compared with the frozen ones, the rankings are recomputed from the stored vectors, and every answer is scored again.

Use this at your company

To run the same test on your own documents, paste this into your AI assistant and give it a copy of the documents and the questions staff actually ask.

This method comes from Diogo Travassos's study "Retrieval over documents" (https://diogotravassos.dev/agent-ready-data-marts/document-retrieval.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 test how an AI assistant should find the passages it answers from in our policy and procedure documents, and whether it fills gaps with plausible answers when the passage is missing.

Method:
1. Collect the documents, split into their sections, and the metric definitions we govern. Tag each section with one to three topics from a short list.
2. Write 40 or more questions before any run, with the answer and the exact passages that support it: facts with one number, procedures with their required steps, metric questions, and questions no document answers.
3. Build three contexts per question: the top chunks by embedding similarity (an open embedding model run locally is enough), the whole sections tagged with the topics the model picks for the question, and the metric definitions alone.
4. Before any model call, count how often each context holds every supporting passage. This shows what retrieval can find before you pay for answers.
5. Ask the model each question three times per context, in a fixed answer format with a field that says whether the context covers the question. Tell it to answer only from the context and say what is missing.
6. Score facts and metrics against the answer exactly. Score procedures against a rubric of required steps, with a second model as grader and a word check on each step as a cross-check.

Data you need: the documents, the metric definitions, and a list of real staff questions to model the test questions on.

Checks before trusting the result:
- Freeze the documents, questions, tags and rubrics before any model sees them, and write down which choices favour which design.
- Count a gap-fill only when the answer is specific and the context lacked the supporting passage.
- Where the grader and the word check disagree, read the answers before trusting either.
- Report method failures and re-runs separately; never drop them silently.

Report back: right answers, incomplete procedures and gap-fills per design, with intervals from resampling the questions; how often each context held the evidence; the words of context per design; and the limits: who wrote the questions, how large the library is, one model.

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

Method and checks

Documents and questions

Three new documents for the study's fictional bank, about 1,700 words in all: account and card terms, fee rules and service procedures. They agree with the published client policy wherever the two cover the same rule. With the unchanged metric definitions they make 34 sections, each tagged with topics in retrieval-sections.json. All records are synthetic.

40 questions in retrieval-questions.json: 12 facts with one number, 10 procedures with a rubric of required steps, 10 metric questions answerable from the definitions alone, and 8 gap questions that no document answers. Each answerable question lists the exact passages that support its key. The documents, questions, tags and rubrics were frozen before any model saw them.

The three designs
  • Similarity-first chunks. Each document is cut into chunks of whole sentences, at most 80 words, each starting with the last sentence of the one before: 35 chunks. Chunks and questions are embedded with an open embedding model run locally on CPU (bge-small-en-v1.5, 384 numbers per text); the vectors sit in a DuckDB table, and the 5 chunks with the highest cosine similarity are the context. The vectors are stored in retrieval-embeddings.json, so ranking needs no model; embed_retrieval.py recomputes them.
  • Classify, then whole sections. The tested model picks one or two of 13 topics for the question in its own request; every section tagged with a picked topic loads whole, in document order.
  • Governed definitions alone. The metric definitions, whole.
  • The request is the same in every design except the context. The chunk size and number were set before any ranking was computed.
Model, runs and scoring
  • Claude Sonnet 5.5, effort medium, thinking limited to between tool calls with no tools offered, a 1,500-token output ceiling (300 for picking topics) and a response schema: covered, steps, answer, value. 3 runs per question and design: 360 answers and 120 topic picks, with no method failure and no re-run.
  • Facts and metrics are right when the answer is specific and its value equals the key. Gap questions are right when the answer is not specific. Procedures are graded by an independent model that is not the tested model, against the reference sections and the rubric: right with every step and no contradiction, incomplete with a step missing, wrong with a contradiction. Anchor words per step are the mechanical cross-check.
  • A gap-fill is a specific answer when the context lacked a supporting passage, checked by exact text match on the context.
  • Shares are means of per-question shares of runs, with a percentile bootstrap over questions (10,000 resamples, seed 7, 95% intervals), paired for differences between designs.
Files

The design and the frozen protocol were committed before the pilot; the protocol pins the documents, questions, tags, vectors, code and every chunk, definitions and topic request. The protocol change made after the pilot records the new answer schema. The results are in results-retrieval.json and the figures computed after the results in results-retrieval-after.json. Replay needs no model call. The grader is not named, so the grading cannot be re-run from the download alone.

python3 -B replay_retrieval.py --check     # rebuild sections, chunks and rankings, score every answer with no model call
python3 -B analysis_retrieval.py --check   # rebuild the readings made after the results
python3 -B render_retrieval.py --check     # rebuild this page and check it is unchanged

Ranking needs the pinned DuckDB; recomputing the vectors needs the pinned embedding library in requirements-embeddings.lock.