diff --git a/README.md b/README.md index 2b116d4..abc7041 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/HKUDS/LightRAG) · [上游 README](https://github.com/HKUDS/LightRAG/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 +
LightRAG Logo
-# 🚀 LightRAG: Simple and Fast Retrieval-Augmented Generation +# 🚀 LightRAG: 简单且快速的检索增强生成(RAG)框架
HKUDS%2FLightRAG | Trendshift @@ -18,7 +24,7 @@

- +

@@ -27,8 +33,8 @@

- - + +

@@ -66,7 +72,7 @@ - + @@ -75,207 +81,207 @@ --- -## 🎉 News -- [2026.05]🎯[New Feature]: **Merge RagAnything into LightRAG**🎉. Multimodal content parsing and extraction via **MinerU / Docling** services. -- [2026.05]🎯[New Feature]: Introducing four selectable text chunking strategies: `Fix`, `Recursive`, `Vector`, and `Paragraph`. -- [2026.05]🎯[New Feature]: **Role-specific LLM configuration** support, 4 distinct roles: EXTRACT, QUERY, KEYWORDS, and VLM, with independent LLM settings. -- [2026.03]🎯[New Feature]: Integrated **OpenSearch** as a unified storage backend, providing comprehensive support for all four LightRAG storage. -- [2026.03]🎯[New Feature]: Introduced a setup wizard. Support for local deployment of embedding, reranking, and storage backends via Docker. -- [2025.11]🎯[New Feature]: Integrated **RAGAS for Evaluation** and **Langfuse for Tracing**. Updated the API to return retrieved contexts alongside query results to support context precision metrics. -- [2025.10]🎯[Scalability Enhancement]: Eliminated processing bottlenecks to support **Large-Scale Datasets Efficiently**. -- [2025.09]🎯[New Feature] Enhances knowledge graph extraction accuracy for **Open-Sourced LLMs** such as Qwen3-30B-A3B. -- [2025.08]🎯[New Feature] **Reranker** is now supported, significantly boosting performance for mixed queries (set as default query mode). -- [2025.08]🎯[New Feature] Added **Document Deletion** with automatic KG regeneration to ensure optimal query performance. -- [2025.06]🎯[New Release] Our team has released [RAG-Anything](https://github.com/HKUDS/RAG-Anything) — an **All-in-One Multimodal RAG** system for seamless processing of text, images, tables, and equations. -- [2025.06]🎯[New Feature] LightRAG now supports comprehensive multimodal data handling through [RAG-Anything](https://github.com/HKUDS/RAG-Anything) integration, enabling seamless document parsing and RAG capabilities across diverse formats including PDFs, images, Office documents, tables, and formulas. Please refer to the new [multimodal section](https://github.com/HKUDS/LightRAG/?tab=readme-ov-file#multimodal-document-processing-rag-anything-integration) for details. -- [2025.03]🎯[New Feature] LightRAG now supports citation functionality, enabling proper source attribution and enhanced document traceability. -- [2025.02]🎯[New Feature] You can now use MongoDB as an all-in-one storage solution for unified data management. -- [2025.02]🎯[New Release] Our team has released [VideoRAG](https://github.com/HKUDS/VideoRAG)-a RAG system for understanding extremely long-context videos -- [2025.01]🎯[New Release] Our team has released [MiniRAG](https://github.com/HKUDS/MiniRAG) making RAG simpler with small models. -- [2025.01]🎯You can now use PostgreSQL as an all-in-one storage solution for data management. -- [2024.11]🎯[New Resource] A comprehensive guide to LightRAG is now available on [LearnOpenCV](https://learnopencv.com/lightrag). — explore in-depth tutorials and best practices. Many thanks to the blog author for this excellent contribution! -- [2024.11]🎯[New Feature] Introducing the LightRAG WebUI — an interface that allows you to insert, query, and visualize LightRAG knowledge through an intuitive web-based dashboard. -- [2024.11]🎯[New Feature] You can now [use Neo4J for Storage](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage)-enabling graph database support. -- [2024.10]🎯[New Feature] We've added a link to a [LightRAG Introduction Video](https://youtu.be/oageL-1I0GE). — a walkthrough of LightRAG's capabilities. Thanks to the author for this excellent contribution! -- [2024.10]🎯[New Channel] We have created a [Discord channel](https://discord.gg/yF2MmDJyGJ)!💬 Welcome to join our community for sharing, discussions, and collaboration! 🎉🎉 +## 🎉 新闻 +- [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](https://github.com/HKUDS/RAG-Anything) —— 一个用于无缝处理文本、图像、表格和方程式的**全功能多模态 RAG** 系统。 +- [2025.06]🎯[新功能]: LightRAG 现已集成 [RAG-Anything](https://github.com/HKUDS/RAG-Anything),支持全面的多模态数据处理,实现对 PDF、图像、Office 文档、表格和公式等多种格式的无缝文档解析和 RAG 能力。详见[多模态文档处理部分](https://github.com/HKUDS/LightRAG/?tab=readme-ov-file#multimodal-document-processing-rag-anything-integration)。 +- [2025.03]🎯[新功能]: LightRAG 现已支持引用功能,实现了准确的源归因和增强的文档可追溯性。 +- [2025.02]🎯[新功能]: 现在您可以使用 MongoDB 作为一体化存储解决方案,实现统一的数据管理。 +- [2025.02]🎯[新发布]: 我们的团队发布了 [VideoRAG](https://github.com/HKUDS/VideoRAG) —— 一个用于理解超长上下文视频的 RAG 系统。 +- [2025.01]🎯[新发布]: 我们的团队发布了 [MiniRAG](https://github.com/HKUDS/MiniRAG),使用小型模型简化 RAG。 +- [2025.01]🎯现在您可以使用 PostgreSQL 作为一体化存储解决方案进行数据管理。 +- [2024.11]🎯[新资源]: LightRAG 的综合指南现已在 [LearnOpenCV](https://learnopencv.com/lightrag) 上发布 —— 探索深入的教程和最佳实践。非常感谢博客作者的杰出贡献! +- [2024.11]🎯[新功能]: 推出 LightRAG WebUI —— 一个允许您通过直观的 Web 界面插入、查询和可视化 LightRAG 知识的仪表板。 +- [2024.11]🎯[新功能]: 现在您可以[使用 Neo4J 进行存储](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage) —— 开启图数据库支持。 +- [2024.10]🎯[新功能]: 我们添加了 [LightRAG 介绍视频](https://youtu.be/oageL-1I0GE) 的链接 —— 演示 LightRAG 的各项功能。感谢作者的杰出贡献! +- [2024.10]🎯[新频道]: 我们创建了一个 [Discord 频道](https://discord.gg/yF2MmDJyGJ)!💬 欢迎加入我们的社区进行分享、讨论和协作! 🎉🎉

- Algorithm Flowchart + 算法流程图 -![LightRAG Indexing Flowchart](https://learnopencv.com/wp-content/uploads/2024/11/LightRAG-VectorDB-Json-KV-Store-Indexing-Flowchart-scaled.jpg) -*Figure 1: LightRAG Indexing Flowchart - Img Caption : [Source](https://learnopencv.com/lightrag/)* -![LightRAG Retrieval and Querying Flowchart](https://learnopencv.com/wp-content/uploads/2024/11/LightRAG-Querying-Flowchart-Dual-Level-Retrieval-Generation-Knowledge-Graphs-scaled.jpg) -*Figure 2: LightRAG Retrieval and Querying Flowchart - Img Caption : [Source](https://learnopencv.com/lightrag/)* +![LightRAG索引流程图](https://learnopencv.com/wp-content/uploads/2024/11/LightRAG-VectorDB-Json-KV-Store-Indexing-Flowchart-scaled.jpg) +*图1:LightRAG索引流程图 - 图片来源:[Source](https://learnopencv.com/lightrag/)* +![LightRAG检索和查询流程图](https://learnopencv.com/wp-content/uploads/2024/11/LightRAG-Querying-Flowchart-Dual-Level-Retrieval-Generation-Knowledge-Graphs-scaled.jpg) +*图2:LightRAG检索和查询流程图 - 图片来源:[Source](https://learnopencv.com/lightrag/)*
-## Installation +## 安装 -**💡 Using uv for Package Management**: This project uses [uv](https://docs.astral.sh/uv/) for fast and reliable Python package management. Install uv first: `curl -LsSf https://astral.sh/uv/install.sh | sh` (Unix/macOS) or `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"` (Windows) +**💡 使用 uv 进行包管理**: 本项目使用 [uv](https://docs.astral.sh/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) -> **Note**: You can also use pip if you prefer, but uv is recommended for better performance and more reliable dependency management. +> **注意**:如果您愿意,也可以使用 pip,但为了获得更好的性能 and 更可靠的依赖管理,建议使用 uv。 > -> **📦 Offline Deployment**: For offline or air-gapped environments, see the [Offline Deployment Guide](./docs/OfflineDeployment.md) for instructions on pre-installing all dependencies and cache files. +> **📦 离线部署**: 对于离线或隔离环境,请参阅[离线部署指南](./docs/OfflineDeployment.md),了解预安装所有依赖项和缓存文件的说明。 -### Install LightRAG Server +### 安装LightRAG服务器 -* Install from PyPI +* 从PyPI安装 ```bash -### Install LightRAG Server as tool using uv (recommended) +### 使用 uv 安装 LightRAG 服务器(作为工具,推荐) uv tool install "lightrag-hku[api]" -### Or using pip +### 或使用 pip # python -m venv .venv # source .venv/bin/activate # Windows: .venv\Scripts\activate # pip install "lightrag-hku[api]" -### Build front-end artifacts +### 构建前端代码 cd lightrag_webui bun install --frozen-lockfile bun run build cd .. -# Setup env file -# Obtain the env.example file by downloading it from the GitHub repository root -# or by copying it from a local source checkout. -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. -# SECURITY: before exposing it on a network, configure authentication in .env -# (LIGHTRAG_API_KEY, or AUTH_ACCOUNTS together with TOKEN_SECRET), or bind to -# 127.0.0.1 for local-only access; without auth every endpoint is public. -# Note: the Ollama-compatible /api/* routes stay open by default for client -# compatibility; set WHITELIST_PATHS=/health to require auth on them too. +# 配置 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 ``` -* Installation from Source +* 从源代码安装 ```bash 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) -# Or on Windows: .venv\Scripts\activate +source .venv/bin/activate # 激活虚拟环境 (Linux/macOS) +# Windows 系统: .venv\Scripts\activate -# make dev installs the test toolchain plus the full offline stack -# (API, storage backends, and provider integrations), then builds the frontend. -# Run make env-base or copy env.example to .env before starting the server. +# make dev 会安装测试工具链以及完整的离线依赖栈 +# (API、存储后端与各类 Provider 集成),并构建前端;不会生成 .env。 +# 启动服务前请先运行 make env-base,或手动从 env.example 复制并配置 .env。 -# Equivalent manual steps with uv -# Note: uv sync automatically creates a virtual environment in .venv/ +# 使用 uv 的等价手动步骤 +# 注意: uv sync 会自动在 .venv/ 目录创建虚拟环境 uv sync --extra test --extra offline -source .venv/bin/activate # Activate the virtual environment (Linux/macOS) -# Or on Windows: .venv\Scripts\activate +source .venv/bin/activate # 激活虚拟环境 (Linux/macOS) +# Windows 系统: .venv\Scripts\activate -### Or using pip with virtual environment +### 或使用 pip 和虚拟环境 # python -m venv .venv # source .venv/bin/activate # Windows: .venv\Scripts\activate # pip install -e ".[test,offline]" -# 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 +# 配置 env 文件 +make env-base # 或: cp env.example .env 后手动修改 +# 启动API-WebUI服务 lightrag-server ``` -* Launching the LightRAG Server with Docker Compose +* 使用 Docker Compose 启动 LightRAG 服务器 ```bash git clone https://github.com/HKUDS/LightRAG.git cd LightRAG -cp env.example .env # Update the .env with your LLM and embedding configurations +cp env.example .env # 使用你的LLM和Embedding模型访问参数更新.env文件 # modify LLM and Embedding settings in .env docker compose up ``` -> Historical versions of LightRAG docker images can be found here: [LightRAG Docker Images]( https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) +> 在此获取LightRAG docker镜像历史版本: [LightRAG Docker Images]( https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) > -> Official GHCR images published by GitHub Actions are signed with Sigstore Cosign using GitHub OIDC. See [docs/DockerDeployment.md](./docs/DockerDeployment.md#verify-official-ghcr-images-with-cosign) for verification commands. +> 由 GitHub Actions 发布到 GHCR 的官方镜像已使用 GitHub OIDC 和 Sigstore Cosign 进行签名。校验方式请参阅 [docs/DockerDeployment.md](./docs/DockerDeployment.md#verify-official-ghcr-images-with-cosign)。 -### Create .env File With Setup Tool +### 使用设置向导创建 .env 文件 -Instead of editing `env.example` by hand, use the interactive setup wizard to generate a configured `.env` and, when needed, `docker-compose.final.yml`: +除了手动编辑 `env.example` 之外,您还可以使用交互式向导生成配置好的 `.env`,并在需要时生成 `docker-compose.final.yml`: ```bash -make env-base # Required first step: LLM, embedding, reranker -make env-storage # Optional: storage backends and database services -make env-server # Optional: server port, auth, and SSL -make env-base-rewrite # Optional: force-regenerate wizard-managed compose services -make env-storage-rewrite # Optional: force-regenerate wizard-managed compose services -make env-security-check # Optional: audit the current .env for security risks +make env-base # 必跑第一步:配置 LLM、Embedding、Reranker +make env-storage # 可选:配置存储后端和数据库服务 +make env-server # 可选:配置服务端口、鉴权和 SSL +make env-base-rewrite # 可选:强制重建向导托管的 compose 服务块 +make env-storage-rewrite # 可选:强制重建向导托管的 compose 服务块 +make env-security-check # 可选:审计当前 .env 中的安全风险 ``` -For full description of every target see [docs/InteractiveSetup.md](./docs/InteractiveSetup.md). +设置向导工具的详细说明请参阅 [docs/InteractiveSetup.md](./docs/InteractiveSetup.md)。 -## About LightRAG +## 关于LightRAG -### A Lightweight, Graph-Based RAG Framework +### 基于图的轻量级RAG框架 -LightRAG is a lightweight knowledge-graph RAG framework and an efficient alternative to Microsoft GraphRAG. It adopts a dual-layer architecture to manage both knowledge graphs (KGs) and vector embeddings, effectively bridging the gap between traditional vector-based RAG and graph-based RAG approaches. Designed for high scalability, LightRAG addresses key challenges in large-scale graph indexing and retrieval, including heavy computational overhead, slow response times, and the high cost of incremental updates. While supporting large datasets, LightRAG can still deliver exceptionally high RAG quality, even when paired with a 30B open-source large language model (LLM). +**LightRAG** 是一个轻量级的知识图谱 RAG 框架,被视为 Microsoft GraphRAG 的高效替代方案。它采用双层架构来同时管理知识图谱(KG)和向量嵌入,完美填补了传统基于向量的 RAG 与基于图谱的 RAG 之间的技术鸿沟。LightRAG专为高扩展性而设计,有效地解决了大规模图谱索引和查询时计算开销大、响应缓慢以及增量更新成本高等问题;LightRAG在支持大规模数据集的同时,即使搭载 30B开源大语言模型(LLM),也能保持极高的RAG质量。 -### Features & Advantages +### 特点与优势 -- **Deep Contextual Understanding:** Through graph-structured indexing, LightRAG captures complex semantic dependencies between entities, overcoming the fragmented context limitations typical of traditional chunk-based retrieval methods. Its generation quality and context awareness are particularly outstanding in vertical domains (e.g., legal, financial) that require global comprehension or logical reasoning. -- **Exceptional Comprehensiveness & Diversity:** LightRAG’s dual-level retrieval mechanism allows it to integrate detailed facts and abstract concepts concurrently. This enables the system to achieve remarkable performance in query result comprehensiveness and diversity, making it highly effective at handling complex, cross-document queries. -- **Extreme Retrieval Efficiency & Low Cost:** LightRAG does not rely on inefficient community reports or multi-hop reasoning for complex queries. This drastically reduces the number of LLM calls required during both the indexing and querying phases, significantly lowering response latency and LLM computational costs. -- **Rapid Adaptation to Dynamic Data:** LightRAG supports seamless, incremental knowledge base updates. New data only needs to go through a standard graph indexing pipeline to generate a local graph, which is then directly integrated into the existing graph via set merging. This process eliminates the need to disrupt the original structure or rebuild the global index, ensuring real-time relevance in dynamic data environments. When deleting documents, the system leverages LLM caching from the construction phase to rapidly rebuild affected entity relationships, vastly improving knowledge base update efficiency. +1. **深度上下文理解**:通过图结构索引,LightRAG 能够捕捉实体间复杂的语义依赖关系,克服了传统分块检索方法上下文割裂的缺陷。在需要全局理解或逻辑推理的垂直领域(如法律、金融),其生成质量与上下文感知能力尤为突出。 +2. **卓越的全面性与多样性**:LightRAG的双层检索机制使其能够同时整合详细事实与抽象概念,让其在查询结果全面性(Comprehensiveness)和多样性(Diversity)取得卓越的成绩,有效应对复杂的跨文档查询。 +3. **极高的检索效率与低成本**:LightRAG不需要依赖低效的社区报告和复杂查询时的多跳推理,大幅度减少了索引和查询阶段对LLM的调用,显著减少了响应延迟与LLM计算成本。 +4. **快速适应动态数据**:LightRAG 支持无缝的增量知识库更新。新数据只需经过标准的图索引流程生成局部图谱,即可通过集合合并的方式直接融入现有图谱,无需破坏原有结构或重建全局索引,保证了系统在动态数据环境下的时效性。删除文档时可以利用构建阶段的LLM缓存快速重建受影响的实体关系,大幅度提高了知识库更新效率。 -### Multimodal Capability Upgrades +### 多模态能力的升级 -Starting from version v1.5, LightRAG has officially introduced analysis and retrieval capabilities for multimodal documents: +从 LightRAG v1.5 版本开始,该框架正式引入了对多模态文档的分析和检索能力: -- **Multi-Engine Document Parsing:** Its document processing pipeline supports parsing engines such as MinerU, Docling, and Native, enabling the highly efficient extraction of text, tables, formulas, and images from documents. -- **Cross-Modal Entity & Relation Mapping:** It achieves cross-modal entity extraction and relationship mapping within a unified framework, resulting in seamless indexing and querying. -- **Enhanced Application Scenarios:** The brand-new multimodal processing pipeline significantly improves RAG quality for documents rich in multimodal content, such as operation manuals and academic papers. +* **多引擎文档解析:** 其文件处理流水线(Pipeline)支持使用 MinerU、Docling 和 Native 文档解析引擎,可高效提取文档中的文字、表格、公式和图片。 +* **跨模态实体与关系映射:** 在统一的框架内实现跨模态的实体提取和关系映射,从而达成无缝的索引与查询。 +* **应用场景提升:** 全新的多模态处理流水线能够大幅提高操作说明书、学术论文等含有丰富多模态内容文档的 RAG 质量。 -### LightRAG API Server +### LightRAG API 服务器 -The LightRAG server offers not only a web-based UI for exploring LightRAG functionalities but also a comprehensive REST API. For more information about the LightRAG server, please refer to [LightRAG Server](./docs/LightRAG-API-Server.md). +LightRAG 服务器不仅提供给了一个供出选择体验LightRAG功能的Web UI,还提供了一个完整的 `REST API`。有关LightRAG服务器的更多信息,请参阅[LightRAG服务器](./docs/LightRAG-API-Server-zh.md)。 ![iShot_2025-03-23_12.40.08](./README.assets/iShot_2025-03-23_12.40.08.png) -## Key Configuration Guide +## 关键配置说明 -### Selecting LLM Models +### LLM 模型的选择 -LightRAG requires LLM/VLMs of four different roles during its workflow. You should configure models with different capabilities and speeds for different roles to strike a balance between performance and processing speed. LightRAG has higher capability requirements for Large Language Models (LLMs) than traditional RAG because it requires LLMs to perform complex entity-relation extraction tasks from documents. During the query phase, the LLM needs to process a large volume of retrieved information, including entities, relationships, and text chunks. This requires the model to have the capability of generating high-quality responses in long, noisy contexts. For detailed model configurations, please refer to [RoleSpecificLLMConfiguration.md](./docs/RoleSpecificLLMConfiguration.md) +LightRAG 的工作过程中需要使用到 4 种角色的 LLM/VLM。应该为不同角色的 LLM 配置不同能力和速度的模型,以获得速度和能力之间的平衡。LightRAG 对大型语言模型(LLM)的能力要求会高于传统 RAG,因为它需要 LLM 执行文档中的实体关系抽取任务。在查询阶段,LLM 模型需要处理 LightRAG 召回的实体、关系和文本块等大量信息,需要模型具备在含有噪声的长上下文中作出高质量回答的能力。详细的模型配置请参见 [RoleSpecificLLMConfiguration-zh.md](./docs/RoleSpecificLLMConfiguration-zh.md) -### Selecting Query Modes +### 查询模式的选择 -LightRAG supports five query modes: +LightRAG 支持 4 种查询模式: -- **local**: Focuses on precise matching of local contexts and specific entities. It retrieves candidate entities and their directly associated attributes from the knowledge graph. This mode is suitable for Q&A targeting specific objects, concrete concepts, or detailed facts, providing highly relevant and detailed local context support. -- **global**: Focuses on macro themes, cross-document reasoning, and deep relationships between entities. It retrieves relationship chains covering broad themes and concepts. This mode is suitable for queries that require summarization across multiple contexts, trend analysis, or understanding complex semantic dependencies. -- **hybrid**: Merges the retrieval results of both local and global modes. It performs comprehensive reasoning and generation by simultaneously recalling specific entities and global relationship contexts. -- **naive**: Traditional RAG retrieval based on text chunks. It does not use a knowledge graph and relies directly on vector similarity to retrieve from the original text chunks. -- **mix**: Fully-featured mode that merges retrieval results from local, global, and naive modes to provide the most comprehensive and rich retrieval results. +- **local**:聚焦于局部上下文与具体实体的精准匹配。在知识图谱中检索对应的候选实体及其直接关联属性,适用于针对特定对象、具体概念或细节事实的问答,能够提供高度相关且细致的局部上下文支持。 +- **global**:侧重于宏观主题、跨文档推理与实体间的深层关系。检索覆盖广泛主题与概念的关系链,适用于需要跨多个上下文进行总结、趋势分析或理解复杂语义依赖关系的查询。 +- **hybrid**:融合 local 和 global 两种模式的检索结果。通过同时召回具体实体与全局关系上下文,进行综合推理与生成。 +- **naive**:基于文本块的传统 RAG 检索,不使用知识图谱,直接依赖向量相似性在原始文本块中进行检索。 +- **mix**:全功能模式,融合 local、global 和 naive 三种模式的检索结果,提供最为丰富和全面的检索结果。 -The default query mode for LightRAG is `mix`. Using `mix` mode generally yields the most ideal query results. The `mix` mode takes slightly longer than `naive`, while other query modes are roughly comparable in latency. +LightRAG 的默认查询模式为 mix。使用 mix 模式通常可以获得最为理想的查询结果。mix 模式比 naive 耗时略长;其他查询模式在耗时上基本相当。 -### Embedding Models +### Embedding 模型 -When choosing an Embedding model, pay attention to its multilingual support capabilities. Since LightRAG's retrieval quality has limited dependency on the Embedding model, it is recommended to choose low-dimensional and fast models. Typically, `BAAI/bge-m3` is sufficient. We highly recommend deploying the Embedding model locally to achieve the best performance. +在选择 Embedding 模型的时候需要注意其对多语言的支持能力。LightRAG 的检索质量对 Embedding 模型的依赖有限,因此建议尽量选择低维度和速度快的模型。通常 `BAAI/bge-m3` 已经足够使用。建议尽量本地部署 Embedding 模型,以获得最好的性能。 -**Important Note**: The Embedding model must be determined before document indexing, and the same model must be used in the query phase. Once selected, embedding models generally cannot be changed. If changed, you will need to re-embed all text chunks, entities, and relationships. LightRAG does not currently provide a re-embedding tool. Some storage backends (e.g., PostgreSQL) require the vector dimension to be defined when creating tables for the first time, so changing the Embedding model requires deleting vector-related tables so LightRAG can recreate them. +**重要提示**:在文档索引前必须确定使用的 Embedding 模型,且在文档查询阶段必须沿用与索引阶段相同的模型。嵌入模型一旦选定通常就不能修改。如果修改的话,需要对所有文本块、实体和关系进行重新嵌入。LightRAG 目前没有提供重新嵌入的工具。有些存储(例如 PostgreSQL)在首次建立数据表的时候需要确定向量维度,因此更换 Embedding 模型后需要删除向量相关库表,以便让 LightRAG 重建新的库表。 -### Enabling Reranking +### 开启 Rerank 选项 -Enabling the Rerank option during the query phase can significantly improve query quality. However, enabling Rerank typically introduces a 1–2 second delay. To minimize latency, it is highly recommended to deploy the Rerank model locally. For configuration details, please refer to the `.env.example` file. Unlike Embedding models, the Rerank model can be changed at any time during the query phase. +查询阶段开启 Rerank 选项可以显著提高查询的质量。开启 Rerank 通常会引入 1~2 秒的延时。为了降低延时,建议尽量在本地部署 Rerank 模型。Rerank 的相关配置方式请参考 `.env.example` 文件。Rerank 模型与 Embedding 模型不同,可以在查询阶段随时更换。 -### Document Processing Pipeline Configuration +### 文档处理流水线的配置 -The default pipeline configuration in LightRAG does not allow the system to perform at its best. The quality of document parsing greatly impacts document indexing and querying. Therefore, we recommend configuring the pipeline to enable the MinerU parsing engine and activating the pipeline's image analysis features. Suggested configuration: +LightRAG 的默认流水线配置并不能让系统发挥最好的性能。文件内容解析的好坏会极大地影响文档的索引和查询效果。因此建议配置流水线开启 MinerU 文件解析引擎,并开启流水线的图片分析功能。建议添加的配置为: ``` LIGHTRAG_PARSER=*:native-iteP,*:mineru-iteP,*:legacy-R @@ -284,72 +290,72 @@ VLM_PROCESS_ENABLE=true VLM_LLM_MODEL= ``` -Since the cloud-based MinerU service has limitations on usage, file size, and page count, it is recommended to use a locally deployed MinerU. For details on configuring the file processing pipeline, please refer to [FileProcessingPipeline.md](./docs/FileProcessingPipeline.md) +由于云端的 MinerU 服务有使用量、文件大小和页数等限制,建议使用本地部署的 MinerU。文件处理流水线的具体配置方法请参考 [FileProcessingPipeline-zh.md](./docs/FileProcessingPipeline-zh.md) -### Concurrency Optimization for File Processing +### 文件处理并发优化 -For large-scale document processing, you need to improve concurrency. Key environment variables related to concurrent file processing include: +对于大规模的文档处理,需要提高文档处理的并发能力。几个涉及文件并发处理性能的关键环境变量包括: -- **MAX_ASYNC_LLM/EXTRACT_ASYNC_LLM**: Controls the maximum concurrency for LLM models. -- **MAX_PARALLEL_INSERT**: Controls the maximum number of files processed in parallel. Processing of text, tables, formulas, and images within a single file will also occur concurrently. `MAX_PARALLEL_INSERT` should ideally be set to about 1/3 of `MAX_ASYNC_LLM`. -- **MAX_PARALLEL_PARSE_MINERU**: Controls the number of parallel files processed for MinerU parsing. -- **MAX_PARALLEL_PARSE_DOCLING**: Controls the number of parallel files processed for Docling parsing. -- **EMBEDDING_FUNC_MAX_ASYNC**: Controls the maximum concurrency for embedding models. -- **EMBEDDING_BATCH_NUM**: Controls the number of texts included in each embedding model request (how many embeddings per batch). Increasing this number can significantly reduce the number of API calls to the embedding model and speed up data persistence in the embedding storage. +- **MAX_ASYNC_LLM/EXTRACT_ASYNC_LLM**:控制 LLM 模型的最大并发数。 +- **MAX_PARALLEL_INSERT**:控制并行处理文件的最大数量。单个文件内的文本、表格、公式、图片之间的处理也会并发进行。`MAX_PARALLEL_INSERT` 应该为 `MAX_ASYNC_LLM` 的 1/3 左右为宜。 +- **MAX_PARALLEL_PARSE_MINERU**:控制 MinerU 文件解析的并发处理文件数。 +- **MAX_PARALLEL_PARSE_DOCLING**:控制 Docling 文件解析的并发处理文件数。 +- **EMBEDDING_FUNC_MAX_ASYNC**:控制嵌入模型的最大并发数。 +- **EMBEDDING_BATCH_NUM**:控制每个嵌入模型请求包含的待嵌入文本的数量(每批做多少个嵌入);提高这个数量可以大幅度减少调用嵌入模型的次数,提高嵌入存储的落盘速度。 ``` -# Sample Configuration +# 设置示例 MAX_ASYNC_LLM=8 MAX_PARALLEL_INSERT=3 EMBEDDING_FUNC_MAX_ASYNC=16 EMBEDDING_BATCH_NUM=32 ``` -### Selecting Backend Storage +### 后台存储的选择 -LightRAG requires four types of backend storage: +LightRAG 需要使用到 4 种后台存储类型,分别是: -- **KV_STORAGE**: Used to save LLM response caches, text chunking results, entity-relation extraction results, etc. -- **VECTOR_STORAGE**: Used to store vector information for text chunks, entities, and relationships. -- **GRAPH_STORAGE**: Used to save the knowledge graph. -- **DOC_STATUS_STORAGE**: Used to store the document list. +- **KV_STORAGE**:用于保存 LLM 响应缓存、文本分块结果、实体关系提取结果等信息。 +- **VECTOR_STORAGE**:用于保存文本块、实体和关系的向量信息。 +- **GRAPH_STORAGE**:用于保存知识图谱。 +- **DOC_STATUS_STORAGE**:用于保存文件列表。 -By default, LightRAG's storage backends are file-persisted, in-memory databases. These default storages are intended only for development and debugging, and are not suitable for production. In a production environment, if you prefer a single backend to handle all four storage types, you can choose PostgreSQL, MongoDB, or OpenSearch. Alternatively, you can select specialized databases for vector or graph storage, such as using Milvus or Qdrant for vector storage, and Neo4j or Memgraph for graph storage. +LightRAG 的默认存储全部都是基于文件进行持久化的内存数据库。默认存储仅用于开发调试,不适合用于生产环境部署。生产环境如果希望使用同一个后台数据解决 4 种类型的后台存储,可以选择 PostgreSQL、MongoDB 或 OpenSearch。也可以单独为向量存储或图存储选择专业化的数据库,例如使用 Milvus 或 Qdrant 作为向量存储,使用 Neo4j 或 Memgraph 作为图存储。 -### Other Important Configurations for Document Processing +### 文档处理阶段其他重要配置 -During the document insertion stage, you may also want to adjust the following environment variables based on your needs: +在文档插入阶段还有以下环境变量建议根据实际需要进行调整: -- **SUMMARY_LANGUAGE**: Controls the language used by the LLM when outputting entity-relation names and summaries, e.g., `Chinese`, `English`. -- **ENTITY_EXTRACTION_USE_JSON**: Controls whether the LLM outputs entity-relation extractions in JSON format. Using JSON format typically yields more stable results, but it consumes more tokens and can be slightly slower. -- **ENABLE_CONTENT_HEADINGS**: Controls whether the section heading information of a text chunk is sent to the LLM during the query stage (enabled by default, providing more context for the LLM). -- **FORCE_LLM_SUMMARY_ON_MERGE / MAX_SOURCE_IDS_PER_RELATION**: Controls the maximum number of text chunks an `entity/relation` can be associated with. -- **SOURCE_IDS_LIMIT_METHOD**: Controls whether to keep updating the entity/relation description once an `entity/relation` exceeds its associated text chunk limit (by default it stops updating, because at that point the entity-relation description is already rich enough and further updates add little value; skipping updates can greatly speed up knowledge base construction). -- **DEFAULT_MAX_FILE_PATHS**: Controls the maximum number of source files an `entity/relation` can be associated with; once this limit is exceeded, new file names are no longer written to the vector storage. +- **SUMMARY_LANGUAGE**:控制 LLM 输出实体关系名称和摘要时使用的语言,例如:`Chinese`, `English`。 +- **ENTITY_EXTRACTION_USE_JSON**:控制 LLM 输出实体关系的时候是否使用 JSON 格式。使用 JSON 格式通常可以获得更加稳定的效果,但是输出需要消耗更多的 Token,速度也会略微慢一些。 +- **ENABLE_CONTENT_HEADINGS**:控制查询阶段是否把文本块所属章节标题信息送给LLM(默认允许,为LLM提供更多的上下文信息) +- **FORCE_LLM_SUMMARY_ON_MERGE / MAX_SOURCE_IDS_PER_RELATION**:控制每个`实体/关系`能够最多与多少个文本块保持关联 +- **SOURCE_IDS_LIMIT_METHOD**:控制`实体/关系`关联文本块超过限制后是否继续更新实体关系的描述(默认不再更新,因为此时实体关系的描述已经足够丰富,继续更新的意义不大;放弃更新可以极大地提高知识库的构建速度) +- **DEFAULT_MAX_FILE_PATHS**:控制`实体/关系`关联的原始文件的最大数量,超过这个数量之后新的文件名不再写入到向量存储。 -### Resolving LLM Timeouts During Entity-Relation Extraction +### 解决实体关系抽取阶段的 LLM 超时 -LLM timeouts during entity-relation extraction usually trace back to one of three causes. Identify the cause, then apply the matching remedy (the parameters can be combined): +实体关系抽取阶段的 LLM 超时通常源于以下三种原因之一。先判断原因,再采用对应的解决方案(参数可以组合使用): -- **The model is slow.** A model running below ~50 tokens/second may be unable to finish a chunk that contains many entities and relations before the request times out. Increase the timeout via `*_LLM_TIMEOUT` — either the global `LLM_TIMEOUT` or the role-specific `EXTRACT_LLM_TIMEOUT` for the extraction phase. Note that the effective execution timeout is **twice** the configured value, so `EXTRACT_LLM_TIMEOUT=300` allows up to **600 seconds**. -- **The chunk produces too many entities and relations.** Reference/bibliography chunks, for example, can make the model emit an enormous number of records that cannot complete in time. Cap the output length with `OPENAI_LLM_MAX_TOKENS` or `OPENAI_LLM_MAX_COMPLETION_TOKENS` (the correct parameter name depends on the LLM provider — see `env.example`). A useful sizing rule is `max_output_tokens < LLM_TIMEOUT × tokens_per_second` (e.g., `9000 < 240s × 50 tps`). -- **The model gets stuck in an output loop.** Some models (locally deployed Qwen models in particular) occasionally fall into an endless-output loop on certain text. When this is intermittent, simply re-processing the document once usually resolves it. -- **References specifically (P chunking strategy).** When using the paragraph-semantic (`P`) chunking strategy (e.g., `LIGHTRAG_PARSER=...-iteP`), set `CHUNK_P_DROP_REFERENCES=true` to automatically drop the trailing reference section before chunking. This prevents references from generating a flood of low-value entities and relations, a common source of timeouts. It can also be enabled per file via the filename hint `paper.[-P(drop_rf=true)].pdf`; related detection knobs (`CHUNK_P_REFERENCES_TAIL_N`, `CHUNK_P_REFERENCES_HEADINGS`) are documented in `env.example`. +- **模型太慢。** 速度低于约 50 tokens/秒的模型,可能无法在请求超时前完成包含大量实体关系的文本块的抽取。可以通过 `*_LLM_TIMEOUT` 增大超时时间——既可以是全局的 `LLM_TIMEOUT`,也可以是抽取阶段专用的角色参数 `EXTRACT_LLM_TIMEOUT`。注意实际的执行超时是所配置值的**两倍**,因此 `EXTRACT_LLM_TIMEOUT=300` 对应最长 **600 秒**。 +- **文本块产生的实体关系太多。** 例如参考文献文本块会让模型输出极其大量的记录,从而无法在限定时间内完成。可以通过 `OPENAI_LLM_MAX_TOKENS` 或 `OPENAI_LLM_MAX_COMPLETION_TOKENS` 限制输出长度(具体参数名取决于 LLM 供应商,详见 `env.example`)。一个实用的估算规则是 `max_output_tokens < LLM_TIMEOUT × 每秒token数`(例如 `9000 < 240s × 50 tps`)。 +- **模型存在缺陷,陷入输出死循环。** 某些模型(尤其是本地部署的 Qwen 模型)在遇到特殊文本时偶尔会陷入无尽的输出死循环。如果是偶发情况,通常只需将该文档重新处理一次即可解决。 +- **专门针对参考文献(P 分块策略)。** 使用段落语义(`P`)分块策略(例如 `LIGHTRAG_PARSER=...-iteP`)时,设置 `CHUNK_P_DROP_REFERENCES=true` 可在分块前自动删除末尾的参考文献部分,从而避免参考文献产生大量低价值的实体关系(这是导致超时的常见原因)。也可以通过文件名提示 `paper.[-P(drop_rf=true)].pdf` 对单个文件启用;相关的检测参数(`CHUNK_P_REFERENCES_TAIL_N`、`CHUNK_P_REFERENCES_HEADINGS`)详见 `env.example`。 -### Other Important Configurations for Document Querying +### 文档查询阶段其他重要配置 -During the document query stage, you may also want to adjust the following environment variables based on your needs: -- **MAX_ENTITY_TOKENS / MAX_RELATION_TOKENS / MAX_TOTAL_TOKENS**: Controls the token length of the retrieved content sent to the LLM context. The retrieved content consists of three parts: `entities`, `relations`, and `text chunks`. The lengths of entities and relations can be controlled independently, while the text chunk length is determined by subtracting the entity and relation lengths from the total length. -- **ENABLE_CONTENT_HEADINGS**: Controls whether the section heading where a text chunk resides is sent to the LLM; enabled by default, providing richer context for the LLM and improving answer quality. -- **ENABLE_LLM_CACHE**: Whether to cache query results. Enabled by default; identical query questions, query modes, and LLM model parameters will return the same result. +在文档查询阶段还有以下环境变量建议根据实际需要进行调整: +- **MAX_ENTITY_TOKENS / MAX_RELATION_TOKENS / MAX_TOTAL_TOKENS**:控制召回内容送给LLM上下文的Token长度。召回内容包含`实体`、`关系`和`文本块`三部分,实体和关系的长度可以单独控制长度,文本块的长度由总长度减去实体和关系的长度来控制。 +- **ENABLE_CONTENT_HEADINGS**:控制是否把文本块所在的章节标题送给LLM;默认开启,可以为LLM提供更加丰富的上下文信息,提高回答质量。 +- **ENABLE_LLM_CACHE**:是否允许缓存查询结果。默认开启,相同的查询问题、查询模式、LLM模型参数将返回相同的结果。 -## Using LightRAG As SDK +## 使用LightRAG SDK -> ⚠️ **For integration into your project, we strongly recommend using the REST API provided by the LightRAG Server.** The LightRAG SDK is primarily intended for embedded applications or academic research and evaluation purposes. +> ⚠️ **如果您希望将LightRAG集成到您的项目中,建议您使用LightRAG Server提供的REST API**。LightRAG SDK通常用于嵌入式应用,或供希望进行研究与评估的学者使用。 -### Install LightRAG SDK +### 安装LightRAG SDK -* Install from source code +* 从源代码安装 ```bash cd LightRAG @@ -361,16 +367,16 @@ source .venv/bin/activate # 激活虚拟环境 (Linux/macOS) # 或: pip install -e . ``` -* Install from PyPI +* 从PyPI安装 ```bash uv pip install lightrag-hku # 或: pip install lightrag-hku ``` -### LightRAG SDK Sample Code +### LightRAG SDK示例代码 -To get started with LightRAG core, refer to the sample codes available in the `examples` folder. Additionally, a [video demo](https://www.youtube.com/watch?v=g21royNJ4fw) demonstration is provided to guide you through the local setup process. If you already possess an OpenAI API key, you can run the demo right away: +LightRAG核心功能的示例代码请参见`examples`目录。您还可参照[视频](https://www.youtube.com/watch?v=g21royNJ4fw)视频完成环境配置。若已持有OpenAI API密钥,可以通过以下命令运行演示代码: ```bash ### you should run the demo code with project folder @@ -383,49 +389,49 @@ curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_d python examples/lightrag_openai_demo.py ``` -For a streaming response implementation example, please see `examples/lightrag_openai_compatible_demo.py`. Prior to execution, ensure you modify the sample code's LLM and embedding configurations accordingly. +如需流式响应示例的实现代码,请参阅 `examples/lightrag_openai_compatible_demo.py`。运行前,请确保根据需求修改示例代码中的LLM及嵌入模型配置。 -**Note 1**: When running the demo program, please be aware that different test scripts may use different embedding models. If you switch to a different embedding model, you must clear the data directory (`./dickens`); otherwise, the program may encounter errors. If you wish to retain the LLM cache, you can preserve the `kv_store_llm_response_cache.json` file while clearing the data directory. +**注意1**:在运行demo程序的时候需要注意,不同的测试程序可能使用的是不同的embedding模型,更换不同的embeding模型的时候需要把清空数据目录(`./dickens`),否则层序执行会出错。如果你想保留LLM缓存,可以在清除数据目录时保留`kv_store_llm_response_cache.json`文件。 -**Note 2**: Only `lightrag_openai_demo.py` and `lightrag_openai_compatible_demo.py` are officially supported sample codes. Other sample files are community contributions that haven't undergone full testing and optimization. +**注意2**:官方支持的示例代码仅为 `lightrag_openai_demo.py` 和 `lightrag_openai_compatible_demo.py` 两个文件。其他示例文件均为社区贡献内容,尚未经过完整测试与优化。 -### **Notes on SDK Usage** +### 使用SDK的注意事项 -For detailed instructions on using the SDK, please refer to **[docs/ProgramingWithCore.md](./docs/ProgramingWithCore.md)**. Some LightRAG features are not exposed via the REST API and are accessible only through the SDK. These features are typically experimental and may not be compatible with future versions. +SDK的使用说明详见 **[docs/ProgramingWithCore.md](./docs/ProgramingWithCore.md)**(英文)。有部份LightRAG功能没有提供 REST API,仅能够通过SDK使用。这部份功能往往是不稳定,不能保证在将来的版本上可以兼容。 -## Replicating Findings in the Paper +## 重现论文结果 -LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across agriculture, computer science, legal, and mixed domains. For the full evaluation methodology, prompts, and reproduce steps, see **[docs/Reproduce.md](./docs/Reproduce.md)**. +LightRAG 在农业、计算机科学、法律和混合等领域均显著优于 NaiveRAG、RQ-RAG、HyDE 和 GraphRAG。完整评估方法论、提示词和复现步骤详见 **[docs/Reproduce.md](./docs/Reproduce.md)**(英文)。 -**Overall Performance Table** +### 总体性能表 -||**Agriculture**||**CS**||**Legal**||**Mix**|| +||**农业**||**计算机科学**||**法律**||**混合**|| |----------------------|---------------|------------|------|------------|---------|------------|-------|------------| ||NaiveRAG|**LightRAG**|NaiveRAG|**LightRAG**|NaiveRAG|**LightRAG**|NaiveRAG|**LightRAG**| -|**Comprehensiveness**|32.4%|**67.6%**|38.4%|**61.6%**|16.4%|**83.6%**|38.8%|**61.2%**| -|**Diversity**|23.6%|**76.4%**|38.0%|**62.0%**|13.6%|**86.4%**|32.4%|**67.6%**| -|**Empowerment**|32.4%|**67.6%**|38.8%|**61.2%**|16.4%|**83.6%**|42.8%|**57.2%**| -|**Overall**|32.4%|**67.6%**|38.8%|**61.2%**|15.2%|**84.8%**|40.0%|**60.0%**| +|**全面性**|32.4%|**67.6%**|38.4%|**61.6%**|16.4%|**83.6%**|38.8%|**61.2%**| +|**多样性**|23.6%|**76.4%**|38.0%|**62.0%**|13.6%|**86.4%**|32.4%|**67.6%**| +|**赋能性**|32.4%|**67.6%**|38.8%|**61.2%**|16.4%|**83.6%**|42.8%|**57.2%**| +|**总体**|32.4%|**67.6%**|38.8%|**61.2%**|15.2%|**84.8%**|40.0%|**60.0%**| ||RQ-RAG|**LightRAG**|RQ-RAG|**LightRAG**|RQ-RAG|**LightRAG**|RQ-RAG|**LightRAG**| -|**Comprehensiveness**|31.6%|**68.4%**|38.8%|**61.2%**|15.2%|**84.8%**|39.2%|**60.8%**| -|**Diversity**|29.2%|**70.8%**|39.2%|**60.8%**|11.6%|**88.4%**|30.8%|**69.2%**| -|**Empowerment**|31.6%|**68.4%**|36.4%|**63.6%**|15.2%|**84.8%**|42.4%|**57.6%**| -|**Overall**|32.4%|**67.6%**|38.0%|**62.0%**|14.4%|**85.6%**|40.0%|**60.0%**| +|**全面性**|31.6%|**68.4%**|38.8%|**61.2%**|15.2%|**84.8%**|39.2%|**60.8%**| +|**多样性**|29.2%|**70.8%**|39.2%|**60.8%**|11.6%|**88.4%**|30.8%|**69.2%**| +|**赋能性**|31.6%|**68.4%**|36.4%|**63.6%**|15.2%|**84.8%**|42.4%|**57.6%**| +|**总体**|32.4%|**67.6%**|38.0%|**62.0%**|14.4%|**85.6%**|40.0%|**60.0%**| ||HyDE|**LightRAG**|HyDE|**LightRAG**|HyDE|**LightRAG**|HyDE|**LightRAG**| -|**Comprehensiveness**|26.0%|**74.0%**|41.6%|**58.4%**|26.8%|**73.2%**|40.4%|**59.6%**| -|**Diversity**|24.0%|**76.0%**|38.8%|**61.2%**|20.0%|**80.0%**|32.4%|**67.6%**| -|**Empowerment**|25.2%|**74.8%**|40.8%|**59.2%**|26.0%|**74.0%**|46.0%|**54.0%**| -|**Overall**|24.8%|**75.2%**|41.6%|**58.4%**|26.4%|**73.6%**|42.4%|**57.6%**| +|**全面性**|26.0%|**74.0%**|41.6%|**58.4%**|26.8%|**73.2%**|40.4%|**59.6%**| +|**多样性**|24.0%|**76.0%**|38.8%|**61.2%**|20.0%|**80.0%**|32.4%|**67.6%**| +|**赋能性**|25.2%|**74.8%**|40.8%|**59.2%**|26.0%|**74.0%**|46.0%|**54.0%**| +|**总体**|24.8%|**75.2%**|41.6%|**58.4%**|26.4%|**73.6%**|42.4%|**57.6%**| ||GraphRAG|**LightRAG**|GraphRAG|**LightRAG**|GraphRAG|**LightRAG**|GraphRAG|**LightRAG**| -|**Comprehensiveness**|45.6%|**54.4%**|48.4%|**51.6%**|48.4%|**51.6%**|**50.4%**|49.6%| -|**Diversity**|22.8%|**77.2%**|40.8%|**59.2%**|26.4%|**73.6%**|36.0%|**64.0%**| -|**Empowerment**|41.2%|**58.8%**|45.2%|**54.8%**|43.6%|**56.4%**|**50.8%**|49.2%| -|**Overall**|45.2%|**54.8%**|48.0%|**52.0%**|47.2%|**52.8%**|**50.4%**|49.6%| +|**全面性**|45.6%|**54.4%**|48.4%|**51.6%**|48.4%|**51.6%**|**50.4%**|49.6%| +|**多样性**|22.8%|**77.2%**|40.8%|**59.2%**|26.4%|**73.6%**|36.0%|**64.0%**| +|**赋能性**|41.2%|**58.8%**|45.2%|**54.8%**|43.6%|**56.4%**|**50.8%**|49.2%| +|**总体**|45.2%|**54.8%**|48.0%|**52.0%**|47.2%|**52.8%**|**50.4%**|49.6%| -## 🔗 Related Projects +## 🔗 相关项目 -*Ecosystem & Extensions* +*生态与扩展*
@@ -436,7 +442,7 @@ LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across ag 📸RAG-Anything
- Multimodal RAG + 多模态 RAG @@ -463,21 +469,21 @@ LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across ag --- -## ⭐ Star History +## ⭐ Star 历史 [![Star History Chart](https://api.star-history.com/svg?repos=HKUDS/LightRAG&type=Date)](https://star-history.com/#HKUDS/LightRAG&Date) -## 🤝 Contribution +## 🤝 贡献
- We welcome contributions of all kinds — bug fixes, new features, documentation improvements, and more.
- Please read our Contributing Guide before submitting a pull request. + 我们欢迎各种形式的贡献——Bug 修复、新功能、文档改进等。
+ 提交 Pull Request 前,请阅读 贡献指南

- We thank all our contributors for their valuable contributions. + 我们感谢所有贡献者做出的宝贵贡献。
@@ -487,7 +493,7 @@ LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across ag
-## 📖 Citation +## 📖 引用 ```python @article{guo2024lightrag, @@ -508,13 +514,13 @@ primaryClass={cs.IR} @@ -523,7 +529,7 @@ primaryClass={cs.IR}
- Thank you for visiting LightRAG! + 感谢您访问 LightRAG!
@@ -445,7 +451,7 @@ LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across ag 🎥 VideoRAG
- Extreme Long-Context Video RAG + 极端长上下文视频 RAG
@@ -454,7 +460,7 @@ LightRAG consistently outperforms NaiveRAG, RQ-RAG, HyDE, and GraphRAG across ag MiniRAG
- Extremely Simple RAG + 极简 RAG