LightRAG
LightRAG is a lightweight, graph-based retrieval-augmented generation (RAG) framework that combines knowledge graphs and vector embeddings for efficient and high-quality retrieval. It solves the problems of high computational overhead, slow response times, and costly incremental updates in large-scale graph-based RAG systems. It is designed for developers building RAG applications that require deep contextual understanding, especially in vertical domains like legal and financial.
🎬 LightRAG: A More Efficient Solution than GraphRAG for RAG Systems? · Prompt Engineering
✨ Key features
- Dual-layer architecture combining knowledge graphs and vector embeddings
- Deep contextual understanding via graph-structured indexing
- Dual-level retrieval mechanism for comprehensive and diverse results
- Extreme retrieval efficiency with reduced LLM calls and low cost
- Incremental updates and selective deletion with automatic KG regeneration
- Multiple document parsing engines (MinerU, Docling, Native) and text chunking strategies
🎯 Use cases
- Build RAG applications for legal or financial domains requiring global comprehension
- Handle complex cross-document queries with high comprehensiveness and diversity
- Deploy scalable RAG systems with incremental updates in dynamic data environments
- Process multimodal documents (PDFs, images, Office) with integrated RAG-Anything
📦 Installation
🧰 Requirements: Python environment; LLM and embedding API keys required; optional storage backends (e.g., Neo4J, MongoDB, PostgreSQL) and Docker for local deployment.
Install LightRAG Server
- Install from PyPI
uv tool install "lightrag-hku[api]"cp env.example .env # Update the .env with your LLM and embedding configurationslightrag-server- Installation from Source
git clone https://github.com/HKUDS/LightRAG.git
cd LightRAGmake dev
source .venv/bin/activate # Activate the virtual environment (Linux/macOS)cd lightrag_webui
bun install --frozen-lockfile
bun run build
cd ..make env-base # Or: cp env.example .env and update it manuallylightrag-server- Launching the LightRAG Server with Docker Compose
git clone https://github.com/HKUDS/LightRAG.git
cd LightRAG
cp env.example .env # Update the .env with your LLM and embedding configurations
# modify LLM
🚀 Usage
After installation and configuration, start the server with lightrag-server. Then use the API to insert documents and query. For a minimal example, see the README's API usage section (not provided in full).
❓ FAQ
What is LightRAG?
LightRAG is a lightweight, graph-based RAG framework that combines knowledge graphs and vector embeddings for efficient retrieval and generation.
How do I install LightRAG?
You can install it via uv tool install "lightrag-hku[api]" or from source by cloning the repository and running make dev.
What storage backends are supported?
LightRAG supports multiple storage backends including Neo4J, MongoDB, PostgreSQL, and OpenSearch, among others.
Does LightRAG support multimodal documents?
Yes, through integration with RAG-Anything, it can process PDFs, images, Office documents, tables, and formulas.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.