HKUDS /LightRAG
[EMNLP2025] LightRAG: Simple and Fast Retrieval-Augmented Generation
★ 40,636⑂ 5,770👁 285⑃ 2,477● 1,676▤ 83◈ 132
40,636
stars
+15
5,770
forks
285
watchers
2,477
prs
1,676
issues
83
releases
132
discussions
README
🚀 LightRAG: 简单且快速的检索增强生成(RAG)框架
---
---
🎉 新闻
- [2026.07]🎯[新功能]: 添加 Word 文档 智能章节标题 识别功能。
- [2026.05]🎯[新功能]:将 RagAnything 合并至 LightRAG🎉。支持通过 MinerU / Docling 服务进行多模态内容解析与提取。
- [2026.05]🎯[新功能]:引入四种可选的文本分块策略:Fix(固定)、Recursive(递归)、Vector(向量)和 Paragraph(段落语义)。
- [2026.05]🎯[新功能]:支持按角色配置 LLM,提供四个独立角色:EXTRACT、QUERY、KEYWORDS 和 VLM,每个角色拥有独立的 LLM 设置。
- [2026.03]🎯[新功能]: 集成了 OpenSearch 作为统一存储后端,为 LightRAG 的全部四种存储类型提供全面支持。
- [2026.03]🎯[新功能]: 推出交互式安装向导,支持通过 Docker 在本地部署 Embedding、Reranking 及存储后端服务。
- [2025.11]🎯[新功能]: 集成了 RAGAS 评估和 Langfuse 追踪。更新了 API 以在查询结果中返回召回上下文,支持上下文精度指标。
- [2025.10]🎯[可扩展性增强]: 消除了处理瓶颈,以高效支持大规模数据集。
- [2025.09]🎯[新功能]: 显著提升了 Qwen3-30B-A3B 等开源 LLM 的知识图谱提取准确性。
- [2025.08]🎯[新功能]: 现已支持 Reranker,显著提升混合查询性能(已设为默认查询模式)。
- [2025.08]🎯[新功能]: 添加了文档删除功能,并支持自动重新生成知识图谱,以确保最佳查询性能。
- [2025.06]🎯[新发布]: 我们的团队发布了 RAG-Anything —— 一个用于无缝处理文本、图像、表格和方程式的全功能多模态 RAG 系统。
- [2025.06]🎯[新功能]: LightRAG 现已集成 RAG-Anything,支持全面的多模态数据处理,实现对 PDF、图像、Office 文档、表格和公式等多种格式的无缝文档解析和 RAG 能力。详见多模态文档处理部分。
- [2025.03]🎯[新功能]: LightRAG 现已支持引用功能,实现了准确的源归因和增强的文档可追溯性。
- [2025.02]🎯[新功能]: 现在您可以使用 MongoDB 作为一体化存储解决方案,实现统一的数据管理。
- [2025.02]🎯[新发布]: 我们的团队发布了 VideoRAG —— 一个用于理解超长上下文视频的 RAG 系统。
- [2025.01]🎯[新发布]: 我们的团队发布了 MiniRAG,使用小型模型简化 RAG。
- [2025.01]🎯现在您可以使用 PostgreSQL 作为一体化存储解决方案进行数据管理。
- [2024.11]🎯[新资源]: LightRAG 的综合指南现已在 LearnOpenCV 上发布 —— 探索深入的教程和最佳实践。非常感谢博客作者的杰出贡献!
- [2024.11]🎯[新功能]: 推出 LightRAG WebUI —— 一个允许您通过直观的 Web 界面插入、查询和可视化 LightRAG 知识的仪表板。
- [2024.11]🎯[新功能]: 现在您可以使用 Neo4J 进行存储 —— 开启图数据库支持。
- [2024.10]🎯[新功能]: 我们添加了 LightRAG 介绍视频 的链接 —— 演示 LightRAG 的各项功能。感谢作者的杰出贡献!
- [2024.10]🎯[新频道]: 我们创建了一个 Discord 频道!💬 欢迎加入我们的社区进行分享、讨论和协作! 🎉🎉
算法流程图
!LightRAG索引流程图
图1:LightRAG索引流程图 - 图片来源:Source
!LightRAG检索和查询流程图
图2:LightRAG检索和查询流程图 - 图片来源:Source
安装
💡 使用 uv 进行包管理: 本项目使用 uv 进行快速可靠的 Python 包管理。首先安装 uv: curl -LsSf https://astral.sh/uv/install.sh | sh (Unix/macOS) 或 powershell -c "irm https://astral.sh/uv/install.ps1 | iex" (Windows)
注意:如果您愿意,也可以使用 pip,但为了获得更好的性能 and 更可靠的依赖管理,建议使用 uv。
📦 离线部署: 对于离线或隔离环境,请参阅离线部署指南,了解预安装所有依赖项和缓存文件的说明。
安装LightRAG服务器
从PyPI安装
bash
使用 uv 安装 LightRAG 服务器(作为工具,推荐)
uv tool install "lightrag-hku[api]"
或使用 pip
python -m venv .venv
source .venv/bin/activate Windows: .venv\Scripts\activate
pip install "lightrag-hku[api]"
配置 env 文件
从 GitHub 仓库的根目录上下载 env.example 文件
或从本地检出的源代码中获取 env.example 文件
cp env.example .env 使用你的LLM和Embedding模型访问参数更新.env文件
启动 API-WebUI 服务。默认绑定所有网络接口(0.0.0.0)。
安全提示:对外网暴露前,请在 .env 中配置认证(LIGHTRAG_API_KEY,或
AUTH_ACCOUNTS 搭配 TOKEN_SECRET);若仅需本机访问,可绑定 127.0.0.1;
否则所有接口都将公开可访问。
注意:为兼容 Ollama 客户端,/api/ 路由默认不鉴权;如需对其启用认证,
请将 WHITELIST_PATHS 收窄为 /health。
lightrag-server
从源代码安装
bash
git clone https://github.com/HKUDS/LightRAG.git
cd LightRAG
一键初始化开发环境(推荐)
make dTop issues
#1323[Feature Request]: Automatic merging of the same entity under different names34 comments · 2025-04-09#2133[Question]:How to implement multi tenant solutions?14 comments · 2025-09-22#3631[Design Review]: Server-side Multi-Workspace Phase 113 comments · 2026-08-11#1985[Question]:How to add custom metadata columns for document management?13 comments · 2025-08-20#3664RFC: Add C strategy for Server-injected custom chunking callbacks12 comments · 2026-08-18#2285Can we temporarily enable/disable documents in RAG?11 comments · 2025-10-30#2138[Bug]: 🐛 Bug Report: QueryParam ids parameter not working in API Server Describe the bug11 comments · 2025-09-23#2642Guidance on Adding Multimodal Support to LightRAG: Wrap with RAG‑Anything or Extend (modify) LightRAGs lightrag‑server?10 comments · 2026-01-27
Discussions
#4301v1.5.6: supported chunk-selection diagnostics and applicability of #3887/#39042 comments · 2026-11-05#4150Putting a dollar cap on one LightRAG indexing job0 comments · 2026-10-03#3933Replaying a LightRAG run offline: exact with a local embedder, and exactly where it stops with openai_embed0 comments · 2026-09-13#3840We wired LightRAG into a full-duplex voice runtime — ask your knowledge base questions by voice0 comments · 2026-09-06#3388Feature Idea: Metadata filtering for retrieval (pre-filter chunks/entities by tags, file path, etc.)0 comments · 2026-07-10#3342LightRAG Upload Fails with "NanoVectorDBStorage[entities] index flush failed: 404 page not found"3 comments · 2026-06-28#3341File Upload Fails in LightRAG with "llama.cpp terminated unexpectedly" Error0 comments · 2026-06-28#3340New ideas I have tested and I think should be considered for the main release0 comments · 2026-06-27
Latest release
v1.5.7 v1.5.7 2026-09-02Important Notes New Feature: Add end-user-facing entry point to WebUI v1.5.7 adds a second, end-user-facing entry — /workspace — together with the branding and prompt controls a deployment needs before it can be handed to real users. A query-only entry for end users: /workspace Customizable welcome, login and empty-state pages A global USER_PROMPT_PREFIX /workspace UI shows the chat surface and nothing else — no document management, no knowledge graph, no API-docs links — and is built for mobile use. Point UI_TEMPLATES_DIR at a small directory of Markdown files plus a manifes