LightRAG Algorithm
The Problem with Traditional RAG
User Query → Vector Search → Chunks → LLMHow LightRAG Solves This
Documents → Entity Extraction → Knowledge Graph
↓
User Query → Keyword Extraction → Graph Traversal → ResultsThe 5 Query Modes
1. Naive Mode (The Speed Reader)
2. Local Mode (The Specialist)
3. Global Mode (The Connector)
4. Hybrid Mode (The Balanced Approach)
5. Mix Mode (The Expert) 🌟
Query Mode Comparison
Mode
Speed
Accuracy
Use Case
Graph Used
Keyword Extraction: Dual-Level Approach
High-Level Keywords
Low-Level Keywords
Why Two Levels?
Token Reduction: Why LightRAG is Efficient
Traditional RAG
LightRAG (Local Mode)
How?
Real-World Example
Naive Mode
Local Mode
Global Mode
Hybrid Mode
Mix Mode
When to Use Each Mode
Use Naive Mode When:
Use Local Mode When:
Use Global Mode When:
Use Hybrid Mode When:
Use Mix Mode When:
Performance Tuning
Next Steps
Last updated
Was this helpful?