RAG or Long Context: How to Decide for a Document Workload
Use long context when your documents fit comfortably in the window and the same material is read many times, and use retrieval when the collection is large, changes often or must be searched by meaning. Neither vendor's documentation tells you which to pick for your data, so this guide sets out what each documents and then gives a decision method that is our own reasoning. Facts come from Anthropic and OpenAI pages as read on 10 November 2026.
Key facts
- Anthropic lists a 1M-token context window for many current models, including Claude Opus 5.5 and Sonnet 5.5, with up to 128k output tokens per request. Other models have 200k.
- Anthropic's documentation says that as token count grows, accuracy and recall degrade, a phenomenon it calls context rot, so curating what is in context matters as much as available space.
- Everything in a request counts toward the window: the system prompt, messages, tool results, images, documents, tool definitions and the model's output, including thinking. Cached tokens still occupy the window.
- OpenAI's retrieval guide describes semantic search over your data using vector stores. Files are chunked, embedded and indexed automatically, with a default chunk size of 800 tokens and 400 tokens of overlap.
- OpenAI's listed vector store limits include 512 MB per file and no more than 5,000,000 tokens per file. Storage is free for the first 1 GB, then $0.10 per GB per day.
What long context gives you
Long context is the simpler design. You put the documents in the prompt and ask the question. There is no index to build, no chunking choice and no retrieval step that can miss the passage you need. Anthropic's page gives the ceiling: up to 1M tokens on many current models, with a single request holding up to 600 images or PDF pages on models with that window. For models with a 1M window, long-context requests are billed at standard pricing, with one exception noted on the pricing page: Claude Haiku 5.5 charges more for prompts over 100,000 tokens.
Repetition makes it cheaper. If the same documents are sent again and again, prompt caching bills cache reads at a fraction of the input price, 0.1x of the base input price on most Anthropic models and less on some, for example 0.05x on Opus 5.5 and Sonnet 5.5, according to the pricing page. Anthropic is clear on one point: caching changes what you pay for those tokens, not whether they count toward the window.
What long context costs you
The same Anthropic page warns that more context is not automatically better. Accuracy and recall degrade as token count grows, so a full window can answer worse than a short, curated one. You also pay input tokens on every request that sends the whole set, and a request whose input alone exceeds the window fails with a 400 error. Anthropic offers a token counting API to estimate this before you send.
What retrieval gives you
OpenAI describes semantic search as surfacing semantically similar results even when they match few or no keywords. A vector store holds the index. Adding a file chunks, embeds and indexes it automatically, so a growing collection is handled by the service. You send only the passages that match, which keeps each prompt short. The OpenAI page lists limits and storage prices, and it does not say when to prefer retrieval over putting everything in the prompt, so that choice is yours.
What retrieval costs you
This part is our reasoning, not a vendor claim. Retrieval adds moving parts: a chunk size, an embedding step, a ranking step and a failure mode where the right passage never reaches the model. The chunk defaults on OpenAI's page, 800 tokens with 400 tokens of overlap, are a starting point, and the page allows custom sizes between 100 and 4,096 tokens. You need an evaluation set to know whether your settings work.
A decision method
Our suggested order of questions:
- Does the whole set fit well under the window, with room for the answer? If not, use retrieval or split the task.
- Is the same set read many times? If so, long context with caching can be cheap.
- Does the set change daily or hourly? A changing collection favors an index that updates per file.
- Do you need to point to the exact source passage? Retrieval returns passages, which makes citations easier.
- Does quality fall when you add more documents? Test it, because Anthropic documents that accuracy can degrade as context grows.
Whatever you choose, build a small evaluation set of real questions first and compare both designs on it. For background on how retrieval stacks are changing, see our coverage of Pinecone's Nexus against multi-hop RAG and of a vector database benchmark. Compare products in the AI tool directory.
Questions people ask
Does a 1M-token window replace RAG?
Not by itself. Anthropic's documentation says accuracy and recall can degrade as context grows, and a large collection may not fit at all. Long context suits sets that fit and are read repeatedly.
What is context rot?
It is Anthropic's term for the decline in accuracy and recall as the number of tokens in the context grows.
How big are chunks in OpenAI file search?
The default chunk size is 800 tokens with 400 tokens of overlap, and custom sizes can be set between 100 and 4,096 tokens.
Sources