Short answer
Use long context when the document set is bounded, changes rarely and questions need the whole set; use retrieval-augmented generation (RAG) when the corpus is large, changes often, needs per-user permissions or is queried at volume. With current Claude and GPT-6 models accepting about a million tokens, the deciding factors in 2026 are cost per query, latency and measured accuracy, not whether the documents fit.
- Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5 all have 1M-token windows.
- Long context cost scales with corpus size on every query; RAG cost scales with chunks retrieved.
- GPT-6 models bill prompts over 272K tokens at double input rates.
- RAG can filter by user permissions before the model sees anything.
- Aggregation questions favour long context; large, changing corpora favour RAG.
How do RAG and long context compare in 2026?
Long context means putting the whole document set into the prompt and letting the model read it. Retrieval-augmented generation (RAG) means indexing the documents, retrieving the passages most relevant to each question, and sending only those. In 2026 the window is rarely the constraint: every current Claude model takes one million tokens, and OpenAI lists a 1,050,000-token window for its GPT-6 models.
| Factor | Long context | RAG |
|---|---|---|
| What the model receives | The whole document set, every time | The top passages for each question |
| Setup | Almost none | Chunking, embeddings, an index and retrieval tests |
| Cost per query driven by | Corpus size | Number of passages retrieved |
| Corpus size it suits | Bounded sets that fit the window with room to spare | Any size, including millions of documents |
| Changing documents | Resend the new set; caches reset | Re-index changed documents only |
| Per-user permissions | Everyone sees the whole set | Filter before retrieval |
| “List every X” questions | Strong: nothing is filtered out | Weak: misses whatever retrieval missed |
| “Find this one fact” questions | Good, but accuracy can drop deep in long inputs | Good, if retrieval finds the passage |
| Main failure | Misreading or ignoring parts of a long input | The right passage never retrieved |
| Latency | Grows with the corpus on every query | Mostly fixed per query |
Many production systems combine them: retrieve a generous candidate set, then let a long context model read it all. Our guide to evaluating long context models explains why the advertised window and the usable window differ.
How do you test both on your own documents?
Build both versions over the same documents and ask the same questions, with answers you have checked by hand.
- A 300-page procedures manual. Ask 40 questions with known answers, plus five whose answers are not in the manual. Score correct answers, accurate citations and whether each version says “not covered”.
- Twelve supplier contracts. Ask “which contracts allow termination for convenience, and on what notice?” Score completeness: every contract must be listed correctly.
- Two thousand support tickets. Ask for every ticket in the last quarter mentioning a refund over $500. Score recall against a list you built with a plain search.
Record cost and response time per query for each. Our guide to RAG retrieval evaluation covers the retrieval-side measures.
What does each cost per query?
Worked example: a 600,000-token document set, 200 questions a month, about 1,000 output tokens per answer, at list prices on 19 October 2026 in US dollars.
| Approach | Per query | Per month |
|---|---|---|
| Long context, Claude Sonnet 5.5, uncached: 0.6 × $2 + 0.001 × $10 | $1.21 | $242 |
| Long context, Claude Sonnet 5.5, cache written 20 times a month (1-hour) and read the rest | $2.41 on a write, $0.07 on a read | about $61 |
| Long context, GPT-6.1 Sol, uncached and over 272K: 0.6 × $4 + 0.001 × $15 | $2.415 | $483 |
| Long context, Claude Haiku 5.5, over 100K: 0.6 × $0.50 + 0.001 × $2.50 | $0.30 | $60.50 |
| RAG, Claude Sonnet 5.5, 20,000 retrieved tokens: 0.02 × $2 + 0.001 × $10 | $0.05 | $10 |
The rates behind it: Anthropic bills the full million-token window at standard rates on Claude 4.6 and later models, except Haiku 5.5, which charges more for prompts over 100,000 tokens. OpenAI bills GPT-6 prompts over 272,000 input tokens at twice the input rate and 1.5 times the output rate for the whole request. A Claude Sonnet 5.5 cache read costs $0.10 per million tokens, against $4 for a one-hour cache write.
RAG adds costs the table does not show. Embedding the set is trivial: 600,000 tokens at OpenAI’s $0.02 per million is about one cent. The real costs are the index, its hosting and the engineering to build and maintain retrieval. With a build cost B and monthly running cost V, RAG pays back in B ÷ (long context monthly cost − RAG monthly cost − V) months. At 20 questions a month, long context on Sonnet 5.5 costs about $24 uncached, and RAG rarely pays back.
Measure token counts with the model you will use. Anthropic says its newer tokenizer produces about 30% more tokens than older Claude models for the same text, so counts from another tokenizer will undercount.
Which should you choose?
Choose long context if
- The document set is bounded and fits the window with room to spare.
- Questions need the whole set: comparisons, completeness checks, summaries.
- Query volume is low, or questions arrive in bursts that caching can absorb.
- Every user may see every document in the set.
Choose RAG if
- The corpus is large or grows beyond a single window.
- Documents change daily and freshness matters.
- Users must only see documents they are permitted to see.
- Volume is high enough that per-query cost dominates; see our RAG development service.
Where do both fall short?
- Superseded versions. Both answer from an old policy as readily as the current one. Remove or label outdated documents first.
- Confident gaps. Long context models can skip material deep in a long input; RAG systems answer from whatever was retrieved. Absence questions in your test set catch both.
- Privacy obligations. The Privacy Commissioner warns that generative AI tools may not always be compatible with rights to access and correct personal information (IPPs 6 and 7). An index you control makes finding and removing a person’s records easier than a long prompt rebuilt from scattered files.
- Offshore processing. Both approaches send documents to a model. For Claude, Amazon Bedrock’s Australian profile keeps inference within Australia and New Zealand; see data residency for AI systems for the options, and choosing a vector database for where an index can live.
For the basics, start with our lesson on understanding retrieval augmented generation.
Sources
- Models overview, Anthropic, Accessed 19 October 2026
- Claude API pricing, Anthropic, Accessed 19 October 2026
- Prompt caching, Anthropic, Accessed 19 October 2026
- API pricing, OpenAI, Accessed 19 October 2026
- GPT-6.1 Sol model, OpenAI, Accessed 19 October 2026
- Gemini API pricing, Google, Updated 16 October 2026
- Run generative AI inference with Amazon Bedrock in Asia Pacific (New Zealand), AWS, 26 March 2026
- Privacy Act 2020, New Zealand Legislation, Version as at 1 October 2026
- Generative artificial intelligence, Office of the Privacy Commissioner, 15 June 2023
Written by the Levy Street team in Wellington. Last updated 19 October 2026.