Skip to content

Retrieval That Checks Its Own Work

Learning objectives

By the end of this module you should be able to:

  • Explain why a single similarity search has a structural quality ceiling for corpora at scale, and what reranking buys that a single vector lookup alone cannot.
  • Distinguish three separable concerns in an agentic system's design — the scaffolding around a model call, the loop that lets a system revise its own intermediate steps, and the graph that shapes how those steps connect — and place a concrete improvement into the right one.
  • Argue why a self-correcting retrieval loop needs a hard iteration cap and a judge that is a different model call than the one writing the final answer, not just "let it retry until it looks right."

The quality ceiling of one lookup

A retrieval-augmented system's simplest form does exactly one thing per question: embed the query, run one nearest-neighbor search, hand whatever comes back to a model and ask it to answer. This works well for a small corpus and a simple question. It degrades in a specific, structural way as a corpus grows into the thousands of documents: the top handful of matches by raw vector similarity are not guaranteed to be the best handful for actually answering the question, and a single search has no mechanism to notice when they aren't.

Two separate improvements close different parts of that gap, and it is worth being precise about which is which.

Reranking: a cheap second look before the answer is written

The first improvement doesn't change how many searches run — it changes what happens to the results before they reach the answering step. Over-fetch a larger candidate set than you intend to use, then run a second, deliberately cheap pass that reorders those candidates by actual relevance to the question rather than trusting raw similarity score alone. The candidates that make it to the final answer are the best of a wider net, not merely the first handful a single search happened to surface.

This is worth naming precisely as a harness concern: it is scaffolding around the model call, not a change to how many times the system reasons about whether it has enough. The reranking pass itself should run on the cheapest capable tier available — it is a sorting judgment, not the hard reasoning work, and treating it as such keeps the improvement affordable at scale. A well-designed harness degrades gracefully, too: if the reranking step fails for any reason, falling back to a plain relevance-score sort is strictly better than the alternative of silently keeping an unsorted, unfiltered result set — never leave a quality improvement's failure mode worse than doing nothing at all.

When one pass genuinely isn't enough

Reranking improves what one search returns. It cannot manufacture evidence that a single search never found in the first place — a question whose answer depends on synthesizing facts from two or three separate documents may need more than one retrieval pass, with the second pass informed by what the first one revealed was missing.

This is where the second, distinct concern enters: a loop. Add a judgment step after retrieval that asks, in effect, "is what we have sufficient to answer this, or should we look again with a more specific question?" If insufficient, refine the query and retrieve again. If sufficient — or if the system has already tried enough times — proceed to write the answer.

That last clause is not an afterthought. Any loop that revises its own plan needs a structural, hard-coded ceiling on how many times it may go around, enforced by the surrounding system rather than left to the model's own judgment about when to stop. A model asked "keep trying until you're satisfied" has no principled reason to ever be satisfied, and a system whose retry behavior depends entirely on the model's own discretion has no actual bound at all — it has a suggestion. The cap is what turns "the system tries harder when it needs to" from a hope into a guarantee: the loop always terminates, and it terminates by answering with the best evidence available, never by hanging.

The judge has to be a different judge

There's a subtler design point inside that loop, and it's the one most worth sitting with. The step that decides "is this sufficient?" must not be the same reasoning pass that goes on to write the final answer — and not merely for cost reasons, though keeping it on a cheaper capability tier than the eventual answer does matter for keeping the whole loop affordable.

The deeper reason is structural: a judge that evaluates the evidence before any answer has been drafted has nothing to rationalize. A judge that instead evaluated a drafted answer — "does this response look complete?" — would be reviewing its own future output's plausibility, and a fluent, confident-sounding answer is exactly the kind of thing a language model is good at producing regardless of whether the underlying evidence actually supports it. Judging the evidence directly, before synthesis ever happens, keeps the sufficiency check honest in a way that judging the finished prose cannot guarantee.

Checking the answer's citations after the fact, too

One more check belongs at the far end of the pipeline, after synthesis has already happened: does every source citation in the finished answer actually correspond to a document that was retrieved for that specific turn? An answer can be fluent and still cite something that was never actually part of its own evidence — not necessarily through any intent to deceive, but because a language model's account of its own sources is itself just more generated text, subject to the same fluency-without- guaranteed-accuracy gap as anything else it writes.

Verifying citations mechanically — comparing what the answer claims against what the system can independently confirm was actually retrieved —catches that gap without needing to trust the model's self-report at all. This, too, is a harness concern: a check that wraps the model's output rather than a change to how the model reasons, applied consistently regardless of how confident the answer sounds.

Key takeaways

  • A single retrieval pass has a structural quality ceiling that a bigger or better embedding model does not remove. Reranking raises that ceiling for what one pass can surface; only an additional, informed pass can supply evidence the first pass never found at all.
  • Harness, loop, and graph are separable design concerns, and naming them precisely clarifies what fixes what. A reranking step is scaffolding around a call. An iterative refinement step is a loop with a termination guarantee. How those steps connect and under what conditions is the graph. Conflating the three tends to produce systems that either under-engineer the actual bottleneck or add complexity in the wrong place.
  • A self-correcting loop without a hard, structural iteration cap is not actually bounded — it only looks bounded until the day it isn't. The cap, and the discipline of judging evidence before synthesis rather than the drafted answer after it, are what make "the system tries again when it needs to" a real guarantee instead of an aspiration.

For further study

  1. Reranking and the adaptive retrieval loop both add a second look at evidence, but at different points in the pipeline and for different reasons. Construct a concrete question where reranking alone would be sufficient, and a second where it would not be — and explain precisely what the second question needs that the first doesn't.
  2. The module argues the sufficiency judge must evaluate evidence, not a drafted answer, to avoid reviewing its own future output's plausibility. Design a scenario where judging the drafted answer instead would produce a specific, concrete failure — not just "it might be biased," but an example where it demonstrably would be.
  3. A hard iteration cap guarantees termination but not correctness — a loop can exhaust its cap on a question that genuinely needed one more pass. Propose a design for what the system should do differently when it terminates via the cap rather than via genuine sufficiency, and justify why that distinction is worth surfacing at all.

Next: Document Ingestion Router — a reference architecture for the ingestion side of retrieval over large, heterogeneous document collections.