LightRAG
ActiveDescription
LightRAG is a simple and fast Retrieval-Augmented Generation framework using graph-enhanced retrieval, published at EMNLP 2025.
Key Features
- Graph-enhanced retrieval — Dual-level retrieval (local/global) using knowledge graph entities and relationships, more precise than vector search
- Four text chunking strategies — Fixed, Recursive, Vector, and Paragraph chunking adapted to different document types
- Multi-backend storage — Neo4j, PostgreSQL, MongoDB, OpenSearch, JSON KV Store and other storage backends supported
- Multimodal document processing — RAG-Anything integration for PDF, images, Office docs, tables, and formula parsing
- Role-specific LLM configuration — Four independent roles (EXTRACT, QUERY, KEYWORDS, VLM) with separate LLM settings
- WebUI visualization — Web interface for knowledge insertion, querying, and knowledge graph visualization
Use Cases
Categories
Quick Start
```bash
pip install lightrag-hku
python -c "
import lightrag
from lightrag import LightRAG
rag = LightRAG(work_dir='./lightrag_work')
with open('input.txt', 'r') as f:
text = f.read()
rag.ainsert(text)
result = rag.aquery('What is the main topic?')
print(result)
"
```