Kognita
All posts
Engineering2026-07-02·9 min read

RAG vs. long-context LLMs: is retrieval still worth it in 2026?

Context windows are past a million tokens. So why not skip retrieval and paste in everything? An honest look at what long context fixed, what it didn't, and where RAG still wins.

Every few months someone declares RAG dead. The argument is clean: context windows keep growing, they're past a million tokens now, so just paste your whole knowledge base into the prompt and let the model sort it out. No embeddings, no vector database, no chunking headaches.

It's a fair question, and the answer isn't tribal loyalty to retrieval. It's that "just paste everything in" quietly assumes away four problems that don't go away.

RAG vs long-context LLMs

What long context genuinely fixed

Credit where it's due. Long context solved real pain:

  • Single large documents. A 300-page contract or a full codebase used to require careful chunking and multi-hop retrieval. Now it fits. If your unit of work is one big document, long context is often simpler and better than RAG.
  • Reasoning across a whole document. Questions like "is this clause consistent with that one 200 pages later?" are exactly what retrieval struggles with and long context handles naturally.

If your problem is "understand this one big thing," reach for long context first. RAG was partly a workaround for windows that were too small, and that specific workaround is less necessary now.

The four things it didn't fix

1. Cost and latency scale with what you send. You pay per input token on every call. Pasting 500K tokens of context into a prompt that gets called thousands of times a day is not a rounding error — it's the majority of your bill, and it's latency the user feels on every single query. RAG sends a few thousand relevant tokens instead of a few hundred thousand. Even with prompt caching, you're caching a haystack to find a needle you could have retrieved directly.

2. "Lost in the middle" is still real. Models don't attend uniformly across a giant context. Facts placed in the middle of a long window get recalled far less reliably than facts near the start or end. A million-token window doesn't mean a million tokens of usable attention. Benchmarks that stress retrieval-at-depth still show accuracy sagging as the relevant fact moves away from the edges. Retrieval sidesteps this by putting the relevant passage front and center, short.

3. Your knowledge doesn't fit, and it changes. The "just paste it all" framing works at demo scale. Real knowledge bases are gigabytes — millions of documents, not one book. That never fits in any window. And it's not static: docs get edited, tickets close, policies change. With RAG you re-embed the changed content and the next query sees it immediately. With a paste-everything approach, "everything" is a moving target you'd be reassembling constantly.

4. No provenance. When a model answers from 500K tokens of pasted context, which sentence did the answer come from? You can't cite it, you can't show the user a source, and you can't audit it. RAG hands you the retrieved passages as a byproduct — every answer comes with its receipts. For anything regulated, support-facing, or trust-sensitive, that's not a nice-to-have.

They're not actually competitors

The framing of "RAG vs. long context" is the mistake. Long context made RAG better, not obsolete. The strong 2026 pattern uses both:

  • Retrieve to narrow millions of documents down to the dozens that matter — cheaply, with citations.
  • Use the big window to fit those dozens of passages generously, plus room for reasoning, instead of cramming five chunks into a tight budget.

Retrieval is a filter over a corpus that will always be larger than any window. Long context is headroom for the passages that survive the filter. You want your index to do the coarse cut and the window to do the fine reasoning.

A decision guide

Your situationReach for
One large document, analyzed occasionallyLong context
Reasoning across a whole self-contained docLong context
Large or growing corpus (millions of docs)RAG
High query volume where cost/latency matterRAG
Need citations, provenance, auditabilityRAG
Frequently changing contentRAG
Best-quality answers over a big corpusRAG to filter → long window to reason

The bottom line

Retrieval in 2026 isn't a workaround for small context windows anymore — that job is mostly done. It's a cost, latency, freshness, and provenance layer over a corpus that will always outgrow the window. Long context didn't kill RAG. It freed RAG to stop being stingy with the passages it does retrieve. The teams doing this well aren't choosing sides; they're using retrieval to decide what the model reads and a big window to give it room to think.