Simple and Fast Retrieval-Augmented Generation
open sourceMITself-hostablefree
LightRAG is an MIT-licensed graph RAG framework from the Data Intelligence Lab at the University of Hong Kong (EMNLP 2025) that indexes documents into both a knowledge graph of entities and relations and vector embeddings, and answers with dual-level retrieval in five query modes (local, global, hybrid, naive and the default mix). Its makers present it as a lighter alternative to Microsoft GraphRAG: it skips community reports, which they say cuts the LLM calls needed for indexing and querying, but it still runs one LLM extraction call per text chunk, so indexing isn't LLM-free. Documents can be added incrementally and deleted selectively, rebuilding affected entities from the extraction cache. It runs as a Python library or as LightRAG Server, with a web UI for documents, graph exploration and queries, a REST API and an Ollama-compatible chat API for clients such as Open WebUI, on storage from in-memory files to PostgreSQL, MongoDB, OpenSearch, Neo4j, Memgraph, Milvus or Qdrant, and parses PDFs, Office files, images and tables through MinerU, Docling or its own parser.
Problems it solves
- graph-based RAG over our documents without generating community summary reports for every cluster
- add new documents to a knowledge graph index incrementally instead of re-indexing the whole corpus
- delete one document from a graph RAG index and have its entities and relations cleaned up
- answer both detail questions about one entity and broad cross-document questions from the same index
- self-hosted RAG server with a web UI to upload documents, browse the extracted graph and ask questions
- use a cheap non-reasoning model for entity extraction and a stronger one only for writing answers
- plug a graph RAG knowledge base into Open WebUI as if it were an Ollama model
- run entity extraction, embeddings and reranking locally with Qwen, bge-m3 and bge-reranker on our own GPUs
- store the graph, vectors and documents for a RAG system in one PostgreSQL database
- RAG over manuals and papers where images, tables and formulas need to be connected to the text
- keep separate isolated knowledge bases for different teams on one RAG server
- evaluate graph RAG answers with RAGAS and trace queries in Langfuse
Features
- dual-level retrieval over a knowledge graph and vector embeddings
- query modes: local, global, hybrid, naive and mix (default), with optional reranking
- no community reports: fewer LLM calls than GraphRAG at index and query time, per its README
- incremental inserts and selective deletion, rebuilding affected entities from the LLM cache
- role-specific models: extraction, query, keyword and vision LLMs configured separately
- LightRAG Server: web UI (admin console and query-only workspace), REST API and Ollama-compatible chat API
- storage: JSON/NanoVectorDB/NetworkX/Faiss files, PostgreSQL, MongoDB, OpenSearch, Redis, Neo4j, Memgraph, Milvus, Qdrant
- document parsing with MinerU, Docling or the native parser; images, tables and formulas linked into the graph
- workspaces for isolated knowledge bases
- authentication with API keys or accounts
View 2 more
- RAGAS evaluation and Langfuse tracing
- setup wizard and Docker Compose for local embedding, reranking and storage services
Limitations
- Doesn't build its knowledge graph without an LLM: entity and relation extraction makes one LLM call per text chunk1
- Doesn't suit production on its default storage: the in-memory JSON, NanoVectorDB and NetworkX stores are for testing only1
- Doesn't secure its server by default: lightrag-server listens on all interfaces with authentication off1
Capabilities
| Has an API | plan not known |
|---|
Alternatives
The same job
These do what LightRAG does.
- GraphRAG A modular graph-based Retrieval-Augmented Generation (RAG) system
- R2R Agentic Retrieval-Augmented Generation (RAG) with a RESTful API
- Graphiti Build real-time knowledge graphs for AI agents
- Cognee The open-source AI memory platform for agents
- LlamaIndex A Python toolkit for building LLM-powered agents over your data
