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
- Entity Extraction: LLM extracts entities and relationships from documents
- Graph Construction: Build a knowledge graph connecting entities
- Community Detection: Group related entities into hierarchical clusters
- Query Processing: Route queries to appropriate graph communities
- 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