An engineer asks a support agent whether the payment worker can charge an order twice after a capture request times out. She attaches the incident timeline, the worker runbook, a portion of the payment client, and the provider's integration contract. Together, the files contain about 35,000 tokens, well within the input limit of the model the team uses.

The product has a retrieval pipeline, so the agent searches those files instead of reading the packet. The five highest-ranked passages describe retries and idempotency. The runbook says an uncertain capture is retried after fifteen minutes. The client reuses the original idempotency key. The other passages explain why repeating a request with the same key normally avoids a second capture. The agent concludes that the retry cannot charge the customer twice.

One clause is missing. In this hypothetical provider contract, deduplication is guaranteed for only ten minutes. The worker may retry after fifteen. If the first capture succeeded but its response was lost, the second request could fall outside that guarantee. Other protections might still prevent a duplicate, so this does not prove that two charges will occur. It means the evidence returned by search cannot support the confident safety claim.

The retriever found relevant information. The answer was consistent with what the model received. The failure was that the selected evidence left out a condition that changed what the system could legitimately conclude.

Passing the full, authorized packet would have made the clause available, although the model might still have overlooked it. A stronger retrieval pipeline could also have found the clause without sending all 35,000 tokens. Those are the alternatives worth comparing. This is not a contest between two incompatible technologies. It is a decision about which evidence to expose, how much context the model can use reliably, and what the system does when the evidence remains incomplete.

What exactly are we comparing?#

A lot of RAG versus long-context comparisons start from an unfair setup. RAG gets five independently scored chunks, while long context gets carefully selected, complete documents. When long context wins, it is tempting to conclude that retrieval was the wrong idea. The test may have established only that a flat top-five retriever was insufficient for that question.

There are three practical strategies to consider.

StrategyWhat reaches the modelTypical problem
Flat chunk retrievalA fixed number of the highest-ranked passagesRelevant passages arrive, but one necessary condition is missing
Intact-document contextThe complete authorized documents selected for the taskRequired facts are present, but can be overlooked or confused with distractors
Structured retrieval and expansionDiscovered sources, coherent sections, and targeted follow-up evidenceSelection and gap detection can fail, with additional cost and latency
Three approaches to the same payment-retry question: flat top-k retrieval omits the provider guarantee, intact documents include the clause but still require reasoning, and structured retrieval expands a recognized evidence gap.
The three approaches differ in how evidence reaches the model. Structured expansion can close a recognized gap, but cannot guarantee it will discover every unknown dependency.

The third approach is still RAG. It can retrieve whole documents and pass them to a long-context model. Long context describes the model's ability to accept and use a large input. Retrieval describes how the system finds or selects material. In a production design, they commonly operate together.

Before selecting one of these paths, I would distinguish two questions. Did the user name the source documents, or does the system have to discover them? If an engineer explicitly uploads four files and asks about their interaction, document discovery has already happened. If she asks what caused similar incidents across millions of tickets, code changes, and runbooks, retrieval is essential just to identify the candidates. Combining those cases in one benchmark makes it difficult to tell which system is actually better.

For the payment investigation, we know the four supplied files. The immediate decision is whether to read them intact or select parts of them. Neither option establishes that the files represent the entire payment system. A ledger-level duplicate guard could exist outside the packet. That limit on the source scope needs to remain visible in the answer.

The part a relevance score does not tell you#

The question turns on four conditions. The worker can retry an unknown outcome after fifteen minutes. The client reuses the idempotency key. The provider guarantees deduplication for ten minutes. And the first capture could have succeeded even though its response never reached the worker.

These facts live in different places, and some of them are unlikely to use the words in the user's question. A semantic search for double charge after retry may favor broad explanations of idempotency. A lexical search for retry may favor the worker runbook. The clause defining a request-token retention window may score poorly against both queries.

Most dense retrievers and rerankers score candidates according to their relationship with the question. They do not ordinarily score a set of passages for whether it proves or disproves a system invariant. Five passages can each be relevant and collectively leave the question unresolved. Increasing top_k might find the contract clause, but it can also add three copies of the same explanation and an obsolete runbook. More context is useful only when the added material improves the evidence the model can use.

The October 2026 study The Bottleneck Is Retrieval, Not Reading makes this distinction explicit. Its evidence-grounded evaluations identify cases where similarity retrieval finds at least one relevant passage much more reliably than it finds all the passages required for a multi-fact answer. The authors also examine how chunking can strip away document information needed to resolve references. Those are findings from particular benchmarks and model configurations, but the failure mode is directly relevant to engineering documentation.

There is another complication. A valid answer may have more than one possible supporting evidence set. A provider contract could show that the key's guarantee expires, while a verified ledger invariant might independently establish that a second capture is blocked. An evaluation that demands exactly four annotated chunk IDs would reject legitimate alternative reasoning. For questions about guarantees, the test has to judge whether the actual conclusion follows from some valid set of permitted evidence, not whether the retriever reproduced an annotator's preferred passages.

Chunk boundaries also remove meaning#

Consider a design document that says, "This exception no longer applies after migration." A small chunk containing that sentence is not useful unless the reader knows which exception, which migration, and which services were affected. The missing information may be in a heading, a nearby table, or a later amendment.

The same happens with code and operational notes. An incident report can contain an early hypothesis and a correction near its end. A retry runbook may have one rule for version 4.2 and a different rule for 4.5. A search result stripped of its source revision can be truthful but misleading when combined with another result from a different version.

I would treat document identity as part of the evidence, not as optional display metadata. For the hypothetical payment investigation, suppose the incident occurred on October 14 and provider contract version 4.5 became effective on October 1. A version 4.2 contract retrieved from the archive might describe a different retention guarantee. The context assembler needs the provider account, contract version, effective date, and source location to know which clause applies. Full context can also mix those versions if the packet includes both and their authority is not made clear.

A better retrieval implementation preserves section hierarchy and source identity when indexing. It can retrieve a specific paragraph and then expand to its parent section, keeping the heading and any qualifying table. It can diversify candidates across documents rather than filling the context with many near-duplicates from one runbook. Anthropic's Contextual Retrieval work reports improved retrieval recall on its evaluated datasets when chunks receive parent-document context, with further gains from lexical search and reranking. The metric there measures retrieval failures, not guaranteed final-answer correctness.

At some point, expanding four sections of a known thirty-page document may be less sensible than just reading the document. That is a workload decision. It does not make parent expansion inherently inferior, and it does not mean every retrieved paragraph needs the whole parent document.

Long context can see the clause and still miss the point#

An intact packet avoids the omission introduced by selecting only five passages. The provider clause can no longer disappear because its embedding ranked too low. But the model must still find it and compare ten minutes with fifteen minutes. It must recognize that a missing guarantee is not proof of a duplicate charge and that other safeguards may exist outside the supplied files.

The advertised context window tells you the maximum input the endpoint accepts under its rules. It does not tell you how reliably a model reasons across that input. Lost in the Middle found that the position of evidence affected several tested models, often with weaker performance when the needed text appeared in the middle of long inputs. The NoLiMa benchmark reduced literal overlap between questions and relevant facts and found substantial degradation with longer contexts across many evaluated models. Neither study establishes a permanent token threshold or a ranking of every current model. Both show why accepting 100,000 tokens is different from using 100,000 tokens reliably.

The structure of the context matters too. Thirty-five thousand tokens from four coherent documents are not equivalent to the same number of tokens from shuffled, overlapping search results. Repeated explanations can crowd out the qualification that matters. Conflicting versions can be harder to resolve when the prompt fails to identify which one applies. I would test the full packet with the decisive condition placed near the beginning, middle, and end, and examine whether the conclusion and citation support change.

A correct-looking answer is not enough. If the model says that a delayed retry is unsafe but cites only the worker runbook, it has not supplied evidence for the provider retention condition. If it says a second charge definitely occurred, it has gone beyond the available evidence. Long context can solve a selection problem while leaving an evidence-use problem intact.

A case where retrieval is better even though everything fits#

Now consider a deployment question rather than a payment investigation. A service owner asks which rollback setting is active in production. The selected migration packet contains the old procedure, two interim changes, a failed rollout note, and the final approved configuration. The whole packet fits in the model's context window.

A full-document prompt might answer correctly, but it has to resolve several conflicting values and determine which one applied after the final rollout. If the source system already has trustworthy environment, revision, and effective-time metadata, a version-filtered search can return the current production setting and its approving change directly. It exposes less obsolete material and gives the model fewer ways to mix historical instructions with the current state.

This is a legitimate reliability advantage of retrieval, not merely a token saving. It is conditional on the filters being correct. An incorrectly tagged deployment or stale index can be worse than a full packet in which the revision history is visible. If the question asks why the setting changed through the migration, selecting only the final line would lose important information. The same corpus can favor retrieval for a current-value lookup and full-context reasoning for an explanation of the entire change.

Both paths also need to treat document content as untrusted data. A retrieved passage or full report can contain instructions telling the agent to ignore the user or send data elsewhere. Expanding the context does not give those instructions authority. Source text may support factual claims, while tools and policy checks still determine what actions the system may take.

Why the research does not settle the choice for your system#

The 2024 EMNLP industry paper Retrieval Augmented Generation or Long-Context LLMs? found that long-context approaches performed better on average under the models and resources studied, while retrieval was substantially cheaper. The authors proposed Self-Route to use the cheaper path when possible. That is evidence for adaptive selection, not a standing claim that full context will outperform every well-tuned retriever.

More recent work moves beyond the choice between independent chunks and complete documents. BEAR evaluates hierarchical, budgeted evidence allocation across several QA and reasoning settings. S2G-RAG uses a judge that predicts evidence sufficiency and identifies gaps to drive follow-up retrieval. Both demonstrate useful approaches on their reported benchmarks. Neither proves that a production assistant can reliably detect every missing operational dependency.

That last limitation matters. In the payment example, an offline evaluator can read the provider contract and label the missing ten-minute clause. An online controller given only the runbook and client cannot know about an exception it has never encountered unless its domain knowledge, task specification, or another search gives it reason to look. A model that says "sufficient evidence" is making a prediction from what it sees. It is not certifying that no unseen document could change the conclusion.

What I would actually build for evidence selection#

I would keep retrieval and context assembly as distinct decisions. The first stage resolves the allowed source scope and finds candidate documents when discovery is needed. The second decides what parts of those documents the model receives. The third checks whether the proposed claims are supported by those parts, without treating that check as a proof that the wider system has no exceptions.

For ordinary lookups, the path can remain simple. A request for the definition of capture_timeout_ms may need one version-matched configuration section. For a question containing conditions such as can this happen after a retry, the system should expect relationships across sources. High-impact domains can have explicit evidence requirements. A general-purpose assistant can predict likely dependencies, but the strength of that prediction should be evaluated rather than assumed.

In the payment workflow, a domain-specific controller might represent the investigation this way:

question: Can a delayed retry create a second capture?
source_scope: uploaded incident packet, integration version 4.5
required_checks:
  retry timing                 found
  idempotency key behavior     found
  provider guarantee           missing
  uncertain first outcome      found
state: recognized evidence gap
next query: provider contract, idempotency retention or expiry
remaining retrieval rounds: 1

The missing entry triggers a targeted search of the authorized provider material. If the relevant contract section is found, the assembler preserves its heading, version, and source offsets alongside the worker rule. If it is not found, the answer cannot claim that the key makes the retry safe. The controller can ask for the provider contract or explain which condition has not been established.

An implementation needs a bounded contract around this loop. The request carries source scope, model and token budgets, a deadline, and a maximum number of retrieval rounds. Each retrieved item keeps a stable source ID, content revision, effective time when relevant, and citation offsets. The context builder deduplicates repeated explanations, reserves space for distinct required sources, and expands sections only where the relationship demands it. It should not let one runbook consume the entire evidence budget merely because several of its chunks scored highly.

The controller's possible outcomes also matter. It can report that evidence supports a scoped answer, that it has recognized a missing dependency, that sources conflict, or that the authorized corpus does not establish the broader claim. In the last two cases, another search may help, but only until the deadline or retrieval budget is exhausted. After that, a conditional answer or an explicit statement of what is unknown is preferable to another unsupported assertion.

The broader source authorization and context lifecycle belong to the context layer. The decision here is narrower: which portions of an authorized source set are necessary for this particular answer.

There is no universal sufficiency threshold hidden in an embedding score. A judge or verifier can assess whether a claim follows from the presented evidence. It cannot generally prove that the source selection included every fact that matters in the real system. The distinction is especially important for words such as always, never, and guaranteed. Those claims require defined scope and often independent system invariants, not just a successful search of a document index.

Measure the missing evidence, not just the final answer#

I would not launch this routing policy on the strength of a few examples where the hybrid produces a better paragraph. The evaluation has to tell us which component failed and whether the added retrieval work was worth it.

Use a frozen set of permitted source snapshots and compare five conditions. The first is a flat top-k baseline because that is the failure mode the article begins with. The second is a credible retrieval baseline with lexical plus semantic search, reranking, correct metadata filters, and appropriate parent expansion. The third supplies intact, authorized documents where the source set is known and fits. The fourth is the bounded adaptive route. The fifth is an oracle-evidence control: give the same model a minimal, human-verified sufficient evidence set without making it retrieve anything.

Five evaluation conditions, flat top-k, strong RAG, full documents, adaptive evidence expansion, and human-verified oracle evidence, are assessed with the same model and answer rules to diagnose retrieval and evidence-use failures.
Oracle evidence is an offline diagnostic control, not a production retrieval strategy. Compare claim support and evidence availability separately to find which stage failed.

The oracle condition is a diagnostic, not a deployable product. It helps separate the problem of finding evidence from the problem of using it. If the model answers correctly with the oracle set but fails after retrieval, inspect discovery and assembly. If it succeeds with the oracle set but fails on the complete documents, examine distraction, source conflicts, and evidence position. If it fails even with the oracle evidence, more retrieval is unlikely to fix the underlying reasoning task. The control is not a formal upper bound, because changing prompt size and structure can affect behavior in either direction.

The evaluation must distinguish known-document questions from corpus-discovery questions. For a known packet, compare the same source scope across approaches. For discovery, do not unfairly give one system a hand-picked complete packet while asking the other to search millions of unrelated files. Keep model versions, instructions, decoding settings, citation requirements, and authorization policy consistent. Account for the extra model calls made by the adaptive controller.

For answerable questions, label one or more valid supporting evidence sets, not a single preferred set of chunk IDs. A supported conclusion may be reached through a contract limitation, a verified code invariant, or another independent source. Include questions whose source packet is genuinely incomplete so the expected response is a bounded conclusion or abstention. These cases must be reported separately from answerable questions where the retriever simply failed to find the evidence.

MeasurementWhat it isolates
Relevant-source discoveryWhether the right documents appeared among the candidates
Complete-evidence coverage on answerable casesWhether the final context contains at least one sufficient supporting set
Evidence-use accuracyWhether the model reaches a conclusion justified by the evidence it received
Claim-level citation supportWhether each material claim is backed by the cited source spans
Abstention and gap-detection qualityWhether the system detects unresolved cases without needlessly refusing answerable ones
End-to-end cost and p50/p95 latencyWhether a higher-quality route is operationally affordable

Run a further test that deliberately moves the decisive clause between the start, middle, and end of an intact packet. Test lexical mismatches such as request retention against a question about double charging. Include conflicting revisions and an incomplete or stale index snapshot. Log separately when the search found a passage, when the assembler retained it, and when the generator used it. Otherwise every regression looks like a generic answer-quality failure.

The source boundary needs its own label. A system that lacks the provider contract cannot be scored as having failed to read it. It may have a corpus-coverage problem or a task that simply is not answerable from the supplied material. This is different from an answerable case where the contract was available but never selected. The earlier ArchCrux essay Your RAG Evals Are Measuring the Wrong Thing goes further into production evaluation. The specific issue here is assigning failure to evidence discovery, evidence selection, or evidence use.

The cost of a fallback needs to include the first attempt#

It is easy to describe adaptive context expansion as cheaper than always sending the full document. Whether it is cheaper depends on how often the fallback runs and what work has already been done.

Consider a deliberately hypothetical cost model. The small retrieval path costs 6 units per question, including search and generation. The full-document path costs 35 units. An adaptive path always pays the first 6 units, then pays another 35 when it needs a full-document retry. If 20 percent of questions trigger that retry, its expected request cost is 6 + 0.20 × 35 = 13 units. All three figures are illustrative accounting units, not API prices or benchmark results.

The expression is useful because it exposes the dependency: adaptive cost = initial-path cost + fallback rate × incremental fallback cost. If the fallback reuses cached work or expands only a section, its incremental cost changes. If a verifier adds another model call on every request, that cost belongs in the initial path. Prompt cache hit rates, index maintenance, and repeated questions all matter. For self-hosted inference, long-prefill capacity and KV-cache pressure can dominate the unit economics under concurrency.

Latency has a different shape. A request that runs retrieval, generates an answer, detects a problem, and then sends the full document pays for sequential work. With a 20 percent fallback rate, those slow requests will often appear in the p95 latency, even when the average cost looks attractive. A route that sends the full document immediately for known multi-condition questions may be faster than a cheaper first attempt followed by an expensive retry.

The final comparison should use cost per correctly supported answer at an agreed latency target. A cheap route that produces an unjustified safety guarantee may create expensive review or recovery work. A long-context route that adds tokens without improving correctness is also wasteful. Quality, latency, and cost must be measured together, with unsupported answers reported rather than hidden inside an average score.

How I would choose the path#

For a small, known document packet, I would evaluate intact-document context first when the question depends on relationships across sections. The packet must fit the model's tested effective context budget, not merely its advertised maximum. For an exact configuration lookup, I would prefer version-filtered retrieval if it can return the authoritative setting directly. For a question over a large unknown corpus, I would retrieve candidate sources, expand the sections that carry necessary conditions, and allow a bounded follow-up when a specific gap is recognized.

I would not allow the model's own confidence to be the only route selector. It can be confident when a contract clause is missing, and it can declare insufficiency when the required fact is already present. Source size, user-selected scope, task type, evidence structure, past measured failure rates, and the cost of being wrong provide more defensible routing signals. A model-based gap judge can contribute, provided its misses and unnecessary fallbacks are measured.

For the hypothetical payment question, the answer I would accept is narrow: the supplied provider guarantee does not establish that key reuse prevents a duplicate after the delayed retry. To decide whether the system can actually charge twice, the investigation must also examine the order ledger and any other capture safeguards. That conclusion uses the evidence without claiming more than the sources establish.

The reason to compare RAG with long context is not to declare one of them obsolete. It is to stop treating relevant search results as a complete explanation and to stop treating an accepted context window as proof of comprehension. Sometimes the best evidence is the whole report. Sometimes it is one version-matched section. Often it is a small set of connected passages assembled from a much larger corpus. The choice should be visible in the system design, and its failure should be identifiable in the evaluation rather than discovered after an engineer trusts the wrong answer.

Primary references#