
LightRAG
Simple, fast graph-based RAG with dual-level retrieval.
About
LightRAG is a retrieval-augmented generation framework built on knowledge graphs: documents are incrementally parsed into entity/relation graphs, and queries retrieve at two levels — low-level (specific entities) and high-level (thematic) — blending graph and vector retrieval. That design beats naive chunk-retrieval on complex, multi-hop questions while staying simpler to operate than heavier graph-RAG stacks. 40k GitHub stars, MIT, paper-backed (arXiv 2410.05779), PyPI package lightrag-hku. The tradeoff: building the graph costs LLM calls per document, so indexing large corpora is pricier than plain vector RAG.
What it can do
- **Dual-level retrieval**: low-level entity + high-level thematic queries
- **Incremental graphs**: knowledge graph built and updated as documents arrive
- **Hybrid search**: graph traversal blended with vector similarity
- **Multi-hop QA**: designed for questions spanning many documents
- **Paper-backed**: arXiv 2410.05779 with published benchmarks
Setup
```bash
pip install lightrag-hku
```
```python
from lightrag import LightRAG, QueryParam
from lightrag.llm.openai import gpt_4o_mini_complete
rag = LightRAG(working_dir="./rag", llm_model_func=gpt_4o_mini_complete)
rag.insert("LightRAG is a graph-based RAG framework.")
print(rag.query("What is LightRAG?", param=QueryParam(mode="hybrid")))
```
Needs LLM + embedding API keys. Docs in the repo.
Prerequisites
Python 3.10+. LLM and embedding provider API keys (indexing uses LLM calls).
Use cases
Works with
Trust score — 9/10
Scored 9/10 (verified tier, metrics-v1). Evidence: 40,090 GitHub stars (log-scaled vs catalog peers); blended with ~122,085 monthly package downloads; last push 1d ago; 29 releases/12mo; 337 open issues. Manual review: standout graph-RAG (dual-level retrieval, incremental graphs), 40k stars, paper-backed; graph indexing costs LLM calls per document — pricey at scale. License: MIT.
★ 40,090 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 8.3/10
- Maintenance · recency, releases, issue load
- 9.7/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 9.0/10
- · 40,090 GitHub stars (log-scaled vs catalog peers)
- · blended with ~122,085 monthly package downloads
- · last push 1d ago; 29 releases/12mo; 337 open issues
- · manual review: standout graph-RAG (dual-level retrieval, incremental graphs), 40k stars, paper-backed; graph indexing costs LLM calls per document — pricey at scale
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.