Back to Glossary
RAG

GraphRAG

Definition

GraphRAG enhances traditional RAG by building a knowledge graph from documents, enabling retrieval of relationships and multi-hop reasoning that vector similarity search alone cannot capture.

Why It Matters

Traditional RAG finds documents similar to a query but struggles with questions requiring synthesis across multiple documents or understanding relationships. GraphRAG extracts entities and relationships into a knowledge graph, enabling queries like β€œHow do these two concepts relate?” or β€œWhat are all the factors affecting X?”

How It Works

  1. Entity Extraction: LLM extracts entities and relationships from documents
  2. Graph Construction: Build a knowledge graph connecting entities
  3. Community Detection: Group related entities into hierarchical clusters
  4. Query Processing: Route queries to appropriate graph communities
  5. Summarization: Generate answers using graph structure and summaries

When to Use

GraphRAG excels for: complex queries requiring multiple documents, questions about relationships and connections, summarization of large document collections, and exploratory questions without specific keywords. For simple factual lookups, traditional RAG is faster and cheaper.

Source

GraphRAG uses LLM-generated knowledge graphs to enable global understanding of document collections for retrieval and reasoning.

https://arxiv.org/abs/2404.16130