22 min read

RAG, Agentic RAG or a Better Model? We Tested All Three on 7,000+ Pages of Technical Docs

We tested better chunking with Docling, agentic RAG on Elasticsearch and stronger models on 7,000+ pages of technical documentation, with blind, fact-checked reviews. Here is what actually improved the answers.

We almost shipped a “better” AI assistant. This is the test that stopped us.

At Line Media, we build and run an AI assistant inside a partner portal for a data-protection software company. Partners use it to ask technical questions about the products: how to configure something, why a disk does not show up, which document explains a feature. The assistant answers from the company’s knowledge base, around 180 PDFs and more than 7,000 pages of user guides, release notes, datasheets, slide decks and reference guides.

The answers were decent, but we kept seeing the same failure: the right document was in the index, and the answer still came out thin or slightly wrong. We were sure the problem was how the documents were converted and split into passages. So we spent two weeks rebuilding all of it: a new conversion with Docling, new chunking, a new Elasticsearch index, agentic search, smarter thinking settings.

Our early tests said we had won, by a lot. Then we ran a stricter test, and most of the win disappeared. This post walks through everything we built, how it works, what we measured, and the test that stopped us from shipping a slower assistant that was not actually better.

The setup: a RAG assistant on Elasticsearch and Gemini

The assistant is a tool-calling agent loop. The model decides what to do in each step: search the knowledge base, search the web, look up a record in the CRM, or write the answer.

  • Model: Gemini 3.8 Flash, with thinking set to LOW.
  • Time budget: 25 seconds of research per answer. After that, the assistant must write with what it has.
  • Tools: about 19 of them. Knowledge-base search is one; others reach the CRM, support cases, renewals and the web.
  • Search: Elasticsearch 8.19 on Elastic Cloud, hybrid retrieval. Every passage can be found three ways: ELSER v2, Elastic’s own model that matches by meaning through weighted keywords (sparse vectors); Jina v5 nano, which turns text into 768 numbers so that similar meanings land close together (dense vectors); and plain BM25 keyword matching. Elasticsearch puts the three scores on the same scale and adds them up (a linear retriever). Each document stores its passages inside it, and a document scores by its single best passage.
  • Output: the search tool returns the best 3 documents, each with its best passages.

In production, a knowledge-base search takes about 1.4 seconds and a typical answer about 14 seconds. 90% of answers finish under 28 seconds.

What was wrong with the old document conversion

The old conversion job had grown as a chain of workarounds. Each step fixed something the step before it broke:

Word fileto PDF Doclingfast tables HTML outheadings lost Re-guessheadings Markdownto PDF again Elastic readsthe PDF text Cut intobig passages Result: passages of 4,000 to 7,400 characters, no page numbers, contents pages indexed, tables squashed onto one line, bullets turned into "?", code blocks without line breaks, and headings right only 50% to 81% of the time. The search model reads 512 tokens per passage. In one user guide, 68% of the text sat past that point.
The old pipeline converted the same content four times. Every step lost something.

We measured the damage on the live index before changing anything:

ProblemWhat we measured
Heading levelsRight only 50% (reference guides) to 81% (user guides) of the time. One guide had 0 of 22 chapter titles right.
False headingsAbout 190 labels like “Description:” and “Note:” became headings in one guide. In reference guides, author names became headings.
BulletsThe font the job used was missing in its container, so bullets came out as ”?”: 192 times in one guide, 1,309 in the API guide.
TablesSquashed onto one line. The fast table mode lost values in 3 datasheet rows.
StructureNo page numbers. Contents pages indexed as passages. Every document started with a passage holding only its id.
Passage size4,000 to 7,400 characters. ELSER reads only the first 512 tokens of each passage.

The big passages were a choice we made early, on purpose. One large passage keeps a section together, so when search finds it, the model gets the whole context in one piece: the procedure with its steps, the table with its header, the explanation around a setting. Fewer, bigger passages also meant more text per search result. For a model that searches once and answers, that was a sensible trade.

The last row is where it bit us. ELSER, the semantic search model, reads only the first 512 tokens of a passage. If it sees only the first third, two thirds of the knowledge base can be found only by exact keywords.

Rebuilding the conversion with Docling 2.145

Docling is an open-source document converter. It runs layout analysis on each PDF page, finds text blocks, headings, tables, pictures and code areas, works out the reading order, and returns a structured document you can walk through in code. Most of what the old job did by hand, current Docling does natively. So we rebuilt on Docling 2.145, pinned to that exact version, and tested every decision on real documents before keeping it.

PDF pagetext layer Layout model: blocks TableFormer: tables Picture classifier OCR (only if needed) Reading order+ heading levels Doclingdocument(JSON) Chunkerpassages
Docling's models each handle one job per page. The result is one structured document; our own rules run on that document before and during chunking.

The useful part is the structured document in the middle. It knows which block is a heading, which is a table cell, which is a picture, and where each sits on which page. That is what lets you write rules based on structure and position instead of guessing from text.

Tables: TableFormer v1 in accurate mode

Docling reads table structure with a model called TableFormer. We compared modes on 29 table pages:

  • v2 was about twice as fast, but it merged columns, cut text off, split one row into 39 pieces and missed header rows.
  • v1 in ACCURATE mode recovered all 41 rows of a network ports table, with its header rows.

We took v1 ACCURATE. Speed matters less in a job that runs once per document.

Headings: bookmarks first, then a cheap AI check

Headings matter more than anything else here, because every passage gets a heading path (“Chapter > Section > Subsection”) and that path is often what a search hits. Docling 2.145 has a heading hierarchy step that uses the PDF’s bookmarks, then numbering, then font style. With it on, 91% to 100% of headings landed at the right level, against 50% to 81% before.

False headings were the harder part. Docling still sees “Where:”, “OR”, a copyright line or a bold sentence as a heading now and then. We tried word lists and patterns first, and they missed too much across different documents. What worked:

  1. A heading that matches a PDF bookmark is kept automatically, but only when the document has a real bookmark tree (two or more levels). Slide decks with flat bookmark lists do not count.
  2. Every other heading goes to one AI call per document (Gemini Flash). It sees the full heading list with the first line under each heading, and answers keep or drop for each one. It only answers yes or no; it never rewrites text. A dropped heading becomes normal text, so nothing is lost.

That check costs about $0.10 to $0.30 per 1,000 pages and runs only when a document is added. On a 20-page stretch of one guide, it dropped exactly the 4 junk headings and kept the real small sections.

Pictures: describe only what carries information

The old job sent every picture to a vision model (Llama 4 Maverick on watsonx) for a description. That included logos, icons and help buttons. Docling ships a picture classifier that runs locally at no cost per image. We skip a picture only when the classifier calls it a logo, icon, barcode, signature or similar, is at least 80% sure, and the picture covers under 15% of the page. Anything under 1% of the page is skipped whatever its label.

On a test set of 107 pictures, the old job would have described 101. The new rules describe about 36, and diagrams built out of icons are still kept and described as diagrams. The 80% bar exists because the classifier called a photo of a server appliance a “logo” with 47% confidence.

Descriptions go into the passage text with a clear marker, [Picture description: ...], so the answering model knows it is reading a description and not the document’s own words.

OCR only where the text layer is broken

OCR on every page added no text on screenshot pages and made conversion about 3.5 times slower. So every document is converted with OCR off first. If Docling flags a page as having a broken text layer, or the output contains the ”�” character, that document is converted again with OCR on and Docling’s text-layer repair. One marketing PDF had never been indexed because of a broken text layer; the repair fixed all 15 broken characters.

Code blocks: keep the line breaks

The product has a REST API guide with hundreds of code samples. Docling finds code areas well, but its text kept line breaks in only 11 of 41 test blocks. Docling also has code-reading models; on our laptop they ran 69 minutes without finishing 30 blocks, and they retype code from an image, which can change a character. We rejected them.

What worked: rebuild each code block from the exact text lines Docling already assigned to it, keep its line breaks and indentation, and join blocks that continue on the next page. Same characters as Docling in 41 of 41 blocks, correct line breaks in 41 of 41. If the rebuilt text ever differs from Docling’s own characters, the job keeps Docling’s text.

91-100%headings at the right level (was 50-81%)
101 → 36pictures sent for paid descriptions
41 / 41code blocks with correct line breaks (was 11)
0contents pages in the index

How we chunk documents now

Converting well is half the job. The other half is cutting the document into passages that search can find and a model can read.

Tables become one line per row. In the old output, 46% of all tokens on one set of pages were table divider dashes (one divider line cost 371 tokens), and a wide table got split by columns, so a description lost its port number. Now each row is written as Column: value | Column: value, and a big table is split only between rows. Every row carries its own column names, so a single row still makes sense on its own. An illustrative example (made-up values, same shape as the real thing):

Before (one passage, cut mid-table, header far above):
| 443 | TCP | Inbound | Web portal | ... |
|-----|-----|---------|------------|-----|

After (one passage, starts with its heading path):
Installation > Network requirements > Port usage:
Port: 443 | Protocol: TCP | Direction: Inbound | Used by: Web portal
Port: 22 | Protocol: TCP | Direction: Inbound | Used by: Remote support

A section that fits in 512 tokens becomes one passage. A bigger section is split at its own sub-headings, and neighbouring pieces are joined again only when both are whole sections and still fit. In the API guide, 75 tiny passages (43 of them under 100 tokens, like “PARAMETERS: None”) became 27, and almost every API call is now exactly one passage with its description, parameters, response and sample.

No overlap between passages, with one exception. We measured 439 passages and no paragraph was ever cut in the middle. Cuts happened only inside big tables, and table rows carry their column names anyway. So overlap is added only when one text block truly had to be split.

Every passage starts with its heading path, for example Analytics > Alerts > Alert descriptions:. That gives search a short, dense summary of where the passage sits.

Each document also gets fields of its own: title, document type, version, products and a short summary, from one AI call that reads the document’s first pages.

Contents pages are removed before chunking, and tables or code that run across a page break are joined first. Docling’s built-in chunker (HybridChunker) does the cutting; we changed it slightly so it counts tokens on exactly the text we store.

Running the conversion as an IBM Cloud Code Engine job

The conversion runs as a batch job on IBM Cloud Code Engine. Each job run handles one document:

Original PDFAmazon S3 Code Engine jobDocling 2.145one run per document Passages JSON+ full Docling documentObject Storage ElasticsearchELSER + Jina vectors A re-index tool drives it: copy the original, start the job, wait, load the passages, check the result, and keep a progress file so a run can stop and continue.
One job run per document keeps memory use predictable and makes a single failure easy to retry.

A few things that helped:

  • The image is built from a Dockerfile with Code Engine’s own build service, using the large build size, since Docling’s models make the image heavy.
  • The job saves two outputs: our passages JSON, and the full Docling document as JSON (pictures removed). The second one means we can re-chunk later without converting again.
  • Elasticsearch only adds vectors. The index pipeline runs ELSER and Jina on passages that are already cut. All structure decisions happen in the job.
  • A new index next to the old one. Production kept reading the old index the whole time.

The load, and one crash

We loaded 176 of the 177 documents. The new index has many more, smaller passages:

Old indexNew index
Documents174176
Passages7,83927,601
Size220 MB447 MB
Document fieldsfile name onlytitle, type, version, products, summary
Passage fieldstexttext, heading path, section, position, pages

The 177th document was a manual with 1,982 passages. Our loader wrote each document as one request, and this one ran the 1 GB Elasticsearch data node out of memory. It took the production cluster down twice before we understood why. The fix is either a bigger node or loading huge documents in parts. We skipped that one manual for the test. If you run hybrid search on a small Elastic Cloud deployment, watch the size of single write requests, and watch the memory that dense vectors add.

How much text the AI gets per document

Smaller passages fix search, but they create a new problem: a 512-token passage is often too little for the model to answer from. If a procedure has six steps across three passages and search finds step four, the model needs the rest.

So the search tool now builds each document’s text with a few rules, up to 12,000 characters per document:

  1. Document header first: title, type, version, products and summary.
  2. Small documents go whole (up to 12,000 characters and 30 passages).
  3. Otherwise, in search order: the whole section of each found passage, nearest passages first, then its neighbours. Gaps are marked with [...], and each part starts with its heading path and page numbers.

This mattered on “list everything” questions. On one question that needed a full 42-row table, the old index returned scattered rows. The new rules returned the whole 6-passage section.

In an early throwaway test on a few documents, the text sent to the model per question dropped from about 57,900 characters to 13,700, and the passage holding the answer ranked first in 16 of 16 questions instead of 12. That looked very promising.

The first answer test: a tie

Retrieval tests only tell you what reached the model. What matters is the answer. So we ran the real assistant, with its real prompt and tools, on 30 real partner questions, once on the old index and once on the new one. Blind reviewers ranked the two answers to each question against the evidence each one saw.

TestOld indexNew index
Passage with the answer reached the model (46 questions)3635
Right document in the top 33836
Blind answer ranking (30 questions)15 wins11 wins, 4 ties

A tie, slightly in the old index’s favour. We looked at why. The old passages were huge, but that also meant they already contained the answer most of the time. Better structure did not change what the model wrote, because the model already had the text it needed.

That should have been the moment to stop and ask whether the index was the bottleneck at all. Instead we went one level up.

Agentic search: letting the model look around

If cleaner passages alone do not help, maybe the model needs to use them better. The new index has structure the old one lacks: sections, positions, titles. So we gave the agent more ways to move through it:

  • also_try on the search tool: up to two more phrasings of the same search, run in parallel and merged.
  • find_documents: list documents on a topic by title, type and summary, without their text.
  • search_document: search inside one document.
  • read_passages: read a document in order from a passage number, for example to finish a table cut off by [...].

The instructions for these tools live only in the tool descriptions, never in the assistant’s main prompt. We gave the agent 40 seconds instead of 25.

We also tested an outside suggestion: a fixed research routine that always searched, then looked up sections, then followed up. It added time and no quality.

Version (30 questions, blind 4-way ranking)Average place (1 = best)Typical time
Agent with document tools, new index2.2025 s
New index, today’s search2.5322 s
Fixed research routine2.5740 s
Today’s assistant, old index2.7020 s

The agent beat today’s assistant 18-10. Most of the gain came from the extra phrasings: 35 of 44 searches used also_try, and the other tools were rarely called.

Thinking levels: LOW for speed, MEDIUM for answers

Gemini 3.8 Flash lets you set how much it thinks per call: MINIMAL, LOW, MEDIUM or HIGH. The assistant runs at LOW. One question showed us why that might matter. It asked for a complete list from a 42-row table. At LOW, the agent listed 37 rows and quietly left out the 5 that applied to a related product. It made a scope decision on its own and did not say so.

At MEDIUM it listed all 42, but only after we fixed a second problem: the assistant’s output limit was a default of 2,048 tokens that nobody had changed, and on Gemini 3 thinking tokens count against the same limit. At MEDIUM and HIGH, answers were cut off mid-sentence. With 8,192 tokens, MEDIUM finished in 32 seconds with the full list. HIGH was too slow for chat.

So we ran the agent at MEDIUM on all 30 questions:

VersionAverage placeWins vs todayTypical timeOver 60 s
Agent, MEDIUM thinking1.5721-949 s10 of 30
Agent, LOW thinking2.1716-1225 s0
Today’s assistant2.2720 s0

21-9, but at 49 seconds. Too slow for a chat window. That started a chase for MEDIUM’s quality at LOW’s speed.

Splitting the thinking: cheap search, careful writing

The idea: let the model choose its searches at LOW, and write the final answer at MEDIUM. The catch is that in a tool-calling loop, choosing and writing happen in the same call. The model either returns tool calls or starts writing. You cannot set one thinking level for searching and another for writing.

Our first version: run every step at LOW. When a step comes back with an answer, throw that answer away and write it again at MEDIUM from the same history. It worked: quality matched MEDIUM throughout. But it took 42 seconds, so we measured where the time went, step by step:

Split version, 5 questions, seconds per question (measured) Easy question 19-21 s Several searches 35 s Long answer 62 s AI choosing searches searches LOW answer, thrown away MEDIUM answer
The throwaway LOW draft cost 7 to 12 seconds on every question that finished normally.

Two attempts to remove the throwaway draft:

A “ready to answer” tool. Force the model to call a tool in every step, and give it a tool that means “I have enough”. When it calls that tool, MEDIUM writes the answer. Fast: 24.5 seconds. But it lost 1-8 to the split version. It searched half as much (12 searches across 10 questions against 26), because saying “ready” cost it nothing, so it said it too early.

Stop the draft as it starts. Stream every LOW step. The first part of a streamed reply tells you what the step is: a tool call, or answer text. If it is answer text, stop the stream right there and let MEDIUM write. No guessing, and the searching behaviour stays exactly the same. The one risk: when a streamed step turns out to be a tool call, the full message has to be put back together from the streamed pieces and sent back to Gemini on the next step. That includes a hidden “thought signature” Gemini 3 attaches to tool calls; if it is missing, Gemini rejects the request. We tested it on more than 60 questions with several searches each, and it worked every time.

Version (10 questions)SearchesTypical timeDeciding to answer
Split, throwaway draft2645 s7-12 s
Streamed, stops at first answer text2633 sabout 2 s
“Ready” tool1225 s2-6 s

Same searches, 12 seconds faster. We had a candidate.

The test that stopped us

Before shipping, we wanted one more check. The streamed version lost 7-3 to the split version in a blind review, even though the two do exactly the same searching and write from exactly the same text. That made no sense, so we tested the test.

First, the noise. We ran the split version a second time, with identical code, and had a blind reviewer compare it with its own first run, 1:1, on 30 questions. (1:1 means the reviewer sees two answers to the same question at a time, without knowing which version wrote which.)

17-7identical code against its own rerun
12-11streamed version against a fresh split run
42 s vs 33 ssame code, run at 15:10 and at 18:00

The first split run was simply a good run. It had happened in the afternoon, when Gemini was slower and the agent searched more (83 searches against 68 in the rerun). Run-to-run variation on 30 questions was large enough to swing a result by 10 wins. Every comparison we had made between versions run at different times carried that much noise.

Second, the questions. All our tests used the same 30 questions, and we had tuned the agent while reading its answers to them. So we took 31 real partner questions we had never looked at, and ran today’s assistant and each candidate at the same time, in parallel processes, so both saw the same Gemini.

Candidate vs today’s assistant (31 fresh questions, blind 1:1)ResultTypical timeAnswers with unsupported claims
Streamed agent, new index, MEDIUM writingtie, 13-13 (5 ties)42 s vs 22 s12 vs 10
Today’s search on the new index, MEDIUM writinglost, 9-17 (5 ties)22 s vs 22 s14 vs 6
Today’s assistant on the new index (10 questions)tie, 5-523 s vs 23 s5 vs 2
Share of decided comparisons won against today's assistant Agent, tuned questions 21-9 (70%) Split, tuned questions 19-6 (76%) Streamed, fresh questions 13-13 (50%) 50% = no better
The wins on the questions we tuned on did not survive fresh questions run side by side.

On fresh questions, run side by side, nothing beat today’s assistant. The agent version tied it at twice the wait. MEDIUM writing on top of ordinary searching was worse: it wrote fuller answers, but filled the gaps with confident details its evidence did not support.

We had been one approval away from shipping a slower assistant that was no better.

Is it the index or the model?

That raised the real question. If better passages and better search do not improve the answers, what does? We set up a race. Several AI agents answered the same 10 fresh questions, each with access to only one knowledge store. Each agent marked the start and end of each question, so we timed them from logs, not from what they reported. Blind reviewers then ranked the answers and checked every deciding claim against the documents.

The contestants were Claude agents (Opus 5.5 and Sonnet 5.5 at medium effort) and Gemini 3.8 Flash, on three stores:

  • Old index or new index, with fixed commands (search, list titles, search in a document, read passages in order), like the chat’s tools.
  • Old index or new index, with free read-only Elasticsearch queries, plus a one-page description of the index structure.
  • A plain folder of Markdown files, one per document, written from the new conversion, with only word search and file reading. This is how a coding agent works through a codebase.
Agent (10 fresh questions)TimeSearchesText readBlind resultInvented / wrong
Opus, fixed commands, new index6.5 min28444K charsbest of the four Opus runs0 / 0
Opus, free queries, new index6.4 min36427K2nd0 / 0
Opus, free queries, old index7.0 min46411K3rd0 / 0
Opus, fixed commands, old index7.7 min39825Klast, lost 1-9 to the new index2 / 1
Opus, Markdown folder5.8 min67even with the index, 4-50 / 0
Sonnet, fixed commands, new index6.7 min27508Klost 0-10 to Opus0 / 1
Same 5 questions, Markdown folderTimeAgainst Opus (blind 1:1)Invented / wrong
Opus 5.5, medium effort1.8 min0 / 0
Sonnet 5.5, medium effort1.9 min0-4, 1 tie0 / 0
Gemini 3.8 Flash, MEDIUM5.2 min2-31 / 1
Gemini 3.8 Flash, LOW4.6 min0-52 / 2

What we took from it:

  • For a capable agent with chat-style tools, the new index clearly helped: faster, fewer steps (28 searches against 39), and better answers (9-1). Titles and summaries help an agent pick the right document. With the old index, it had only file paths to go on.
  • An agent that writes its own queries makes up for a weak index. It just needs more steps.
  • Plain files with word search are fast for exact terms (commands, setting names, error text) and slower for questions that need meaning-based search.
  • The model decided most of it. Opus and Sonnet were correct in every setup and invented almost nothing. Gemini Flash invented details or got facts wrong in every setup. On plain files it also searched without converging: the same search with small variations, again and again, until it hit its round limit.

Finally, we compared the best Opus agent on the Markdown folder directly with today’s production assistant, on the same 10 fresh questions. Opus won 7-3. Today’s assistant stated something the documents do not support in 5 of its 10 answers: a recommendation that is not in the guide, a support address the documents never give, a procedure from a related product presented as if it applied here. Opus did that in none.

That comparison is not equal. Opus had no time limit and free access to all files; the assistant has 25 seconds and one search tool. A reviewer from the same model family as one of the contestants is also a risk for self-preference, which is why every deciding claim was checked against the documents. But a factual error is a factual error, whoever spots it.

The full circle

Looking back, the whole project was one problem solved three times.

1. Big passages Keep a section together,more text per search hit. Problem: the search modelsees only 512 tokens. 2. Small chunks + agent Clean 512-token passages;agent tools put them backtogether at answer time. Problem: no better answers. 3. A capable agent Simple tools, free to searchand read. It combined whatit needed on its own. Worked on every store.
Each step fixed the previous step's problem. The last one made most of the earlier work optional.

First we used big passages to keep context together, and the 512-token limit of the search model worked against us. Then we cut everything into clean small chunks and built agentic search to stitch the right chunks back together at answer time: extra phrasings, section expansion, neighbour passages, tools to read a document in order. That was a lot of engineering, and on fresh questions it gave the small model no better answers.

Then we gave a Claude agent a few simple tools and let it go freely: search, read a file, read the next part. It did on its own everything our pipeline was built to do. It found the right document, read the section around the hit, went back for the missing table rows, and stopped when it had enough. It did that on the old index, on the new index, and on a plain folder of Markdown files, and its answers were correct every time.

The structure still helped: with chat-style tools, the strong agent was faster and better on the new index. But most of the stitching logic we wrote is something a capable model does by itself.

What actually improved the production assistant

We are not switching the assistant to a frontier model yet. The assistant does more than answer from documents: it searches the web, reads and writes CRM records and talks to other systems, and all of that would need to move and be tested. So we went back to the assistant we have and looked for real gains.

MEDIUM thinking at every step. We ran today’s assistant, unchanged, with Gemini at MEDIUM for every step (and room for 8,192 output tokens), side by side with LOW on 10 fresh questions:

Today’s assistantLOW (production)MEDIUM at every step
Blind 1:12 wins6 wins (2 ties)
Answers with unsupported claims42
Searches across 10 questions1834
Typical time21.5 s40.3 s
Model cost per answer~$0.03~$0.07

This fits everything before it. MEDIUM only for writing, on top of LOW’s searching, made answers worse: more words from too little evidence. MEDIUM at every step searched almost twice as much, found more, and then wrote better. The price is time and money: about 40 seconds and twice the model cost. That is a real trade-off and still open.

Showing the answer as it is written. Today the assistant’s final step comes back from Gemini in one piece, and only then is it sent to the page. Writing the answer is the biggest single part of the wait: 44% of the total in our timing run.

Today's assistant, share of total time (5 questions, measured) choosing searches 28% searches 22% writing the answer 44% 7% With real streaming, the first words would appear 1 to 3 seconds into the writing step instead of at the end: roughly 6 to 9 seconds into a typical answer instead of 15 to 20.
The total time stays the same. The time until the partner starts reading drops by about half.

The streamed-step work from the split experiment proved the hard part: streaming a tool-calling step and still sending a correct message back to Gemini.

Not throwing work away at the time limit. About 12% of production answers hit the 25-second budget. When that happens, the loop stops, discards any step still running, and makes one more full call to write the answer from everything gathered. That last call had no time limit of its own. In one test, a Gemini stall there turned a one-word question into an 82-second wait.

A checklist for testing RAG changes

These are the rules we now follow, mostly learned the expensive way:

  1. Test on questions you did not tune on. Keep a fresh set aside and do not read its answers while you build. Our biggest wins came from the questions we had been staring at.
  2. Run the versions at the same time. Model speed and behaviour change during the day. Two runs hours apart are not a fair comparison, even with identical code.
  3. Measure the noise first. Run the same version twice and compare it with itself. If it beats itself 17-7, a 15-10 result between two versions means nothing.
  4. Compare answers 1:1, blind, with fact checks. Rank two answers at a time, hide which version wrote which, and make the reviewer check deciding claims against the documents. Count unsupported claims separately; a longer answer is not a better one.
  5. Watch the reviewer. An AI reviewer from the same family as one contestant may prefer its style. Fact checks help; a second reviewer from another model family is better.
  6. Measure retrieval and answers separately. Our retrieval numbers improved a lot in a small test and did nothing for the answers, because the model already had the text it needed.
  7. Time every step before optimizing. Our biggest time losses were a throwaway draft, an answer that arrives all at once, and work discarded at the time limit. None of them was in search.
  8. Check the output limit when you raise thinking. On Gemini 3, thinking tokens share the output limit. A 2,048-token default quietly cut our answers.
  9. Keep each document’s full conversion output. We store the whole Docling document next to the passages, so we can re-chunk without converting again.
  10. Ask early whether the model is the bottleneck. Give a strong model the same documents and simple tools. If it answers well from your current index, the index is probably not your problem.

What we would do differently

We would have run the fresh, side-by-side test on day two, not week two. It would have shown in one afternoon that the old passages were not what held the answers back.

We do not regret the rebuild. The new conversion is better data by every measure we took, and the best agents did better on it. When the assistant’s model changes, this is the index it will use. But the lesson for us, and maybe for you: before improving how documents are stored, check whether the model can use what it already has.

Next step

Bring us a messy process.

One call, and we'll tell you what can run itself.

Tell us about your process