Skip to content

Free guide

Build retrieval a reviewer can inspect

Use retrieval-augmented generation to answer from approved documents and separate a search failure from an answer-writing failure.

Why it matters

A product manager can define which material counts as support. A developer can measure the retrieval stage and answer stage separately so improvements target the real weak point.

Core concepts

Index source material

Split documents into meaningful passages with a source ID, section, version, date and access scope. A tiny chunk can lose a qualifier; a huge chunk can mix unrelated rules. Test the chunk size against real questions and note boundaries such as tables.

Retrieve candidates

An embedding represents features as numbers. A vector index can return nearby representations even when words differ. Exact search can work better for identifiers or policy numbers. Combine methods when tests show each fills a gap. Apply authorization before returning passages.

Ground the answer

Give the model the question and retrieved passages, require citations and define what to do when evidence is missing or conflicting. A citation must support the actual claim, including any date or exception. A citation to a relevant-looking document can still be wrong.

Evaluate two failures separately

Retrieval recall at k asks whether expected evidence appears among k candidates. Answer review asks whether citations support each claim. If evidence is absent, improve indexing, filters or query construction. If evidence is present but the answer is wrong, inspect the prompt, model and context presentation.

Try it step by step

  1. Write five answerable questions and three that the approved corpus cannot answer. Mark the expected sources or abstentions.
  2. Inspect retrieved passages before generating answers. Include stale versions and inaccessible documents in synthetic tests.
  3. Score citation support and abstention. Re-index updated or removed sources and verify the old passages no longer surface.

Use a retrieval worksheet with query, expected passage, retrieved rank, version, answer, cited claim and reviewer verdict.

Worked example

Fictional example: An assistant answers from an outdated returns policy because both versions use the same words. Adding an effective-date filter corrects the candidate set. Increasing the language model size would still feed it the wrong document.

Common mistake

Tuning answer wording while the correct passage never reaches the model.

Practice exercise

With 10 labeled questions, suppose the right passage is in the top three for 8. Answers are correct for 6 of those 8. Calculate retrieval success (80%) and conditional answer accuracy (75%). Name a different experiment for each failure.

Check your understanding

The correct paragraph appeared in none of the top five results. Which layer should you inspect first?

  1. Retrieval and document indexing
  2. The color of the chat bubble
  3. The wording of the final paragraph
Show answer

Retrieval and document indexing. The answer generator did not see the necessary evidence.

Takeaway

Inspect the evidence your system actually handed to the model.

Further reading

Browse more lessons