Long context vs RAG: when can you skip retrieval and put everything in the prompt?
Long context vs RAG is a size, cost and accuracy decision. When stuffing the whole knowledge base into the prompt works, when it breaks, and how to choose.
GraphRAG answers whole-corpus questions that vector RAG cannot, but it costs far more to index. How the two differ, what each is good at, and a decision table for choosing.
Your RAG assistant handles "what is the refund window?" well and falls over on "what are the recurring complaints across all our support tickets?". If you are weighing GraphRAG vs vector RAG, the decision comes down to which of those two kinds of question your users actually ask, and whether the much higher indexing cost is justified. This post explains the difference, what each approach costs, and how to decide.
The claims below come from Microsoft's published GraphRAG paper and documentation, linked inline. They are the authors' own results, so test on your own documents before committing.
Vector RAG splits documents into chunks, embeds them, and at query time returns the chunks closest to the question. The answer has to live in a few passages. See RAG chunking strategy for how those chunks are made.
GraphRAG, as described in the Microsoft paper, uses an LLM in two stages: it extracts an entity knowledge graph from the source documents, then pregenerates summaries for communities of closely related entities. At query time each community summary produces a partial answer, and the partial answers are combined. The GraphRAG documentation lists the indexing steps: split into text units, extract entities, relationships and claims, cluster the graph hierarchically with the Leiden technique, and summarize communities bottom-up.
The GraphRAG paper frames the gap precisely: standard RAG fails on global questions about an entire corpus, its example being "What are the main themes in the dataset?". That is a summarization task over everything, and no single chunk holds the answer. For a class of such questions over datasets of about one million tokens, the authors report "substantial improvements over a conventional RAG baseline for both the comprehensiveness and diversity of generated answers."
The documentation draws the same line: global search is "for reasoning about holistic questions about the corpus", while local search is "for reasoning about specific entities by fanning-out to their neighbors and associated concepts." Questions that follow relationships between entities (which supplier is linked to which contract, which person appears in which incident) are the other natural fit for a graph.
If your failures are instead wrong or missing passages for specific questions, a graph will not help. Fix retrieval first with hybrid search and reranking.
The cost sits at indexing. Every text unit goes through an LLM for entity and relationship extraction, and every community gets an LLM-written summary. Vector indexing needs only an embedding model.
Microsoft's LazyGraphRAG post gives the comparison as ratios rather than dollars: "LazyGraphRAG data indexing costs are identical to vector RAG and 0.1% of the costs of full GraphRAG." LazyGraphRAG avoids the LLM-heavy graph build by using noun-phrase extraction and deferring LLM use to query time. The same post says it suits one-off queries, exploratory analysis and streaming data, while full GraphRAG's entity and community summaries have value as reports in their own right, and vector RAG excels at local queries where the answer resembles the query text.
Two further costs are easy to miss. Indexing repeats whenever documents change, which compounds the issue covered in RAG knowledge base freshness. And switching the embedding model forces a rebuild, as in embedding model migration. For the budgeting habit behind this, see how to reduce LLM API costs.
| Your main question type | Better starting point | Why |
|---|---|---|
| Look up a fact in a specific document | Vector or hybrid RAG | The answer sits in a few chunks |
| "Summarize themes across the whole corpus" | GraphRAG or LazyGraphRAG | Needs corpus-level structure |
| Follow links between entities | GraphRAG (local search) | Relationships are explicit in the graph |
| Corpus changes daily | Vector RAG, or LazyGraphRAG | Cheap to re-index |
| Rare one-off analysis of a document set | LazyGraphRAG | Minimal upfront indexing |
| Need shareable entity and community reports | Full GraphRAG | The summaries are a useful output |
A separate academic comparison, RAG vs GraphRAG, concludes the two have "distinct strengths across different tasks and evaluation perspectives" and explores combining them. That matches the practical advice: it is rarely either/or.
Do not start with a graph. Measure where vector retrieval fails, classify those failures, and add graph structure only for the question types that need it. If you are building a retrieval-backed product and want that measurement and architecture done properly, our AI SaaS service covers it.
Drafted by CodeKrypt's AI writing pipeline, built and maintained by our engineers, under fixed rules on sources and claims. How we write
Long context vs RAG is a size, cost and accuracy decision. When stuffing the whole knowledge base into the prompt works, when it breaks, and how to choose.
How to stop an AI agent infinite loop from burning your LLM budget: step and token budgets, repeated-call detection, wall-clock limits and a per-run kill switch.
A RAG index goes stale the day after launch. How to detect changed and deleted documents, sync incrementally with content hashes, and stop retired policies from being quoted as current.