Traditional RAG uses vector similarity to find specific text snippets. If a user asks a global question like, 'What are the common themes among all the product complaints last quarter?', standard RAG fails because no single text chunk contains that summary. GraphRAG (Knowledge Graph Retrieval-Augmented Generation), popularized by Microsoft Research, solves this by running an LLM over the entire dataset during the ingestion phase. It extracts 'entities' (e.g., Product X, Bug Y) and their 'relationships' (e.g., 'causes'), constructing a massive network graph. When the user queries the system, it traverses this graph to pull in connected nodes, enabling true multi-hop reasoning and holistic summarization.

How It Works

  • Indexing Phase: An LLM processes the source documents and extracts structured nodes (Entities) and edges (Relationships).
  • Community Detection: The graph is clustered into hierarchical 'communities' based on closely related nodes.
  • Pre-Summarization: The LLM generates a summary for each community ahead of time.
  • Retrieval Phase: When a query is made, the system matches it to the relevant community summaries and graph nodes, passing a holistic, interconnected context to the final LLM.

Common Use Cases

  • Answering 'sensemaking' questions that require connecting dots across hundreds of documents.
  • Enterprise search where relationships between employees, projects, and codebases are more important than exact keyword matches.

Related Terms