Zero Labs
Industry News / AI

RAG vs. Long Context in 2026: When Retrieval Still Wins

Source · Towards AI By M. Haseeb Hassan

From the publisher’s feed, collected in the ZeroLabs newsroom.

Anthropic’s own benchmark tells an uncomfortable story about dumping everything into the prompt: even with a generous context window, standard retrieval still missed the right chunk 5.7% of the time, and fixing that took a second retrieval technique, not a bigger window [1]. That single number is the whole argument of this post. Two years ago I wrote about RAG as the fix for a context window that topped out around 32,000 tokens. Claude Sonnet 5 and Gemini 3.1 Pro now both ship with a 1 million token window [2][3], and the question has quietly flipped from “how do we fit the knowledge base in” to “should we, even if we can.”Bigger windows didn’t retire retrieval. They just changed what it’s for.In this article:What actually changed since the 32k-token daysWhy a longer window doesn’t mean more reliable recallThe real cost of dumping everything into the promptWhere long context wins outrightA decision framework for 2026What actually changed since the 32k-token daysWhen I wrote The RAG Revolution (Enhancing LLMs) in 2024, the pitch for RAG was simple: models couldn’t see enough of your documents at once, so you fetched the relevant slice and handed it over. That constraint is mostly gone. Claude Sonnet 5’s documented context window is 1 million tokens, priced at $2 per million input tokens and $10 per million output tokens, with cached reads down at $0.20 per million tokens [2]. Gemini 3.1 Pro matches it with a 1 million input-token window, billed at $2 per million tokens up to 200,000 tokens and $4 per million beyond that threshold [3][4].Do the arithmetic and a full-context approach looks almost free for a one-off question. Anthropic’s own contextual retrieval write-up makes the same point directly: if your knowledge base is under roughly 200,000 tokens, about 500 pages, you can just paste the whole thing into the prompt and skip retrieval infrastructure entirely, especially once prompt caching absorbs the repeated cost [1]. For a lot of internal tools and single-user assistants, that’s the entire architecture decision settled in one sentence.Why a longer window doesn’t mean more reliable recallThe part that the window-size marketing leaves out is what happens to accuracy once you actually fill that window. NVIDIA’s RULER benchmark tested models against their advertised context lengths and found that “only half of them can maintain satisfactory performance at the length of 32K,” even though those same models score close to perfect on a simple needle-in-a-haystack retrieval check [5]. Passing the easy version of the test and failing the realistic one is the pattern across the board, not a quirk of one model.Chroma’s “Context Rot” study pushed on this further by holding task difficulty constant and scaling input length from 25 words up to 10,000, across 18 models including Claude 4, Gemini 2.5, and GPT-4.1 [6]. Performance didn’t degrade in a straight line. It degraded unevenly, worsening faster when a question’s wording didn’t closely match the answer’s wording, and worsening further in the presence of even one distractor sentence. The researchers also found a consistent gap between focused prompts of roughly 300 tokens and full prompts of roughly 113,000 tokens on the same underlying task [6]. I wrote about the mechanics behind this in Context engineering: drift, bloat, and the lost-in-the-middle problem, and the original “Lost in the Middle” research from 2023 is still the clearest explanation for why: models reliably read the start and end of a long input better than the middle of it [7].Anthropic’s contextual retrieval experiment shows retrieval accuracy is still a solvable, separate problem from window size.Retrieval sidesteps this by construction. A good retriever hands the model three or four tightly relevant passages instead of three hundred loosely relevant ones, so there’s less haystack for the needle to get lost in. That’s a reliability argument, and it holds even when the budget for context is effectively unlimited.The real cost of dumping everything into the promptPrice-per-token tables make long context look cheap, but they hide a multiplier that retrieval avoids: you pay for the context on every single call, not once. A 150,000-token knowledge base re-sent on every user question at Claude Sonnet 5’s uncached input rate costs roughly $0.30 per call before the model has generated a single output token. Anthropic’s own prompt caching brings that down substantially since cached reads price at $0.20 per million tokens instead of $2 [2], but caching has its own constraints around cache lifetime and how often the underlying content changes, which I covered in Prompt caching and token budgeting: what’s documented vs. exam-tested. A knowledge base that updates hourly breaks the cache more often than one that updates monthly, and every cache miss is a full-price re-send.Retrieval doesn’t eliminate that cost, but it shrinks it to the size of whatever you actually retrieved, which for most queries is a few thousand tokens instead of a few hundred thousand. At scale, the gap compounds: a support bot fielding ten thousand questions a day against a 150,000-token knowledge base is a materially different bill if every call carries the full context versus a few retrieved passages. I laid out a similar per-call-cost lens for choosing between model tiers in Choosing Between Opus, Sonnet, and Haiku: A Cost Framework, and the same logic applies one layer up, to how much context you’re paying to re-process on every single turn.Both frontier models now advertise a 1M-token window. The pricing structure underneath it is where the real decision lives.Latency moves in the same direction as cost. A longer input takes longer to process before the model can start generating, even with caching softening the blow on repeat calls. Retrieval keeps the per-call input small and the time-to-first-token short, which matters more than raw throughput for anything a person is sitting in front of waiting for an answer.Where long context wins outrightNone of this makes retrieval the right default everywhere. A full-context approach wins cleanly when the knowledge base is small and static enough to fit comfortably under that 200,000-token threshold Anthropic calls out, when the task genuinely needs to reason across the whole document rather than a slice of it, such as summarizing an entire contract or finding every place a variable is referenced across a codebase, or when the content changes so rarely that a cached context pays for itself across many calls [1][2]. A one-off research assistant reading a single long report, or an internal tool used by five people against a stable 50-page policy document, is exactly the case where building a retrieval pipeline is more engineering than the problem deserves.A decision framework for 2026The honest answer, two years after the first wave of RAG hype, is that context window size stopped being the deciding factor. The deciding factors are knowledge base size relative to that 200,000-token caching threshold, how often the content changes, how many calls you’re making against it, and whether the task needs targeted recall or whole-document reasoning. Anthropic’s own data suggests a practical split: under roughly 200,000 tokens of mostly static content, put it all in the prompt and lean on caching; above that, or with content that changes often enough to keep breaking the cache, retrieval earns its complexity back, and contextual retrieval’s reranking layer is worth the extra step once accuracy, not just recall, is what’s being measured [1]. Most systems worth shipping in 2026 end up as a hybrid: a cache-backed full-context pass for the stable core of a knowledge base, with retrieval layered on top for whatever keeps changing underneath it.The decision tree that replaces “just use the bigger window” as a default.The context window arms race was never going to make retrieval obsolete, because it was never really solving the problem retrieval solves. A bigger window buys you room. It doesn’t buy you recall, and as RULER, Chroma, and the original “Lost in the Middle” findings all show in their own way, room without reliable recall is just a more expensive way to miss the same chunk [5][6][7].SourcesContextual Retrieval in AI Systems, AnthropicClaude Sonnet 5, Claude Platform DocsGemini 3.1 Pro, Google DeepMindGemini Developer API pricing, Google AI for DevelopersRULER: What’s the Real Context Size of Your Long-Context Language Models?, arXiv (NVIDIA)Context Rot: How Increasing Input Tokens Impacts LLM Performance, Chroma ResearchLost in the Middle: How Language Models Use Long Contexts, arXiv / TACLIf you enjoyed the article and wish to show your support, make sure to:👏 Give a round of applause (50 claps) to help get featured👥 Follow me on Medium to stay updated with my latest content📰 Explore more articles on my Medium Profile🔔 Connect with me on LinkedIn, Twitter, and InstagramRAG vs. Long Context in 2026: When Retrieval Still Wins was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.