A documentation agent, chosen by measurement across three architectures
I wanted an agent that answers from our versioned technical manuals and always cites its source. I had three architectures built and evaluated, and chose with data, not opinion.
- 4.85from 4.46
- LLM-judge score (1–5), RAG against full context, on 26 golden questions
- 15/17from 12/17
- answerable questions with a grounded answer, RAG against full context
- 100%
- of injected errors detected by the grounding check, with 0% false alarms on correct answers (targets: at least 90% and at most 10%)
Three architectures, each with its key figure
Fig. 03 · follows your scroll
Step 1
RAG, scored first
A retrieval index and a language model, behind a fixed flow. Scored on 26 golden questions in four categories; three of the four test whether the agent declines. Judge score 4.46 and 12 of 17 answerable questions grounded.
Step 2
Full context: more accurate, slower
Every manual of one version goes into the model's context. Judge score 4.85 and 15 of 17 grounded; real grounding failures went from 2 to 0, and p50 latency from 10.7 s to 13.8 s.
Step 3
No vector database
That was the real constraint for the third architecture. Lexical retrieval with a BM25 index of its own, then three model calls: plan, select sections, answer. Recall@10 97% and MRR 0.79 on 34 paraphrased questions.
Step 4
Answers that cite their source
Answers carry verified [n] citations. End to end, 34 of 34 answers came with citations and 33 of 34 cited the expected section (97%). A grounding check then scores each claim against the sources it read: 100% of injected errors detected, 0% false alarms. Nobody uses the agent in daily work yet.
My decisions
- Choose the architecture with a measured evaluation: 26 golden questions in four categories, scored by an LLM judge.
- Design the third architecture under the real constraint of having no vector database.
- Design the converter around the privacy constraint, with no external dependencies: content does not leave the team.
- Use a fixed flow instead of a tool-using agent, because the agent could not be forced to call its tool.
- Set the pass bar for the grounding check before testing it: at least 90% of injected errors detected and at most 10% false alarms.
- Make the check run after the answer and only log, so it never slows down or blocks the user.
Assisted execution
- An AI assistant built the three architectures and their flows under my rules.
- An AI assistant wrote the document converter with no external dependencies, plus its tests: 29/29 unit and 9/9 flow simulation.
- An AI assistant ran the evaluations, computed the retrieval metrics, and built the grounding check and its validation, under my rules.
Context
I lead technical documentation for a line of fraud-prevention products in enterprise cybersecurity. The manuals are long, they change with every version and they exist in Spanish and English. I wanted an agent that answers questions about them and always shows where the answer comes from.
What I decided
I decided not to pick an architecture by preference. Each one would be built and measured against the same questions before I chose.
The golden set had 26 questions in four categories: answerable, not covered by the documentation, about another product and about another version. Three of the four categories test whether the agent declines. A confident answer to a question the manual does not cover is the more dangerous failure.
For the verification layer I fixed the bar before building its test set: at least 90% of injected errors detected and at most 10% false alarms on correct answers. A threshold set in advance is what keeps an evaluation from becoming a demonstration.
For the third architecture I accepted a real constraint: no vector database was available. Third-party conversion tools were ruled out to keep information secure, so I had the converter built with no external dependencies. The rule is simple: content does not leave the team.
How it works
Three architectures, built in sequence:
- First, RAG. Retrieval-augmented generation: a retrieval index and a language model, behind a fixed flow.
- Second, full context. Every manual of one version goes into the model’s context.
- Third, no vector database. Lexical retrieval with a BM25 index of its own, then three model calls: plan, select sections, answer. Answers carry verified
[n]citations, and sub-agents talk through A2A-style contracts. The corpus covers one product, in Spanish and English. Release announcements are an extra source, filtered so that nothing from a later version than the one consulted is ever shown.
On top of the third architecture sits a grounding check. After the agent answers, and without making the user wait, a sub-agent splits the answer into claims and scores each one against the sources it read: supported, partial, unsupported or contradicted. It combines a model-based verifier with deterministic checks for figures that appear in no source, rates the answer ok, review or fail, and logs every result. It does not correct or block: it observes and leaves a trace.
- Judge score (1–5)
- Grounded answers (of 17 answerable)
- Trick questions handled
- Latency p50 (lower is better)
Real grounding failures: 2 with RAG, 0 with full context. Full context was more accurate and slower. That trade-off went to the decision-maker as a one-page summary.
Try the trade-off
01 · RAG
- Judge4.46
- Grounded12/17
- p5010.7 s
- Real failures2
02 · Full context
- Judge4.85
- Grounded15/17
- p5013.8 s
- Real failures0
Accuracy matters most
Choose full context: +0.39 on the judge and 3 more grounded answers, with no real grounding failures. The cost: 3.1 s more per answer at p50.
Speed matters most
Choose RAG: 3.1 s faster per answer at p50. The cost: 0.39 lower on the judge, 3 fewer grounded answers and 2 real grounding failures.
What it produced
The third architecture reached a Recall@5 of 91%, a Recall@10 of 97% and an MRR of 0.79, on 34 paraphrased questions in both languages. Both recall figures beat their targets.
Run end to end on those 34 questions, the agent completed 34 of 34 answers with citations. 33 of 34 cited the expected section (97%), and 170 of 181 citation sentences (94%) were verified against the source. Median latency was 8.6 s and p90 13.5 s.
The grounding check was validated with two sets: 34 real answers labeled correct, to measure false alarms, and 60 answers with errors deliberately injected, to measure detection. It detected 100% of the 60 injected errors against a 90% target, and raised 0% false alarms on the 34 correct answers against a 10% tolerance.
The conversion pipeline turned the source manuals into Markdown with a minimum text retention of 99.4%, identical headings and zero alerts. It also found structural differences between the Spanish and English originals, and it corrected the document names across the corpus.
What it does not prove yet
The agent is not in production. There is no real usage data, no satisfaction measure and no rate of valid citations in daily use.
This is a proof of concept, evaluated end to end, not a service. The grounding check is validated on two test sets I designed, of 34 and 60 answers, not on real traffic. Front-end hosting, persistent memory and a user feedback channel are still missing. Nobody uses the agent in daily work yet, so I have no data on questions per day, satisfaction or the share of answers with a valid citation in real use.
What I would do next
Host the front end, add persistent memory and a feedback channel. Then put the agent in front of real users and measure questions per day, satisfaction and the share of answers with a valid citation. Exposing the documentation as a server that other teams’ AI tools can consult (MCP) is a later phase, once the governance of that information is settled.