Advanced Retrieval: GraphRAG & Hybrid · 3 of 5
GraphRAG: Entities & Communities
GraphRAG turns documents into entities and communities so retrieval can answer questions that depend on relationships, not just matching words.
Most search systems begin by asking, “Which passages look similar to this question?” GraphRAG begins with a different question: “What things does this corpus talk about, and how are those things connected?” That shift matters when the answer is scattered across many documents, hidden behind aliases, or depends on how people, products, events, places, and ideas relate to one another.
Start with ordinary RAG
Retrieval-augmented generation, or RAG, is a pattern for grounding a language model in outside information. Instead of asking the model to answer only from what it learned during training, a RAG system first retrieves relevant material from a chosen source, then gives that material to the model as context for the answer.
The usual version of RAG breaks documents into chunks, turns each chunk into a numerical representation called an embedding, stores those embeddings in an index, and retrieves chunks whose embeddings are close to the question. This is powerful because it finds text by meaning, not only by exact keywords.
The weakness is that chunks are still fragments. A question such as “Which suppliers are indirectly affected by this acquisition?” may require linking companies, contracts, subsidiaries, dates, and events across many fragments. Similarity search may find several useful passages, but it does not inherently know that one passage names the parent company, another names a subsidiary, and a third describes the dependency.
What GraphRAG adds
GraphRAG is graph-based retrieval-augmented generation. It still uses language models and retrieval, but it adds a graph: a structure made of nodes and edges. A node represents a thing, and an edge represents a relationship between things.
In a document collection, the nodes are often entities: people, organizations, locations, products, policies, projects, systems, or concepts. The edges describe relationships such as “owns,” “works with,” “mentions,” “depends on,” “competes with,” “located in,” or “caused by.”
This graph becomes another way to retrieve evidence. Instead of only retrieving chunks that look similar to the question, the system can retrieve entities, neighborhoods around those entities, and summaries of groups of related entities. The language model then receives context that is organized by meaning and relationship, not just by textual closeness.
- Text chunks preserve the original wording and local evidence.
- Entities name the important things discussed in the corpus.
- Edges record how those things are connected.
- Communities group related entities into larger themes.
- Summaries turn graph structure into readable context for generation.
Entities are the handles on the world
An entity is a thing the system can point to consistently. In one corpus, “Contoso,” “Contoso Ltd.,” and “the company” may all refer to the same organization. Entity extraction is the process of finding those references and deciding which ones should be treated as the same thing.
Good entity design is not just a technical detail. It decides what the system can reason about. If customer names, contract identifiers, products, and incidents are entities, the graph can support questions about customer exposure, contractual risk, product defects, and incident history. If they are left as undifferentiated text, the system has less structure to work with.
Entities also help with ambiguity. The word “Mercury” could mean a planet, an element, a product, a project, or a company. A graph can separate these meanings by their surrounding relationships: one Mercury orbits the Sun, another appears in a safety policy, and another belongs to a product roadmap.
Relationships turn names into knowledge
A list of entities is useful, but a graph becomes powerful when it captures relationships. “Northwind supplies Fabrikam” is different from “Northwind competes with Fabrikam,” even though the same two organizations appear in both statements. The edge carries the meaning.
Edges can be extracted from sentences, tables, metadata, links, emails, logs, tickets, or domain systems. Some edges are explicit, such as a contract naming a supplier. Others are inferred, such as two incidents sharing the same failing component. In a careful GraphRAG system, inferred edges should be labeled as inferred and supported by evidence.
The graph also provides paths. If Product A depends on Service B, Service B runs in Region C, and Region C has an outage, the path can help retrieve the chain of evidence. The answer still needs citations and caution, but retrieval is no longer blind to the structure of the problem.
- Direct relationships answer simple questions such as “Who owns this service?”
- Multi-hop relationships answer chain questions such as “Which customers depend on the affected vendor?”
- Typed relationships reduce confusion by distinguishing ownership, similarity, dependency, and causation.
- Evidence-backed relationships make the answer auditable.
Communities reveal the shape of the corpus
A community is a group of entities that are more tightly connected to one another than to the rest of the graph. In a news archive, communities might form around elections, companies, regions, or crises. In an enterprise knowledge base, they might form around products, teams, customers, incidents, or regulations.
Community detection is an algorithmic way to find those clusters. The useful part for GraphRAG is not the cluster label by itself; it is the summary that can be produced from the evidence inside the community. A community summary can explain the main entities, recurring relationships, important events, and open tensions within that part of the graph.
This gives GraphRAG a way to answer broad questions. If the user asks, “What are the main risks in our supplier ecosystem?” the system may retrieve several supplier-related communities and their summaries before drilling down into specific contracts and incidents. That is different from hoping a few individual chunks happen to contain the whole picture.
How a GraphRAG answer is assembled
A practical GraphRAG system usually uses both text retrieval and graph retrieval. The question is analyzed to identify possible entities, concepts, and intent. The system then finds matching entities, nearby entities, relevant communities, and original source passages. These pieces are ranked and packed into the model context.
For local questions, the graph may retrieve a small neighborhood: one customer, its contracts, the products it uses, and the incidents tied to those products. For global questions, the system may retrieve community summaries first, then use them to choose which parts of the graph and which documents deserve deeper inspection.
The language model should not be treated as the source of truth. Its job is to compose an answer from retrieved evidence, explain uncertainty, and cite the material it used. The graph helps choose and organize that evidence; it does not remove the need for verification.
Decisions leaders and practitioners must make
GraphRAG is not automatically better than ordinary RAG. It costs more to build, evaluate, operate, and explain. The first decision is whether the use case needs relationship-aware retrieval. If users mostly ask narrow questions answered by one policy paragraph, a simpler RAG system may be the right design.
The second decision is the graph boundary. A small graph may miss important relationships; a broad graph may become noisy, expensive, and hard to govern. Teams need to choose which document collections, metadata sources, business systems, and relationship types belong in the first version.
The third decision is governance. Entity extraction and relationship extraction can expose sensitive links, such as a person connected to a case, customer, health event, or investigation. Access control must apply not only to documents but also to entities, edges, summaries, and generated answers. In Microsoft environments, identity and authorization are commonly anchored in Microsoft Entra ID, but the same principle applies in any platform: retrieved knowledge must respect the user’s permissions.
The fourth decision is evaluation. A GraphRAG system should be tested on questions that require entity resolution, multi-hop reasoning, community-level synthesis, and refusal when evidence is insufficient. Accuracy should include both the final answer and the path of evidence used to support it.
- Start with questions users actually ask, not with the graph technology.
- Define the entity types and relationship types that matter to the domain.
- Keep source evidence attached to extracted entities and edges.
- Apply access control to graph-derived summaries, not only original documents.
- Measure whether the graph improves answers enough to justify its complexity.
Common failure modes
GraphRAG can fail quietly. An extractor may invent a relationship, miss a key alias, or overstate the importance of a weak connection. A community summary may smooth over contradictions. A retrieval step may bring in a persuasive but irrelevant neighborhood of the graph. These are not reasons to avoid GraphRAG, but they are reasons to design it with evidence, inspection, and testing.
One common mistake is treating every co-mention as a meaningful edge. If two companies appear in the same article, they are not necessarily partners, competitors, or counterparties. Another mistake is allowing summaries to drift away from the source text. A summary is useful only if it remains traceable to evidence.
A mature implementation keeps provenance for each entity and edge, records confidence where appropriate, refreshes the graph as sources change, and gives users a way to inspect why an answer was produced. The goal is not a magical knowledge machine. The goal is a retrieval system that makes relationships visible enough to be checked.
Key takeaways
- GraphRAG extends retrieval-augmented generation with a graph of entities and relationships.
- Entities give the system stable handles for people, organizations, places, products, events, and concepts.
- Communities group related entities so broad questions can be answered from synthesized themes, not only isolated chunks.
- The graph improves retrieval when questions require relationships, aliases, multi-hop paths, or corpus-level synthesis.
- GraphRAG adds cost and governance responsibilities, especially around extraction quality, evidence, access control, and evaluation.
- The safest systems keep every important entity, edge, and summary traceable to source evidence.
Glossary
- Retrieval-augmented generation
- A pattern in which a system retrieves relevant external information and gives it to a language model as context for an answer.
- GraphRAG
- Graph-based retrieval-augmented generation that uses entities, relationships, and communities to improve retrieval and grounding.
- Entity
- A distinct thing the system can identify and refer to, such as a person, organization, place, product, event, or concept.
- Edge
- A link in a graph that represents a relationship between two entities.
- Community
- A group of entities that are more strongly connected to each other than to the rest of the graph.
- Embedding
- A numerical representation of text or other data that helps a system compare items by meaning.
- Multi-hop reasoning
- Answering a question by following a chain of two or more connected facts or relationships.
- Provenance
- Information that shows where a claim, entity, relationship, or summary came from.