能力标签
LightRAG AI技能包
🛠
AI工具

LightRAG AI技能包

基于 Python · 开源免费,本地部署,数据完全自主可控
英文名:LightRAG
⭐ 35.2k Stars 🍴 5.0k Forks 💻 Python 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
RAG系统知识图谱检索增强生成LLM应用开源框架
✦ AI Skill Hub 推荐

LightRAG AI技能包 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 35.2k 颗 Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

LightRAG AI技能包 是一款基于 Python 的开源工具,在 GitHub 上收获 35k+ Star,是RAG系统、知识图谱、检索增强生成、LLM应用领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
LightRAG AI技能包 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 LightRAG AI技能包 的版本更新,及时通知重要功能变化。

📋 工具概览

EMNLP2025论文开源实现,提供简洁高效的检索增强生成系统。相比GraphRAG更轻量,支持知识图谱集成,适合开发者快速构建AI问答和内容生成应用,降低企业知识库的AI化成本。

LightRAG AI技能包 是一款基于 Python 开发的开源工具,专注于 RAG系统、知识图谱、检索增强生成 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 35.2k
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
活跃维护,更新频繁
开源协议
MIT
AI 综合评分
8.2 分
工具类型
AI工具
Forks
5.0k

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

EMNLP2025论文开源实现,提供简洁高效的检索增强生成系统。相比GraphRAG更轻量,支持知识图谱集成,适合开发者快速构建AI问答和内容生成应用,降低企业知识库的AI化成本。

LightRAG AI技能包 是一款基于 Python 开发的开源工具,专注于 RAG系统、知识图谱、检索增强生成 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:pip 安装(推荐)
pip install lightrag

# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install lightrag

# 方式三:从源码安装(获取最新功能)
git clone https://github.com/HKUDS/LightRAG
cd LightRAG
pip install -e .

# 验证安装
python -c "import lightrag; print('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
lightrag --help

# 基本用法
lightrag input_file -o output_file

# Python 代码中调用
import lightrag

# 示例
result = lightrag.process("input")
print(result)
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# lightrag 配置文件示例(config.yml)
app:
  name: "lightrag"
  debug: false
  log_level: "INFO"

# 运行时指定配置文件
lightrag --config config.yml

# 或通过环境变量配置
export LIGHTRAG_API_KEY="your-key"
export LIGHTRAG_OUTPUT_DIR="./output"
📑 README 深度解析 真实文档 完整度 79/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

LightRAG Logo

Advanced Features

LightRAG provides additional capabilities including token usage tracking, knowledge graph data export, LLM cache management, Langfuse observability integration, and RAGAS-based evaluation. See docs/AdvancedFeatures.md.

LLM and Technology Stack Requirements for LightRAG

LightRAG's demands on the capabilities of Large Language Models (LLMs) are significantly higher than those of traditional RAG, as it requires the LLM to perform entity-relationship extraction tasks from documents. Configuring appropriate Embedding and Reranker models is also crucial for improving query performance.

  • LLM Selection:
  • It is recommended to use an LLM with at least 32 billion parameters.
  • The context length should be at least 32KB, with 64KB being recommended.
  • It is not recommended to choose reasoning models during the document indexing stage.
  • During the query stage, it is recommended to choose models with stronger capabilities than those used in the indexing stage to achieve better query results.
  • Embedding Model:
  • A high-performance Embedding model is essential for RAG.
  • We recommend using mainstream multilingual Embedding models, such as: BAAI/bge-m3 and text-embedding-3-large.
  • Important Note: The Embedding model must be determined before document indexing, and the same model must be used during the document query phase. For certain storage solutions (e.g., PostgreSQL), the vector dimension must be defined upon initial table creation. Therefore, when changing embedding models, it is necessary to delete the existing vector-related tables and allow LightRAG to recreate them with the new dimensions.
  • Reranker Model Configuration:
  • Configuring a Reranker model can significantly enhance LightRAG's retrieval performance.
  • When a Reranker model is enabled, it is recommended to set the "mix mode" as the default query mode.
  • We recommend using mainstream Reranker models, such as: BAAI/bge-reranker-v2-m3 or models provided by services like Jina.

Installation

💡 Using uv for Package Management: This project uses 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)

Note: You can also use pip if you prefer, but uv is recommended for better performance and more reliable dependency management. 📦 Offline Deployment: For offline or air-gapped environments, see the Offline Deployment Guide for instructions on pre-installing all dependencies and cache files.

Install LightRAG Server

The LightRAG Server is designed to provide Web UI and API support. The Web UI facilitates document indexing, knowledge graph exploration, and a simple RAG query interface. LightRAG Server also provide an Ollama compatible interfaces, aiming to emulate LightRAG as an Ollama chat model. This allows AI chat bot, such as Open WebUI, to access LightRAG easily.

  • Install from PyPI

```bash

pip install "lightrag-hku[api]"

Build front-end artifacts

cd lightrag_webui bun install --frozen-lockfile bun run build cd ..

Setup env file

make dev installs the test toolchain plus the full offline stack

(API, storage backends, and provider integrations), then builds the frontend.

Or using pip with virtual environment

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

Create .env File With Setup Tool

Instead of editing env.example by hand, use the interactive setup wizard to generate a configured .env and, when needed, docker-compose.final.yml:

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

For full description of every target see docs/InteractiveSetup.md. The setup wizards update configuration only; run make env-security-check separately to audit the current .env for security risks before deployment. By default, rerunning the setup preserves unchanged wizard-managed compose service blocks; use a *-rewrite target only when you need to rebuild those managed blocks from the bundled templates.

Install LightRAG Core

  • Install from source (Recommended)

```bash cd LightRAG

Or: pip install -e .


* Install from PyPI
bash uv pip install lightrag-hku

Or: pip install lightrag-hku

```

Obtain the env.example file by downloading it from the GitHub repository root

Run make env-base or copy env.example to .env before starting the server.

Quick Start

Quick Start for LightRAG Server

The LightRAG Server is designed to provide Web UI and API support. The LightRAG Server offers a comprehensive knowledge graph visualization feature. It supports various gravity layouts, node queries, subgraph filtering, and more. For more information about LightRAG Server, please refer to LightRAG Server.

iShot_2025-03-23_12.40.08

Quick Start for LightRAG core

To get started with LightRAG core, refer to the sample codes available in the examples folder. Additionally, a video demo 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:

```bash

you should run the demo code with project folder

cd LightRAG

download the demo document of "A Christmas Carol" by Charles Dickens

curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_data.txt > ./book.txt

run the demo code

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.

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.

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.

python -m venv .venv

source .venv/bin/activate # Windows: .venv\Scripts\activate

Or on Windows: .venv\Scripts\activate

Note: uv sync automatically creates a virtual environment in .venv/

uv sync --extra test --extra offline source .venv/bin/activate # Activate the virtual environment (Linux/macOS)

Or on Windows: .venv\Scripts\activate

python -m venv .venv

source .venv/bin/activate # Windows: .venv\Scripts\activate

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) Official GHCR images published by GitHub Actions are signed with Sigstore Cosign using GitHub OIDC. See docs/DockerDeployment.md for verification commands.

Note: uv sync automatically creates a virtual environment in .venv/

uv sync source .venv/bin/activate # Activate the virtual environment (Linux/macOS)

Or on Windows: .venv\Scripts\activate

Launch API-WebUI server

lightrag-server


* Launching the LightRAG Server with Docker Compose
bash git clone https://github.com/HKUDS/LightRAG.git cd LightRAG cp env.example .env # Update the .env with your LLM and embedding configurations

provide your API-KEY for OpenAI

export OPENAI_API_KEY="sk-...your_opeai_key..."

🇨🇳 中文文档镜像 AI 翻译 2026-06-01
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

LightRAG 是一个先进的检索增强生成(RAG)框架,旨在通过结合知识图谱技术提升问答质量。本项目不仅支持高效的文档索引,还提供了直观的 Web UI 用于知识图谱的探索与交互,是构建智能化知识库系统的理想选择。

⚡ 功能介绍

LightRAG 提供了丰富的进阶功能,包括 Token 使用量追踪、知识图谱数据导出以及 LLM 缓存管理。此外,它还集成了 Langfuse 用于可观测性分析,并支持基于 RAGAS 的评估框架,帮助开发者全面监控和优化 RAG 系统的性能。

📋 环境依赖

由于 LightRAG 需要 LLM 执行复杂的实体关系提取任务,其对大语言模型(LLM)的能力要求显著高于传统 RAG 系统。开发者需确保配置了具备强大推理能力的 LLM 以及高性能的 Embedding 模型,以保证知识图谱构建的准确性。

🛠 安装步骤(Docker/pip/源码)

推荐使用 uv 进行快速、可靠的包管理。你可以通过 `uv tool install "lightrag-hku[api]"` 安装 LightRAG Server。此外,项目也支持通过 PyPI 安装,或者使用 Docker Compose 进行容器化部署,以实现更便捷的环境隔离与运行。

🚀 使用教程

在使用前,请先从 GitHub 下载 `env.example` 文件并将其重命名为 `.env`。在启动服务前,务必根据你的 LLM 和 Embedding 配置更新 `.env` 文件中的相关参数,确保环境配置正确。

⚙️ 配置说明(含 MCP / env)

项目通过 `.env` 文件进行环境配置。在启动开发环境前,建议使用 `make dev` 进行初始化。若需使用 OpenAI 服务,请确保在环境变量中正确设置 `OPENAI_API_KEY`。对于 Docker 用户,请在克隆仓库后通过 `cp env.example .env` 完成配置。

🔌 API 说明

LightRAG Server 提供 Web UI 界面用于文档索引和知识图谱探索,并提供标准的 API 支持。特别地,它提供了兼容 Ollama 的接口,能够模拟为 Ollama chat 模型,从而让 Open WebUI 等 AI 聊天机器人能够无缝接入 LightRAG 能力。

🎯 aiskill88 AI 点评 A 级 2026-05-22

EMNLP顶会论文实现,简洁优雅的RAG架构设计。相比复杂系统更易部署,兼顾性能与实用性,适合中小团队快速迭代。活跃维护,工程质量可靠。

📚 实用指南(长尾问题)
适合谁
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • Docker:LightRAG 提供官方镜像,docker compose up 一键启动
  • 本地部署:CPU 8GB 起,GPU 推荐 16GB+ 显存
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
LightRAG 中文教程LightRAG 安装报错怎么办LightRAG Docker 部署LightRAG 与同类工具对比LightRAG 最佳实践LightRAG 适合谁用

⚡ 核心功能

👥 适合谁
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +GitHub 35.2k Star,社区高度认可
  • +MIT 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

轻量级设计,部署和运维成本更低,速度更快,同时保持竞争力的效果。
💡 AI Skill Hub 点评

经综合评估,LightRAG AI技能包 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 LightRAG AI技能包
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 LightRAG
原始描述 开源AI工具:EMNLP2025 "LightRAG: Simple and Fast Retrieval-Augmented Generation"。⭐35.2k · Python
Topics RAG系统知识图谱检索增强生成LLM应用开源框架
GitHub https://github.com/HKUDS/LightRAG
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/HKUDS/LightRAG 🌐 官方网站  https://arxiv.org/abs/2410.05779

收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →