Retrieval
Long context vs RAG for a fixed source list: when to skip the index
Decide whether a fixed list of web pages fits in the prompt or needs a retrieval index, what each choice costs, and how to test both on your own questions.
By Rose Donaldson, Context Retrieval team · Published
This article was drafted with AI assistance from the sources listed below and edited and published by the Context Retrieval team.
- 1Count the tokensMeasure the whole page list with your model's tokenizer, not a rule of thumb.
- 2Run both on real questionsAnswer the same question set with the full pages and with retrieved chunks.
- 3Compare per queryScore quality and input tokens per question; long context pays for every page every time.
- 4Consider routingAnswer from retrieved chunks first and fall back to the full pages when the model says it cannot.
- 5Keep source labelsEither way, label each page with its URL and title so answers can cite it.
A team has a fixed list of sources: forty pages of product docs, a policy handbook, a few reference articles. The pages change now and then, but the list does not grow. With context windows large enough to hold all of it, the question comes up in every design review: why build an index at all? Why not put every page in the prompt and let the model read? This post looks at what the research says, what you give up when you skip retrieval, and how to decide on your own questions rather than on a benchmark.
What "long context" means here
We use long context for the approach that sends the full text of every source page with each question, and RAG for the approach that splits the pages into chunks, retrieves a few per question and sends only those. Both start from the same fetched Markdown. The difference is what happens between the fetch and the prompt: an index, a retriever and a top-k, or nothing.
Anthropic gave a rule of thumb in its September 2024 post on contextual retrieval: if a knowledge base is smaller than 200,000 tokens, which it put at about 500 pages of material, you can include all of it in the prompt with no need for RAG.1 The same post says that for larger knowledge bases that do not fit in the context window, RAG is the typical solution. Treat the page count as a rough conversion. Web pages vary widely in length, so count the tokens of your own list with your model's tokenizer.
What one controlled comparison found
Li et al. compared the two directly in a study accepted to the EMNLP 2024 industry track.2 They used Gemini-1.5-Pro, GPT-4O and GPT-3.5-Turbo on question-answering sets from LongBench and ∞Bench, split contexts into 300-word chunks and retrieved the top 5 by default. Their headline: when resourced sufficiently, long context beat RAG on average, and RAG cost far less. Cost was measured in input tokens, not dollars, and retrieval overhead was not counted.
The averages in their main table make the gap concrete. For Gemini-1.5-Pro, long context scored 49.70 and RAG 37.33. For GPT-4O, 48.67 against 32.60. For GPT-3.5-Turbo, the oldest of the three, the gap nearly closed: 32.07 against 30.33. The authors also found that RAG and long context gave exactly the same prediction for 63% of queries. That is the opening their hybrid uses.
When RAG failed, the authors sorted the causes into multi-step reasoning, general queries, long and complex queries, and implicit queries that need an understanding of the whole context. On a fixed page list, "summarize what changed across these docs" is the second kind.
Self-Route: retrieval first, the full pages as a fallback
Self-Route answers each query with RAG first, with an instruction to reply "unanswerable" when the retrieved chunks are not enough. Only those queries go to the long-context model with the full text.2 In the paper's results, GPT-4O with Self-Route scored 48.89 against 48.67 for long context, using 61.40% of the long-context tokens. Gemini-1.5-Pro scored 46.41 against 49.70, with 38.39% of the tokens. So the router held quality for one model and gave up some for the other, while cutting tokens for both.
Their appendix varies k, on averages where long context scored 45.53. RAG rose from 20.24 at k=1 to 44.12 at k=100, at which point it used slightly more tokens than long context. Self-Route was cheapest on average at k=5. The authors note that the best k depends on the task, and that Self-Route assumes the model judges answerability well. Those are their datasets and models from 2024. The method transfers; the numbers may not.
What long inputs do to current models
Chroma's context-rot report, published in July 2025, tested 18 models and found that performance falls as input length grows, even on simple tasks.3 A single distractor lowered accuracy against the needle-only baseline, and four distractors lowered it further. On LongMemEval, focused prompts of about 300 tokens did significantly better than full prompts of about 113,000 tokens.
This matters for a fixed page list because docs pages are full of near-misses: the same setting described for two versions, the same error explained in a guide and a FAQ. The report does not test RAG. What it supports is narrower: more context is not free, even when it fits.
What you give up when you skip the index
Skipping retrieval removes the chunker, the embeddings and the vector store. It does not remove the rest of the pipeline, and some of it gets harder.
- Citations. With chunks you have chunk IDs, and a citation can point to a passage. With whole pages, label each one in the prompt with its URL and title, and ask the model to quote the sentence it relied on. Otherwise the best you get is "somewhere on this page". Our citations guide covers the labels.
- Refresh. Pages still change, so you still re-fetch them. What you save is re-chunking and re-embedding. The prompt is only as current as the last fetch.
- Per-query cost. RAG pays for a few chunks per question. Long context pays for every page on every question. If the list grows, the cost grows with it, and at some point the list stops fitting at all.
- Debugging. With RAG you can log which chunks the model saw and ask whether the answer was among them. With long context the answer was always in the prompt, so a wrong answer is always a reading problem.
How to decide on your own pages
Start from a set of real questions, as in our post on a golden question set. Run each question twice: once with the full pages, once with your retriever's top-k. Score the answers, and record input tokens per question. Then sort the misses. If RAG misses are mostly questions that span pages, long context or a router is the fix. If long-context misses are mostly wrong-version or near-duplicate answers, retrieval may be filtering out distractors, and you should keep it.
If both score about the same, the cheaper path wins on cost per query, and that is usually RAG. If long context wins clearly and the list is small and stable, skip the index and keep the page labels. If the picture is mixed, try a router like Self-Route and measure how many queries fall through to the full pages. Rerun the comparison when you change models, because the gaps above were measured on 2024 models.
Footnotes
-
Anthropic, "Introducing Contextual Retrieval" (September 2024). ↩
-
Li, Li, Zhang, Mei and Bendersky, "Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach", arXiv 2407.16833 (EMNLP 2024 industry track). Scores and token shares from Table 1 and Appendix B. ↩ ↩2
-
Hong, Troynikov and Huber, "Context Rot: How Increasing Input Tokens Impacts LLM Performance", Chroma Technical Report (July 2025). ↩
Frequently asked questions
Is long context better than RAG?
In Li et al.'s 2024 study, long-context models scored higher than RAG on average across their datasets when given enough resources, while RAG used far fewer tokens. A later report from Chroma found that model performance drops as input grows, even on simple tasks. Neither result settles it for your pages; test both on your own questions.
When can I skip RAG and put all documents in the prompt?
When the whole source list fits comfortably in the model's context window and the per-query token cost is acceptable. Anthropic wrote in 2024 that a knowledge base under 200,000 tokens, about 500 pages of material, could go into the prompt without RAG. Measure your own pages and test answer quality before you commit.
What is Self-Route?
Self-Route is a hybrid from Li et al. The model first answers from retrieved chunks and is told to reply unanswerable if the chunks are not enough. Only those queries are then sent again with the full context to the long-context model.
Do I lose citations if I skip retrieval?
Not if you label each page in the prompt with its URL and title. You lose chunk-level IDs, so a citation points to a page rather than a passage unless you ask the model to quote the span it used.