LightRAG

RAG & Memory 💻 Python ⚖️ MIT 🟢 Actively maintained
39.4k stars

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?

🎬 LightRAG: A More Efficient Solution than GraphRAG for RAG Systems? · Prompt Engineering

LightRAG demo
🎞️ Demo from the project README

✨ 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
Install LightRAG Server as tool using uv (recommended)
uv tool install "lightrag-hku[api]"
Setup env file
cp env.example .env  # Update the .env with your LLM and embedding configurations
Launch the server. It binds to all interfaces (0.0.0.0) by default.
lightrag-server
  • Installation from Source
git clone https://github.com/HKUDS/LightRAG.git
cd LightRAG
Bootstrap the development environment (recommended)
make dev
source .venv/bin/activate  # Activate the virtual environment (Linux/macOS)
Build front-end artifacts
cd lightrag_webui
bun install --frozen-lockfile
bun run build
cd ..
setup env file
make env-base  # Or: cp env.example .env and update it manually
Launch API-WebUI server
lightrag-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

Stars★ 39,418
Forks🍴 5,547
Open issues🐛 225
Last commit🕒 Sep 4, 2026
Created📅 Oct 2024
Language💻 Python
License⚖️ MIT

🤖 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.