← Back to Leaderboard
LHKUDS

HKUDS/LightRAG

Graph-backed RAG for cross-document retrieval and multimodal indexing

Engineering Health (Methodology)
A+ · 100/100
Maintenance Activity
● Updated today
Latest Release
v1.5.8
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption25/25
Release Cadence20/20
License Clarity20/20
DockerSelf-HostedAPI1 README badge views (30d)
Total Stars
★ 41,022
24h Growth
+7
7d Growth
+110
Forks
5,859

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

HKUDS/LightRAG Star History (2024-10-08 - 2026-12-04) ALL-TIME STAR HISTORY (2024-10 – 2026-12) +41k in 787d · avg +52/day 43.3k 21.7k 0 2024-10-08: ★ 12024-11-30: ★ 8,4752025-01-18: ★ 10,7922025-03-08: ★ 12,1962025-04-26: ★ 15,2332025-06-14: ★ 16,9532025-08-02: ★ 18,5442025-09-20: ★ 20,5832025-11-08: ★ 22,0072025-12-27: ★ 26,2272026-02-14: ★ 27,8372026-04-04: ★ 31,6782026-05-23: ★ 35,2312026-07-11: ★ 37,2442026-08-29: ★ 39,0392026-10-17: ★ 40,0762026-12-04: ★ 41,022 ★ 41k 2024-10 2025-11 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

LightRAG is a graph-backed RAG pipeline, not a standalone vector database. Ingestion parses and chunks documents, uses an LLM to extract entities and relationships, and embeds chunks, entities, and relationships for retrieval. At query time, dual-level retrieval brings together specific facts and broader concepts. The answer model receives graph and text context without requiring precomputed community reports or a multi-hop reasoning workflow.

The Python 3.11+ project is packaged as lightrag-hku with setuptools; visible dependencies include aiohttp and google-api-core. The Python core can be embedded in an application, while lightrag-server exposes the REST API and WebUI. Parser rules select among Native, MinerU, and Docling, with support for additional parsers. Storage can start with local files; OpenSearch is available as a unified backend.

Key Capabilities & Differentiators

The v1.5 pipeline connects images, tables, and formulas to their surrounding text through the knowledge graph, making those elements available during retrieval rather than relying on prose alone. Native handles these elements in Word and Markdown documents; MinerU and Docling provide other parsing paths. Image analysis can be enabled with VLM_PROCESS_ENABLE and a configured VLM_LLM_MODEL. Chunking can use fixed, recursive, vector, paragraph, or custom strategies.

The EXTRACT, QUERY, KEYWORDS, and VLM roles are configured independently, so a faster extraction model can handle every chunk without constraining the answer model. Mixed retrieval supports reranking, and the API can return retrieved context for RAGAS evaluation. Deleting a document can trigger reconstruction of affected entities and relationships from cached LLM outputs, preserving information still supported by other documents.

Trade-offs & Limitations

A chunk-only vector pipeline is simpler to ingest and operate. LightRAG adds LLM extraction for every chunk, graph maintenance, and sensitivity to extraction quality. That work is most defensible when representative queries need to link entities or concepts across documents. Compare against a chunk-only baseline on the same corpus and query set, measuring retrieval relevance, ingestion cost, and query latency rather than assuming a graph will improve all three.

Pinecone is a managed vector-search option, not a like-for-like replacement for LightRAG's parsing and graph workflow. NotebookLM is a finished document assistant, whereas LightRAG is an application component you operate. A hosted-model pilot keeps local compute modest but introduces provider latency, quota, and data-handling constraints. Local models give you more control over data placement while shifting capacity planning to your team. Keep the embedding model consistent from indexing to querying; a model change requires re-embedding, even when the output dimension is unchanged.

Hardware & Deployment Guide

For a Python install, uv tool install "lightrag-hku[api]" provides the server and prebuilt WebUI. A source install uses uv sync --extra api; building the UI from source also requires Bun. With Docker Compose, edit .env before docker compose up. The service defaults to port 9621 and mounts persistent storage and inputs at /app/data/rag_storage and /app/data/inputs. File-based storage avoids a separate database for a pilot. Offline deployments must stage dependencies and caches and provide local endpoints for any models or parsers otherwise called remotely.

Before network exposure, bind to 127.0.0.1 or a private interface, or configure LIGHTRAG_API_KEY or AUTH_ACCOUNTS with TOKEN_SECRET: the default bind is 0.0.0.0 with authentication off. For production, pin the image rather than relying on latest. v1.5.8 adds configuration storage and records which embedding model built the vectors. That is groundwork for account and permission management, not evidence that granular permissions are available. Test upgrades on a copy of persisted data.

Retrieval: Dual-level entity and relationship retrieval combines detailed facts with broader context; mixed queries can use a reranker.
Multimodal ingestion: Native, MinerU, and Docling parsing paths feed a graph that connects images, tables, and formulas to surrounding text.
Document lifecycle: Incremental ingestion and selective deletion can rebuild affected entities and relationships from cached indexing outputs.
Model routing: EXTRACT, QUERY, KEYWORDS, and VLM roles are independently configurable, so indexing and answer generation need not use the same model.
Evaluation: The API can return retrieved context for RAGAS evaluation, with Langfuse integration for tracing.
Embedding migration: v1.5.8 introduces configuration storage; lightrag-rebuild-vdb rebuilds vectors when switching embedding models.
Best For

Teams building an internal knowledge API over changing, relationship-rich collections such as manuals or research papers, where cross-document questions and selective updates matter.

Skip If

Chunk-level semantic search already meets your needs, or you want a finished document assistant without operating parsers, model endpoints, and a graph index.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedAPI
# Install LightRAG Server as a tool using uv (recommended)
uv tool install "lightrag-hku[api]"

# Or using pip inside a virtual environment
# python -m venv .venv
# source .venv/bin/activate  # Windows: .venv\Scripts\activate
# pip install "lightrag-hku[api]"

# Get the configuration template and edit it (see "Minimum .env Changes" below)
curl -O https://raw.githubusercontent.com/HKUDS/LightRAG/main/env.example
cp env.example .env

lightrag-server

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
LightRAG ★41k+110PythonMITGraph-backed RAG for cross-document retrieval and multimodal indexing
txtai13.8k+33PythonApache-2.0A Python embeddings database for vector, SQL, and graph retrieval in self-hosted
zvec16.3k+29C++Apache-2.0In-process C++ vector database for local hybrid retrieval
qdrant35.9k+135RustApache-2.0Rust vector database for filtered and hybrid RAG retrieval

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/HKUDS/LightRAG.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

HKUDS/LightRAG Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about LightRAG

How do I integrate LightRAG into an existing application?

Use the Python core when the application owns ingestion and retrieval, or run lightrag-server for a REST API and WebUI. On the default port, /docs exposes interactive API documentation and /webui opens the UI. Configure the embedding model before ingestion and keep the same model for queries. To switch later, use lightrag-rebuild-vdb to regenerate vectors for chunks, entities, and relationships.

Do I need a GPU, and how should I size the server?

A pilot using hosted models and file-based storage does not require a local GPU for model inference. Size the server for parsing, indexing, storage, and concurrent requests. If you host extraction, embedding, or vision models locally, size accelerators separately for the chosen models, context lengths, batches, and concurrency. Measure ingestion throughput and query latency separately before sizing production.

Can I use LightRAG commercially and keep document processing on premises?

The repository is MIT-licensed, which permits commercial self-hosting subject to the license's notice requirements when distributing copies. Review third-party model, parser, and provider terms separately. Self-hosting the API does not keep documents on premises if a model or parsing endpoint is external; verify where text, images, and embeddings are processed.

When should I choose LightRAG over Pinecone or NotebookLM?

Choose Pinecone if managed vector storage and search are the primary requirement. Choose NotebookLM if users need a finished document assistant rather than an infrastructure component. Choose LightRAG if the application needs to control parsing, entity and relationship indexing, retrieval, and document updates. Validate that the graph improves retrieval on representative cross-document questions before taking on the extra indexing and operations work.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining HKUDS/LightRAG? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature HKUDS/LightRAG on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare