LightRAG: Simple and Fast Retrieval-Augmented Generation
LightRAG is a lightweight approach to retrieval-augmented generation that aims to combine the depth of knowledge-graph-based retrieval with the speed and low cost of vector retrieval.
The Dilemma of Existing RAG Systems
- Traditional RAG: Uses simple vector retrieval — low cost and fast, but answers are often fragmented and cannot capture complex relationships.
- GraphRAG: Understands complex relationships in data, but is expensive to build, hard to update, and slow at retrieval.
- Low-level retrieval: Focuses on entity attributes and direct relations, precisely retrieving information about specific nodes or edges.
- High-level retrieval: Aggregates global themes across entities, providing insight into higher-level concepts and summaries.
- Retrieval cost reduced by ~99% while maintaining high-quality answer generation.
- Incremental updates, suited to dynamic data environments.
- Dual-level retrieval balancing detail and global information.
- Outperforms existing methods across multiple evaluation dimensions.
- Dynamic data environments
- High-efficiency retrieval needs
- Cross-domain comprehensive queries
- Intelligent customer service systems
- Enterprise knowledge management
- Academic research assistance
Core Idea
Rather than building a large, bloated knowledge graph, LightRAG uses a cleverer, more economical design so the system has both graph-level depth and vector-search speed.
Dual-Level Retrieval
Architecture
1. Entity and relation extraction: An LLM extracts entities (nodes) and relations (edges) from text chunks. 2. LLM-generated key-value pairs: Each entity and relation gets a text key-value pair — the key serves as a retrieval index term, the value is a summary text. 3. Graph deduplication: Identical entities and relations across chunks are merged to reduce graph size. 4. Incremental updates: New documents are processed independently and merged into the main graph — no full index rebuild required.
LightRAG vs GraphRAG
| Dimension | LightRAG | GraphRAG | |---|---|---| | Retrieval cost | Extremely low (< 100 tokens) | High (610,000 tokens) | | Update method | Incremental | Full rebuild | | Retrieval speed | Fast | Slow | | Answer diversity | High (76.4% vs 23.6%) | Low | | Answer comprehensiveness | High (83.6% vs 16.4%) | Low |