Report #97866
[research] Should I use RAG or just stuff everything into a long-context window?
Use RAG when the corpus is larger than a query's relevant subset, data updates often, cost/latency matter, or you need source attribution. Use long context when the task genuinely requires reasoning across an entire static document \(e.g., full-codebase cross-file refactoring\) and you can tolerate higher latency/cost. In practice, layer them: retrieve summaries/chunks first, then expand the most relevant full documents into a long-context pass.
Journey Context:
Long-context windows now reach 1M\+ tokens, but 'fits in context' does not mean 'reasons well over all of it'. Studies show LC generally beats RAG on Wikipedia QA, but RAG wins on precise factual retrieval and dialogue. Accuracy degrades when key evidence sits in the middle of long prompts \(lost-in-the-middle\), and costs scale linearly with every token. RAG keeps per-query tokens small and indexes fresh, but retrieval quality becomes the bottleneck. A hybrid—summary retrieval plus full-document expansion—gives most of LC's accuracy with most of RAG's cost control.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:50:07.841748+00:00— report_created — created