Graph-Enhanced RAG: Local and Global Retrieval Strategies
Graph-enhanced retrieval-augmented generation combines entity-centered retrieval with community-level summarization to address both focused factual questions and dataset-wide analysis. This article explains how local and global retrieval share a multilayer graph index, how each builds context for generation, and which engineering considerations matter for evidence quality, token budgets, and evaluation.
Graph-Enhanced RAG: Local and Global Retrieval Strategies
Retrieval-augmented generation (RAG) has become an important approach to building large language model applications. However, as knowledge bases grow and questions become more complex, the limitations of conventional text chunking and vector retrieval become clearer. These systems are effective at finding local facts, but less suited to questions that require synthesis across documents. They can retrieve similar passages, yet lack explicit relationships and connected evidence.
Graph-enhanced RAG organizes entities, relationships, claims, community summaries, and source evidence into a multilayer index. It then uses two retrieval paths for different question types: local retrieval and global retrieval. This article examines how these paths work, what they contribute, and the practical considerations involved in implementing them.
1. Why RAG Needs Two Retrieval Modes
Traditional RAG typically splits documents into chunks and creates a vector index over them. At query time, it retrieves the top-K chunks and combines them into context for the model.
This approach works well for focused questions. For example, a question about a character’s personality in a novel may be answered by retrieving passages about that character. But broader questions—such as the novel’s central conflict or the main risks discussed in a report—often require more than a few similar passages. The answer may depend on information across chapters, multiple entity relationships, and themes spanning different communities.
Graph-enhanced RAG therefore distinguishes between two retrieval modes:
- Local retrieval and generation: Targets specific entities or local facts within a dataset. It gathers community reports, relationships, claims, and source evidence around entities matched to the query, creating focused context.
- Global retrieval and generation: Targets questions about the dataset as a whole. It selects, synthesizes, and aggregates precomputed hierarchical community summaries to produce a broader answer.
Both modes use the same graph index, but they construct context differently. This distinction underpins the retrieval strategies described below.
2. Local Retrieval: Gathering Evidence Around Entities
Local retrieval answers focused questions. Its workflow has two stages: retrieval and generation.
During retrieval, the system embeds the query and maps it to relevant entities, collects conversation history, and retrieves associated community reports, relationships, claims, and source chunks. During generation, it arranges these results within a context budget and passes them to the language model.
2.1 Mapping Queries to Entities
The first step is not to retrieve source text directly, but to map the query to graph entities. The system embeds the user’s query and performs similarity search against entity-description embeddings to obtain candidate entities.
To improve recall, it typically retrieves more candidates than it needs, then applies constraints such as included or excluded entity names before retaining the top-K entities.
This creates an entity-centered retrieval process. Rather than relying solely on matching text chunks, the system anchors the question to structured graph nodes. Community reports, relationships, claims, and original passages can then be retrieved around those nodes.
Entity disambiguation and alias normalization are important during indexing. Different names for the same character, or abbreviated and full names for the same organization, should be consolidated where possible or connected through alias relationships.
The following pseudocode illustrates the process:
function local_retrieve(query, history):q_vec = embed(query)candidates = vector_search(q_vec, entity_index, top_k = K * oversample)entities = filter_and_rank(candidates, include_names, exclude_names, top_k = K)history_ctx = build_history(history, max_turns, token_budget)reports = []for e in entities:reports += community_reports_for(e)relations = relations_for(entities)claims = claims_for(entities)chunks = source_chunks_for(entities)return build_context(history_ctx, entities, reports, relations, claims, chunks)
2.2 Conversation History and Context Budgets
In a multi-turn conversation, local retrieval also needs relevant dialogue history. Systems may retain only user turns or limit history to a maximum number of turns, while enforcing a token budget.
History helps resolve references and omitted details. A follow-up such as “What about its rival?” depends on the entity discussed in the previous turn.
Rather than appending the entire conversation, implementations should trim history according to relevance, recency, and the available token budget. Otherwise, conversation history can crowd out the evidence needed to answer the current question.
2.3 Community Reports, Relationships, Claims, and Source Text
After identifying relevant entities, the system expands retrieval to include several complementary information types:
- Community reports: Summaries of the communities to which the entities belong, providing context broader than an individual entity.
- Relationships and claims: Connections between entities and factual assertions extracted from source text, providing structured factual constraints.
- Source chunks: Original passages associated with the entities, providing traceable evidence.
Each serves a distinct purpose: community reports supply background, relationships and claims supply structure, and source passages supply evidence.
During generation, the system arranges these materials by priority and token budget to provide sufficient information without excessive redundancy. The contribution is not simply retrieving more content. It is using entities as indexing anchors to organize summaries, structured facts, and original text into an interpretable evidence set.
3. Global Retrieval: Answering Broad Questions with Hierarchical Community Summaries
Global retrieval addresses dataset-wide questions. Entity-by-entity retrieval is often unsuitable because the information needed for an answer is distributed across multiple communities.
During indexing, the system identifies community structure in the entity graph and generates community reports at multiple levels. At query time, it selects a suitable level of summaries, generates partial answers from individual reports, and combines those answers into a final response.
This can be understood as a summary index followed by aggregated generation:
function global_retrieve(query):reports = select_community_reports(level, token_budget)partial_answers = []for r in reports:partial_answers.append(llm_summarize(query, r))final = llm_reduce(query, partial_answers)return final
The hierarchy is central to this approach. Lower-level communities are more detailed and suited to narrower themes. Higher-level communities are broader and suited to overall synthesis.
The system can choose a level based on the breadth of the question and the token budget, rather than placing too many reports into a single context. During aggregation, it must address duplication, conflicting information, and gaps in coverage across community reports. The final answer should also preserve references to supporting evidence.
This approach gives the model access to a broader view of the dataset while reducing the noise associated with overly large contexts.
4. Key Technical Advances
From a Flat Chunk Index to a Structured Graph Index
Entities, relationships, claims, community reports, and source chunks form a multilayer index. Retrieval no longer depends exclusively on text similarity; it can also expand evidence through entity relationships.
Separate Retrieval Paths for Different Question Types
Local retrieval handles specific entity questions, while global retrieval handles dataset-wide questions. This avoids forcing a single retrieval strategy to serve every type of query.
Hierarchical Community Summaries for Global Synthesis
Multilevel community reports organize knowledge at different granularities. Aggregating answers across these reports complements the local retrieval capabilities of conventional RAG.
Combining Structured Facts with Source Evidence
Relationships and claims provide factual constraints, original passages provide verifiable evidence, and community reports provide background. Combining them supports more complete and interpretable answers.
Context Assembly and Budget Control
More retrieved content is not always better. Context must be organized according to entity relevance, information type, token limits, and deduplication rules. Implementations need mechanisms for ranking, deduplication, truncation, and reference preservation.
5. Engineering Considerations
Practical implementations should pay particular attention to:
- Entity recognition and disambiguation quality.
- Community granularity and summary quality.
- Recall when searching entity-description embeddings.
- Confidence filtering for relationships and claims.
- The accuracy of links between entities and source chunks.
- Trimming strategies for multi-turn conversation history.
- Reference preservation and conflict handling during generation.
Evaluation should cover local factual questions, global synthesis questions, reference resolution in multi-turn conversations, and evidence traceability. A single accuracy metric is not enough to assess all of these capabilities.
Local and global retrieval in graph-enhanced RAG are not simply two retrieval methods added together. They reorganize retrieval around the way knowledge is structured: local retrieval gathers evidence around entities, while global retrieval synthesizes information around community summaries.
Together, these approaches help balance focused question answering with broader analysis and provide a reusable technical framework for building interpretable, maintainable question-answering systems.
