Repo of the Day
HKUDS/LightRAG
Published: May 26, 2025
Open repository ↗LightRAG: Simple and Fast Retrieval-Augmented Generation
Summary
LightRAG is a Python RAG framework that combines a knowledge graph with vector retrieval, positioned in the README as a lightweight alternative to Microsoft GraphRAG. It targets scenarios where traditional chunk-based RAG loses context across entities, and it ships with a server, WebUI, REST API, and multiple storage backends. The project is published under the MIT license and the paper is associated with EMNLP2025.
What it is useful for
LightRAG is built for engineers who need retrieval that preserves relationships across documents, not just nearest-neighbor text matches. The README describes its dual-level retrieval as handling both detailed facts (local context) and abstract cross-document themes (global context), with five query modes to choose from: local, global, hybrid, naive, and mix. A mix query pulls from local, global, and vector retrieval simultaneously, which is the kind of setting where a single-mode RAG pipeline tends to miss.
It also covers the parts teams usually bolt on later: multimodal document parsing via MinerU or Docling for PDFs, images, tables, and formulas; four text chunking strategies (Fixed, Recursive, Vector, Paragraph-semantic); RAGAS evaluation and Langfuse tracing; rerankers; citations; and document deletion that regenerates the affected graph. For LLM configuration, it separates four roles — EXTRACT, QUERY, KEYWORDS, and VLM — so you can run a cheap model for extraction and a stronger one for the final answer.
Documented limitations worth knowing: the default KV, vector, and graph stores are in-memory with local file persistence and are explicitly called out as "suitable only for small-scale testing and evaluation, not for production"; PostgreSQL is the recommended production backend. SVG rasterization needs the system library libcairo beyond the Python package, and the smart_heading Word feature needs extra spaCy model downloads via lightrag-download-cache --spacy-install.
How engineers can use it
The README documents three install paths. The fastest is the published PyPI package, which the README spells out as uv tool install "lightrag-hku[api]" (or pip install "lightrag-hku[api]" in a venv), followed by copying env.example to .env and configuring your LLM and embedding credentials before running lightrag-server. A second path uses the setup wizard (make env-base, then optionally make env-storage and make env-server) to generate a configured .env interactively. The third path is docker compose up after cloning the repo and editing .env. Setup details, model role guidance, and Docker verification steps live in the linked docs under docs/, so defer to those for anything not covered above.