GraphRAG vs LightRAG: Deep Comparison of Two Engineering Routes for Graph-Enhanced RAG
Systematic comparison of Microsoft GraphRAG (community detection + global summarization) and HKUDS LightRAG (dual-layer graph + incremental update) across index construction, retrieval paradigm, cost structure, query quality, and use cases. Includes a decision tree by data scale, query type, and ops budget.
Traditional vector RAG struggles with "global questions" (e.g., "what topics does this batch of documents cover", "how are different entities related") — it only retrieves semantically similar text chunks and cannot answer queries that span documents, cross entities, or require aggregation. Since 2024, "Graph-Enhanced RAG" (GraphRAG) has become the mainstream route to fill this gap.
This article focuses on the two most representative open-source implementations: Microsoft GraphRAG (open-sourced by Microsoft Research in 2024) and HKUDS LightRAG (open-sourced by HKU in late 2024), with deep comparison across index construction, retrieval paradigm, cost structure, query quality, and operational complexity.
1. Why We Need Graph-Enhanced RAG
Before comparing, understand the problem. The vector RAG pipeline is: documents → chunking → embedding → vector DB → retrieve similar chunks → LLM generation. This paradigm excels at "concrete factual questions" (e.g., "what are the parameters of this function"), but fails on three types of queries:
- Global questions: "What industry risks do these 1000 financial reports mainly discuss?" Requires aggregation across all documents.
- Multi-hop relationships: "What is the relationship between A's CEO and B's CFO?" Requires tracing entity association chains.
- Cross-document associations: "What updates about product X mentioned in document 1 appear in document 2?" Requires cross-document semantic connections.
GraphRAG's core idea: in addition to vector retrieval, build an "entity-relationship" graph that lets LLM do multi-hop reasoning, aggregate queries, and community discovery over the graph. Three mainstream implementation routes:
- Route A: Build a complete knowledge graph (KG-RAG), query with SPARQL / Cypher. Examples: Neo4j LLM Graph Builder, TrustGraph.
- Route B: Overlay a "lightweight graph structure" on top of the vector DB, treating the graph as a "context enhancer". Examples: LightRAG, Graphiti.
- Route C: Use LLM to auto-extract communities + generate hierarchical summaries, treating the "summaries themselves" as retrieval units. Example: Microsoft GraphRAG.
GraphRAG and LightRAG represent Route C and Route B respectively, with vastly different engineering tradeoffs.
2. Index Mechanism: Two Philosophies of Graph Construction
Microsoft GraphRAG: Offline Hierarchical Summarization + Community Detection
GraphRAG's index pipeline is currently the "heaviest":
- Document chunking: Split by tokens (default 300 tokens).
- Entity-relationship extraction: Use LLM (default GPT-4o) to extract entities and relationships from each chunk, output structured triples.
- Graph construction: Treat entities as nodes, relationships as edges, build a homogeneous graph.
- Community detection: Use Leiden algorithm to detect community structures in the graph (similar to social network analysis).
- Hierarchical summarization: Generate multi-level (default 3 levels) natural-language summaries for each community, stored as "community reports".
- Embedding: Embed each community summary and store in the vector DB.
Final output: entity table + relationship table + community summary tree + vector index. Indexing cost is extremely high — 10K tokens of documents consume 5-15x token LLM calls (entity extraction + summary generation), indexing time ranges from tens of minutes to several hours.
LightRAG: Dual-Layer Graph + Incremental Update
LightRAG's design philosophy is "lightweight" — only overlay a minimal graph structure on the vector DB:
- Document chunking: Split by tokens (default 600 tokens).
- Entity-relationship extraction: Use LLM to extract entities and relationships from chunks (similar to GraphRAG).
- Deduplication and merging: Same-named entities extracted across chunks auto-merge, relationship weights accumulate.
- Dual-layer graph construction:
- Entity layer: Nodes are entities, edges are relationships
- Relationship layer: Nodes are relationships, edges are "associations between relationships" (e.g., "same author", "same time")
- Embedding: Entity names, relationship names, chunk text all embedded, stored in vector DB.
- Incremental update: New documents only require extraction and incremental graph merge, no rebuild needed.
Final output: entity-relationship dual-layer graph + vector index. Indexing cost is 50%-70% lower than GraphRAG, incremental update cost is very low (only processes new documents).
Key Differences Table
| Dimension | GraphRAG | LightRAG |
|---|---|---|
| Graph structure | Single-layer entity graph + community tree | Dual-layer graph (entity + relationship layers) |
| Index output | Entities/relationships/community summaries/vectors | Entities/relationships/vectors |
| Index cost (1M tokens) | $30-100 + 30-120 minutes | $10-30 + 10-30 minutes |
| Incremental update | Rebuild required (no native support) | Native support |
| Retrieval unit | Community summaries + chunks | Entities/relationships/chunks |
| Best for queries | Global / thematic | Multi-hop relationship / entity |
3. Retrieval Paradigm: Two "Graph Query" Implementations
GraphRAG: Local Search + Global Search
GraphRAG provides two retrieval modes:
- Local search: Extract entities from query → find neighboring nodes in graph → feed neighbor chunks to LLM. Suits answering "specific entity details".
- Global search: Map query to relevant communities → batch-feed community summaries to LLM → LLM aggregates all summaries to generate answer. Suits answering "global questions".
Global search is GraphRAG's killer feature — it can answer questions vector RAG cannot, like "what does this batch of documents discuss". But the cost: each query requires dozens of LLM calls (batch summarization), high latency, high cost.
LightRAG: Vector Recall + Graph Traversal
LightRAG's retrieval paradigm is closer to "vector-first + graph-enhanced":
- Use query embedding to recall top-K entities and relationships
- Do 1-2 hop traversal on the graph, pull related entities, relationships, chunks together
- Concatenate into context for LLM
This paradigm's advantage: each query only needs 1 LLM call, low latency, low cost. The cost: weaker global question capability — it can do "multi-hop reasoning" but not "whole-graph aggregation".
Query Type Adaptation Matrix
| Query Type | GraphRAG | LightRAG | Pure Vector RAG |
|---|---|---|---|
| Factual ("What is X") | ✅ | ✅ | ✅ |
| Multi-hop relationship | ⚠️ | ✅ | ❌ |
| Global ("What does this batch cover") | ✅ (killer feature) | ⚠️ | ❌ |
| Cross-document association | ⚠️ | ✅ | ❌ |
| Time-sensitive | ❌ | ✅ | ⚠️ |
| Real-time update | ❌ | ✅ | ✅ |
4. Cost and Operations: Key Production Differences
GraphRAG's Cost Pitfalls
GraphRAG's most common production trap is indexing cost runaway:
- Case: A financial company's 500K research reports indexed with GraphRAG cost $18,000 in LLM and 8 hours.
- Mitigation: Use cheaper models for entity extraction (GPT-4o-mini), GPT-4o only for community summaries; parallelize; cache extraction results.
Another common problem is update difficulty: GraphRAG is designed for "one-time offline indexing"; new documents either require full rebuild (extremely expensive) or self-implemented incremental logic (no official support).
LightRAG's Operational Friendliness
LightRAG is significantly more production-engineered:
- Incremental indexing: Built-in
insert()API, new documents incrementally merge into graph, works out of the box. - Multiple storage backends: Supports local JSON, PostgreSQL, Neo4j, MongoDB and more.
- Tunable retrieval parameters: top-K, hop count, similarity threshold all configurable.
- Controllable cost: Default GPT-4o-mini runs well.
5. Query Quality: Benchmark Comparison
Synthesizing multiple public benchmarks and practical experience:
| Dimension | GraphRAG | LightRAG |
|---|---|---|
| Factual QA | 8/10 | 8/10 |
| Multi-hop reasoning | 7/10 | 9/10 |
| Global questions | 10/10 | 5/10 |
| Cross-document association | 6/10 | 8/10 |
| Time-sensitive queries | 4/10 | 8/10 |
| Answer explainability | 8/10 (community path traceable) | 6/10 |
| Retrieval latency (single query) | 5-15s (Global mode) | 0.5-2s |
GraphRAG dominates in scenarios needing "global view", LightRAG dominates in scenarios needing "fast incremental + multi-hop reasoning".
6. Typical Scenario Adaptation
- Enterprise internal KB (10K-level docs): LightRAG, incremental updates + low ops cost + multi-hop relationship queries dominant.
- Legal/compliance doc analysis (millions): GraphRAG, need global questions ("common risk clauses in this batch") + one-time offline index acceptable.
- Research literature library (incremental growth): LightRAG, new papers keep arriving, need incremental indexing + cross-paper entity linking.
- Financial report analysis (one-time deep dive): GraphRAG, global questions ("this quarter's market sentiment") + indexing cost no concern.
- Real-time news Q&A: LightRAG, time-sensitive + incremental updates.
- Cross-entity reasoning (social networks, supply chains): LightRAG, multi-hop relationship + strong graph traversal.
7. Decision Tree
Data scale < 10K chunks → LightRAG (low cost, simple maintenance); 10K-1M → depends on query type. Queries dominated by global/thematic → GraphRAG; by multi-hop/entity → LightRAG. Need incremental updates → LightRAG (only choice). Limited ops budget → LightRAG. Can accept one-time indexing + high LLM cost → GraphRAG. Need fast response (<2s latency) → LightRAG.
8. Common Pitfalls
- GraphRAG is "better" RAG: GraphRAG and vector RAG are complementary, not substitute. Best practice is "vector recall + graph-enhanced" hybrid (LightRAG embodies this idea).
- LightRAG isn't great at global questions: If 30% of your queries are "summarize this batch", don't rely on LightRAG alone.
- GraphRAG community summaries become stale: Once generated, summaries don't update; be cautious with time-sensitive data.
- LightRAG's graph can explode: Without entity dedup and merge, entity count can explode. Configure
entity_mergeparameter. - Both need LLM extraction: LLM-extracted entity quality caps the entire system. Production recommends GPT-4o or Claude Sonnet for extraction.
9. Future Trends
Next breakthroughs for graph-enhanced RAG in three directions:
- Hybrid architecture: Vector recall + graph traversal + knowledge graph SPARQL three-layer hybrid (LightRAG 2.x partially implements).
- Automatic graph maintenance: Use LLM to auto-detect outdated entities, conflicting relationships, low-confidence edges.
- Multimodal graphs: Add images, tables, formulas as nodes.
Final word: there is no "better graph RAG", only "graph RAG more suited to your query distribution". If your queries are "what does this batch cover" → GraphRAG; if "what is the relationship between entity A and entity B" → LightRAG. Best practice combines both: use LightRAG for daily retrieval, use GraphRAG periodically to generate "global insight reports".
Key takeaways
- Microsoft GraphRAG takes the "offline hierarchical summarization + community detection" path — uses an LLM to pre-build entity-relation graphs and community summaries, best for global / cross-document aggregation queries.
- HKUDS LightRAG takes the "dual-layer graph + incremental update" path — fuses entity-relation graphs with vector retrieval, best for fast indexing, low cost, and small-to-medium datasets.
- GraphRAG has significantly higher indexing cost (LLM extraction + summarization per chunk); LightRAG is cheaper but its retrieval quality depends heavily on embedding quality.
- Decision rule — large corpus + "what topics" / "how are entities related" queries → GraphRAG; small-medium corpus + factoid queries → LightRAG.
- The two paths are not mutually exclusive — you can stack GraphRAG-style global summaries on top of LightRAG for hybrid retrieval.
Frequently asked questions
- How much does it cost to index a corpus with GraphRAG?
- It depends heavily on corpus size and LLM choice. A common benchmark — GPT-4o processing 1M tokens of documents through the full GraphRAG pipeline (entity extraction + community detection + summarization) typically needs 30-100M input tokens + 5-15M output tokens, roughly $1k–$3k. LightRAG indexing is about 1/10 to 1/5 the cost of GraphRAG.
- How does LightRAG's incremental update work?
- LightRAG splits the graph into two layers — an entity-level graph and a relation-level graph. When new documents arrive, only the new chunks are extracted and embedded, then incrementally merged into the existing graph — no full re-computation. This is the key difference from GraphRAG, which reruns the entire pipeline on major changes.
- Which supports multimodal content (images, tables)?
- Neither does multimodal extraction natively; you need an OCR / VLM pipeline upstream to convert images and tables into text before feeding GraphRAG / LightRAG. For multimodal corpora, the recommended approach is to use GPT-4o / Claude multimodal capabilities to generate structured text descriptions first, then run the graph indexing pipeline.
- Is GraphRAG suitable for small knowledge bases?
- Not really. GraphRAG's indexing cost and community-detection overhead are designed for large corpora. For under ~100 documents, simple vector RAG + reranker is sufficient; adding GraphRAG only adds cost and latency. LightRAG performs well on small corpora and is the better entry point for graph-augmented RAG.
Projects in this article
GraphRAG
34.5k ⭐A modular graph-based Retrieval-Augmented Generation system by Microsoft that uses LLMs to extract structured knowledge graphs from text, enabling global and local community summarization queries.
LightRAG
37.9k ⭐LightRAG is a simple and fast Retrieval-Augmented Generation framework using graph-enhanced retrieval, published at EMNLP 2025.
Graphiti
29.0k ⭐Graphiti is a temporal knowledge-graph engine for agent memory, helping systems continuously accumulate long-term context.
Cognee
28.8k ⭐A knowledge engine for AI agent memory that builds knowledge graphs and memory layers in 6 lines of code, supporting graph databases, vector stores, and more for knowledge extraction and retrieval.
LLM Graph Builder
5.0k ⭐Extract entities and relations from unstructured text to build a Neo4j knowledge graph.