Executive Summary

The useful question is not "Is RAG dead?" It is:

Which evidence path produces the best authorized, attributable answer for this workload within its latency, cost, and operating constraints?

Four architectures deserve a fair test:

  1. Direct long context: send the complete authorized evidence set with each request.
  2. Cached long context: reuse a stable prompt prefix under a provider's caching rules.
  3. Retrieval-augmented generation: select a small evidence set before generation.
  4. Hybrid retrieval plus long context: retrieve a broader candidate set, then synthesize across it.

None is a universal winner. Context-window capacity is an input limit, not a quality guarantee. Retrieval is a filtering mechanism, not proof that the right evidence was found. Prompt caching changes repeated-input economics, not evidence freshness or authorization. The decision should come from a versioned evaluation, not a corpus-size slogan.

What Changed in the Long-Context Era

Large windows removed one historical reason for RAG: many document sets can now fit into a single model request. That makes direct reading a credible baseline and often simplifies an early prototype.

It does not remove the other jobs a knowledge system may need:

  • selecting evidence from a corpus larger than the active window;
  • enforcing tenant, user, region, or record-level access before model exposure;
  • updating changed documents without rebuilding a giant prompt;
  • attaching stable source identifiers and timestamps;
  • limiting irrelevant evidence;
  • controlling repeated-input cost and time to first token;
  • proving which evidence supported an answer.

Research such as Lost in the Middle showed that model performance can depend on where relevant information appears in a long input. That result is a warning to test evidence position and distractors. It is not a timeless accuracy table that can be copied across newer models, tasks, and context lengths.

Start with the Evidence Shape

Before discussing a vector database or a context-window size, classify the workload.

Dimension Questions to answer Long context tends to benefit when Retrieval tends to benefit when
Evidence coverage Does a query need one passage or broad synthesis? most of the bounded set is relevant a small subset is normally sufficient
Freshness How often do documents or permissions change? changes are infrequent and easy to invalidate updates are frequent or incremental
Authorization Can all selected documents be shown to this caller? the full set shares one policy boundary filtering must happen by tenant, user, object, or purpose
Reuse Do requests share an identical stable prefix? measured cache reuse is high every request has a different evidence set
Attribution Must answers cite exact, current sources? document structure can be preserved and cited reliably source IDs and retrieval metadata are first-class
Scale Can the authorized set fit with instructions and output headroom? yes, with a meaningful safety margin no, or only by truncating important material
Operations Which failure modes can the team own? prompt assembly and cache invalidation are simpler indexing, retrieval evaluation, and freshness are mature

Do not turn this table into a new fixed threshold. A ten-page contract may require whole-document reasoning; ten million short records may require one exact lookup. The task's evidence distribution matters more than the raw token count.

Four Architecture Profiles

1. Direct Long Context

The application assembles the authorized documents and sends them with the question.

Strengths

  • minimal retrieval infrastructure;
  • preserves document order and broad relationships;
  • provides a strong baseline for summarization, comparison, and cross-section reasoning;
  • avoids chunk-boundary and embedding-recall failures.

Failure modes

  • relevant evidence competes with distractors;
  • request time and input usage grow with the evidence set;
  • each policy change can alter the prompt;
  • source attribution may be weak unless document IDs and boundaries are explicit;
  • truncation can silently remove needed evidence.

Direct long context is not "no architecture." It still needs document normalization, deterministic ordering, source labels, access control, size limits, and evaluation.

2. Cached Long Context

Prompt caching can make repeated stable prefixes cheaper or faster, but implementations differ.

  • Anthropic documents prefix-based cache breakpoints, model-specific minimums, and time-limited entries.
  • OpenAI documents automatic caching for eligible identical prefixes and exposes cached-token usage.
  • Gemini documents implicit caching for supported models and recommends a large common prefix at the beginning.

The portable conclusion is narrow: identical reusable prefixes can benefit from caching. Do not publish one provider's discount, retention period, or minimum as an architectural constant.

Measure:

text
cache_hit_rate        = requests_with_cached_input / eligible_requests
cached_input_share    = cached_input_tokens / total_input_tokens
invalidation_rate     = changed_prefixes / prefix_builds
cost_per_good_answer  = total_model_and_system_cost / accepted_answers

A cache hit does not validate an answer, refresh stale content, or authorize a document. Put rapidly changing or user-specific content after the stable prefix where the provider permits it, and log actual cache usage rather than assuming reuse.

3. RAG

A retrieval-augmented generation pipeline parses, indexes, filters, retrieves, optionally reranks, and sends selected evidence to the model.

Its core value in the long-context era is evidence selection:

  • filter by access policy before disclosure;
  • reduce unrelated context;
  • update individual records;
  • preserve document and chunk identifiers;
  • support corpora larger than one active request.

But RAG introduces a multi-stage recall problem. The answer can fail even when the model would have answered correctly from the original document:

text
document parse -> chunk construction -> index -> candidate retrieval
               -> policy filter -> reranker -> prompt assembly -> generation

Candidate retrieval in this diagram stays inside a trusted retrieval boundary; authorization can also be applied as a retrieval pre-filter. Unauthorized source text must not reach an external reranker, model, or user-visible log. After access is revoked, material retained in application or provider caches must also be handled under the applicable retention policy.

Evaluate each stage. End-to-end answer accuracy alone cannot tell whether a miss came from retrieval or generation.

4. Hybrid Retrieval plus Long Context

Hybrid does not mean "retrieve an arbitrary Top 50." It means using retrieval to construct a bounded evidence packet large enough for synthesis while preserving relationships the final task needs.

A robust packet may contain:

  • retrieved passages and neighboring sections;
  • document titles, versions, timestamps, and policy labels;
  • parent summaries or table-of-contents paths;
  • competing evidence, not only the highest-scoring passage;
  • an explicit statement when coverage is incomplete.

Hybrid is useful when the full corpus is too broad but the answer requires more context than a few isolated chunks. It also carries both classes of failure: retrieval can omit evidence, and the model can still misuse the larger packet.

Build a Decision Experiment

Step 1: Create a Representative Query Set

Stratify real questions instead of sampling only easy factual lookups:

  • exact fact retrieval;
  • multi-hop questions across documents;
  • whole-document summarization;
  • comparison and contradiction;
  • recent-update questions;
  • unauthorized or partially authorized requests;
  • unanswerable questions that should trigger abstention;
  • adversarial distractors and conflicting versions.

Freeze the documents, permissions, expected evidence, and evaluation rubric for each case. Keep a separate holdout set to detect tuning overfit.

Step 2: Run Equivalent Variants

Use the same model revision, answer format, authorization identity, output budget, retry policy, and evaluation set.

Variant Evidence path
LC complete authorized set
LC-cache same set, eligible stable prefix and measured cache behavior
RAG policy filter, retrieve, rerank, bounded evidence
Hybrid retrieve broader evidence with parent or neighboring context

Record the exact model, index, embedding model, reranker, chunker, prompt, and corpus revision. Without those pins, a future rerun is a different experiment.

Step 3: Score Quality in Layers

Use separate measures:

  1. Answer correctness: does the response satisfy the question?
  2. Citation correctness: does each cited source support the associated claim?
  3. Citation coverage: are material claims backed by evidence?
  4. Abstention quality: does the system decline when evidence is absent or unauthorized?
  5. Retrieval recall: for RAG and hybrid, was required evidence present before generation?
  6. Robustness: does performance change with document order, distractors, or stale versions?

Avoid one model-graded score with no human calibration. For high-impact domains, sample and adjudicate disagreements.

Step 4: Measure the Whole Path

Capture:

  • p50 and p95 end-to-end latency;
  • time to first output and completion time;
  • input, cached input, and output usage;
  • retrieval, reranking, policy, and generation latency separately;
  • cache hit rate and invalidation rate;
  • index freshness lag;
  • timeout, retry, and error classes;
  • cost per accepted answer, not only cost per model call.

The system boundary matters. A cheap model call with an expensive index or a high review burden is not necessarily the cheaper product.

A Workload-Driven Decision Matrix

Workload Strong first baseline What must be proven
One bounded report, contract, or book direct long context evidence-position robustness, citation accuracy, latency
Repeated analysis of one stable corpus cached long context actual cache hit rate, invalidation behavior, privacy fit
Frequently changing knowledge base RAG freshness lag, retrieval recall, citation correctness
Multi-tenant enterprise search policy-filtered RAG pre-generation isolation, object authorization, cache isolation
Broad synthesis across a large corpus hybrid retrieval coverage plus synthesis quality
Early prototype with uncertain demand direct long-context baseline a measured baseline before adding infrastructure
High-volume exact lookup search or deterministic API, possibly no LLM whether generation adds user value

The last row is important: RAG and long context are not the only options. If the answer is a structured record lookup, a typed API may be more reliable than either.

Common Decision Errors

Using context-window size as usable capacity

Instructions, tool definitions, conversation history, evidence, and output all share the budget. Leave headroom and test worst-case tokenization. A request that technically fits can still be too slow, too noisy, or impossible to cite.

Copying fixed cost or latency multipliers

Provider prices, cache rules, hardware, rate tiers, batching, payloads, and model revisions change. Publish the usage equation and dated inputs, not "RAG is 100x cheaper."

Treating retrieval as automatic accuracy

Poor parsing, chunking, metadata, filters, or reranking can remove the answer before the model sees it. Track required-evidence recall and inspect misses.

Treating caching as a knowledge update strategy

Caching reuses computation for a matching prefix. It does not decide whether the prefix is current. The application still owns invalidation, versioning, and access policy.

Evaluating only answer fluency

A fluent answer can be unsupported. Score evidence, citations, and abstention independently.

Production Rollout

  1. Start with the simplest credible baseline, often direct long context on a bounded authorized set.
  2. Add tracing for evidence IDs, policy decisions, usage, cache behavior, and latency.
  3. Build the representative query set before tuning.
  4. Add retrieval only when the experiment shows a coverage, scale, freshness, attribution, or cost need.
  5. Shadow the new path and compare accepted-answer outcomes.
  6. Keep fallback behavior explicit: fail closed on authorization uncertainty and say when evidence is incomplete.
  7. Re-run the evaluation when the model, provider cache policy, corpus, index, or prompt changes.

FAQ

Does a million-token context window make RAG obsolete?

No. Capacity does not guarantee reliable use of every passage or solve freshness, authorization, cost, and latency. Compare accepted answers from all four architectures on the same representative queries.

When should direct long context be the starting point?

When the document set is bounded and authorized, most questions need broad reading, and the pipeline meets quality, latency, and cost objectives. A fixed token count is not a universal switching threshold.

Can prompt caching change the architecture decision?

Yes, when requests actually reuse a provider-eligible prefix. Measure hit rate, cached-token share, and invalidation frequency. A large context with little reuse still processes substantial uncached input.

Why use RAG if the documents already fit?

Retrieval can select relevant authorized evidence, preserve source IDs, and support incremental updates. Parsing, recall, and reranking can also lose the answer, so prove that the benefits outweigh the additional failure modes and operating cost.

What must the comparison report?

Answer and citation correctness, citation coverage, abstention, required-evidence recall, p50/p95 latency, cache usage, freshness, policy failures, and errors, plus total cost per accepted answer. Model-call price alone cannot support an architecture decision.

Conclusion

Long context did not kill RAG. It made the architectural choice testable.

Use direct long context when broad reading of a bounded, authorized set is valuable and meets the service objective. Use caching when stable prefixes actually repeat. Use RAG when evidence selection, freshness, attribution, access control, or corpus scale justifies its moving parts. Use a hybrid when retrieval must narrow the search space without reducing the task to disconnected fragments.

The durable decision artifact is not a token threshold. It is a versioned workload, evidence set, measurement protocol, and result showing which path delivers the best supported answer for your users.

Primary Sources