Boris Agatić · · 9 min read

Long Context Windows 2026: Million-Token Models & When They Actually Help

A few years ago a model could hold a few pages in its head. In 2026 the frontier models from Anthropic, OpenAI, Google and Mistral read hundreds of thousands — and in some cases a million — tokens in a single call: an entire codebase, a quarter of contracts, a book and its footnotes, all at once. It sounds like the end of retrieval pipelines and chunking headaches. It isn't. A huge context window is a powerful tool that also fails in quiet, expensive ways. This is a practical map of what long context actually buys you, where it beats retrieval, where it silently loses the plot, and what it costs.

What a context window actually is

The context window is the total amount of text — measured in tokens, roughly ¾ of a word each — that a model can consider at once: your system prompt, the conversation history, any documents you paste in, and the answer it generates. Everything the model "knows" for a given request has to fit inside it. When people say a model has a 200K or 1M token window, they mean that is the ceiling on how much it can read and write in one shot. Bigger windows let you skip the engineering of deciding which pieces of a large corpus to show the model — you can, in principle, just show it everything.

~1M
tokens in the largest production context windows in 2026 (≈750k words)
200K+
standard window on frontier assistants like Claude — a mid-size codebase
10×
cost swing between re-sending a long context and caching it

The catch: attention is not free, and not uniform

Two hard truths sit underneath every long-context demo. First, the compute cost of attention grows faster than linearly with sequence length, so a call that reads a million tokens is genuinely expensive and slow — you pay for every token on the way in, on every turn. Second, and less obvious: models do not read a long context evenly. Information at the very start and the very end of a prompt is recalled reliably; facts buried in the middle of a very long document are recalled far less well. This is the well-documented "lost in the middle" effect, and it means a fact being present in the context is not the same as the model using it.

Recall vs. Position in a Long Context — "Lost in the Middle" (Illustrative)

Long context vs. retrieval (RAG): not a fight

The tempting conclusion — "windows are huge now, so we can throw away our RAG stack" — is wrong for most production systems. The two solve different problems, and the best 2026 architectures use both. Retrieval narrows a large, changing knowledge base down to the few most relevant passages; long context lets the model reason deeply across those passages, plus the conversation, plus whatever else matters. Think of retrieval as choosing what to read, and long context as how much you can read at once.

SituationReach forWhy
Large, frequently-changing knowledge baseRetrieval (RAG)Cheaper, current, no need to re-read everything each call
One big document, deep cross-referencingLong contextThe model needs the whole thing in view to connect distant parts
Whole-codebase reasoning in an agentLong context + cachingStructure and relationships matter; cache the stable parts
Millions of documents, precise lookupRetrievalNothing fits a million records; retrieve then reason
Long multi-turn session with growing historyLong context + summarisationKeep recent turns verbatim, compress the old ones

Where long context genuinely wins

1. Reasoning across one large artifact

When the answer depends on connecting facts scattered through a single big document — a 300-page contract, a full financial filing, a whole codebase — long context beats chunked retrieval, because retrieval can miss the connection between two passages it never fetched together. Give the model the whole thing and it can cross-reference.

2. Agents that accumulate state

Long-horizon agents build up a working history — tool outputs, intermediate results, decisions. A large window lets that state stay in view instead of being lost or lossily summarised, which is why context management is one of the quiet foundations of reliable agents.

3. Few-shot with many examples

When you can show the model dozens of worked examples of a task in the prompt, quality often rivals a fine-tune — with none of the training cost or lock-in. Big windows make many-shot prompting practical.

Prompt caching changes the economics. Every major provider now lets you cache a large, stable prefix — a codebase, a rulebook, a long system prompt — so you pay full price to read it once and a fraction on every subsequent call. If your long context is mostly fixed across requests, caching turns an unaffordable pattern into a routine one. Without it, re-sending a million tokens every turn is how budgets die.

The cost and latency reality

Two numbers decide whether long context is viable for you: how many input tokens you send, and how often. A single one-million-token call is dramatically more expensive and slower than a 10K-token one, and if you re-send that context on every turn of a conversation the cost compounds fast. Caching helps enormously, but the discipline still matters: send what the model needs, not everything you have.

Relative Input Cost & Latency by Context Size — With and Without Caching (Illustrative, indexed)

How to use long context well

  1. Put the important stuff at the edges. Given "lost in the middle", place the key document and the actual question near the start and end of the prompt — not buried in the middle of a giant paste.
  2. Retrieve first, then fill the window. Don't dump a whole corpus because you can. Narrow with retrieval, then give the model generous context on the relevant slice.
  3. Cache the stable prefix. If most of your context is fixed across calls, cache it. This is the single biggest lever on long-context cost.
  4. Measure recall, not just fit. Test that the model actually uses facts placed deep in the context — a "needle in a haystack" check — rather than assuming presence equals use.
  5. Summarise old history. In long sessions, keep recent turns verbatim and compress the rest, so you spend tokens where they matter.

The bottom line

Million-token context windows are one of the most useful capabilities to land in the last two years — they made whole-document and whole-codebase reasoning genuinely practical. But "it fits" is not "it works". Attention is expensive and uneven, the middle of a long prompt is a blind spot, and re-sending huge contexts without caching is a fast way to a shocking bill. The teams getting value in 2026 treat context as a budget to spend deliberately: retrieve the right material, place it well, cache what's stable, and verify the model is actually reading what you gave it. Bigger is a tool. Knowing what to leave out is the skill.

Design context that works — and doesn't bankrupt you

We help teams architect retrieval, long context and caching together — choosing what to retrieve, what to keep in the window, and what to cache — across Anthropic, OpenAI, Mistral and self-hosted models, tuned to your accuracy and budget targets.

Talk to an AI consultant