UltraRAG README
OpenBMB/UltraRAG · Apache-2.0 · 源码版本 5f48fff0
上手导读
安装与准备
按官方示例准备语料,再运行第一条检索流程。
试用示例
做检索增强实验时,可以固定问题集,逐步更换检索与生成环节,用相同样本观察哪一步让答案改善。
更少代码,更低门槛,更快实现
简体中文 | English
更新日志 🔥
- [2026.01.23] 🎉 UltraRAG 3.0 发布:拒绝"盲盒"开发,让每一行推理逻辑都清晰可见 👉 📖 博客
- [2026.01.20] 🎉 发布 AgentCPM-Report 模型!DeepResearch 终于本地化了:8B 端侧写作智能体 AgentCPM-Report 开源 👉 🤗 模型
历史更新
- [2025.11.11] 🎉 UltraRAG 2.1 更新:强化知识接入与多模态支持,完善统一评估体系!
- [2025.09.23] 新增每日 RAG 论文分享,每日更新最新前沿 RAG 工作 👉 📖 论文
- [2025.09.09] 发布轻量级 DeepResearch Pipeline 本地搭建教程 👉 📺 bilibili · 📖 博客
- [2025.09.01] 发布 UltraRAG 安装与完整 RAG 跑通视频 👉 📺 bilibili · 📖 博客
- [2025.08.28] 🎉 发布 UltraRAG 2.0!UltraRAG 2.0 全新升级:几十行代码实现高性能 RAG,让科研专注思想创新!我们保留了 UltraRAG v2 的代码,可以点击 v2 查看。
- [2025.01.23] 发布 UltraRAG!让大模型读懂善用知识库!我们保留了UltraRAG 1.0的代码,可以点击 v1 查看。
💡 关于 UltraRAG
UltraRAG 是由清华大学 THUNLP 实验室、东北大学 NEUIR 实验室、OpenBMB 与 AI9stars 联合推出的首个基于 Model Context Protocol (MCP) 架构设计的轻量级 RAG 开发框架。
专为科研探索与工业原型设计打造,UltraRAG 将 RAG 中的核心组件(Retriever、Generation 等)标准化封装为独立的 MCP Server,配合 MCP Client 强大的流程调度能力,开发者仅需通过 YAML 配置,即可实现对条件分支、循环等复杂控制结构的精确编排。
🖥️ UltraRAG UI
UltraRAG UI 突破了传统对话界面的边界,演进为集编排、调试与演示于一体的 可视化的 RAG 全流程集成开发环境。
系统内置强大的 Pipeline Builder,支持'画布搭建'与'代码编辑'的双向实时同步,并允许在线精细化调整 Pipeline 参数与 Prompt;更引入了 智能 AI 助手,深度辅助 Pipeline 结构设计、参数调优及 Prompt 生成的全开发流程。构建完成的逻辑流可 一键转化 为交互式对话系统,并无缝集成 知识库管理组件,支持用户构建专属知识库进行文档问答,真正实现了从底层逻辑构建、数据治理到应用部署的一站式闭环。
UltraRAG.mp4
✨ 核心亮点
|
🚀 低代码编排复杂流程 推理编排:原生支持串行、循环与条件分支等控制结构。开发者仅需编写 YAML 配置文件,即可在数十行代码内实现复杂的迭代式 RAG 逻辑。 |
⚡ 模块化扩展与复现 原子化 Server:基于 MCP 架构将功能解耦为独立 Server。新功能仅需以函数级 Tool 形式注册,即可无缝接入流程,实现极高的复用性。 |
|
📊 统一评测与基准对比 科研提效:内置标准化评测流程,开箱即用主流科研 Benchmark。通过统一指标管理与基线集成,大幅提升实验的可复现性与对比效率。 |
✨ 交互原型快速生成 一键交付:告别繁琐的 UI 开发。仅需一行命令,即可将 Pipeline 逻辑瞬间转化为可交互的对话式 Web UI,缩短从算法到演示的距离。 |
📦 安装
我们提供了两种安装方式:本地源码安装(推荐使用 uv 进行包管理)和 Docker 容器部署
方式一:源码安装
我们强烈推荐使用 uv 来管理 Python 环境与依赖,它能极大地提升安装速度。
准备环境
如果您尚未安装 uv,请先执行:
## 直接安装 python -m pip install --upgrade "pip>=26.2.2" "uv==0.13.7" ## 下载 curl -LsSf https://astral.sh/uv/0.12.0/install.sh | sh
下载源码
git clone https://github.com/OpenBMB/UltraRAG.git --depth 1
cd UltraRAG安装依赖
请根据您的使用场景,选择一种模式安装依赖:
A:创建新环境 使用 uv sync 自动创建虚拟环境并同步依赖:
-
核心依赖:如果您只需运行基础核心功能,如只使用 UltraRAG UI:
uv sync
默认安装支持本地执行模式。
build、run和show ui加上--no-mcp后,本地流水线不会启动 MCP 服务进程。 -
如需使用未加
--no-mcp的原有 MCP 模式,安装可选依赖:uv sync --extra mcp
无 MCP 模式的流水线如果包含远程 MCP 服务,也需要安装此依赖。
-
全量安装:如果您希望完整体验 UltraRAG 的检索、生成、语料处理及评测功能,请运行:
uv sync --all-extras
这是推荐的团队安装方式:所有 MCP Server 共用同一个
.venv和uv.lock。Linux GPU 依赖统一锁定在 CUDA 12.9,包括官方 vLLM cu129 wheel。 -
按需安装:如果您只需运行指定模块,请保留对应
--extra,例如:uv sync --extra retriever # 检索模块 uv sync --extra generation # 生成模块
安装完成后,激活虚拟环境:
# Windows CMD .venv\Scripts\activate.bat # Windows Powershell .venv\Scripts\Activate.ps1 # macOS / Linux source .venv/bin/activate
B:安装至已有环境 如果您希望将 UltraRAG 安装到当前已激活的 Python 环境中,请使用 uv pip:
# 核心依赖 uv pip install -e . # 原有 MCP 执行模式 uv pip install -e ".[mcp]" # 全量安装 uv pip install -e ".[all]" # 按需安装 uv pip install -e ".[retriever]"
方式二:Docker 容器部署
如果您不想配置本地 Python 环境,可以使用 Docker 一键启动。
获取代码与镜像
# 1. 下载代码 git clone https://github.com/OpenBMB/UltraRAG.git --depth 1 cd UltraRAG # 2. 准备镜像 (二选一) # 选项 A:从 Docker Hub 拉取 docker pull hdxin2002/ultrarag:latest-base-cpu # 核心依赖 (CPU) docker pull hdxin2002/ultrarag:latest-base-gpu # 核心依赖 (GPU 基础镜像) docker pull hdxin2002/ultrarag:latest # 全量依赖 (GPU) # 选项 B:本地构建 docker build -f Dockerfile.base-cpu -t ultrarag:latest-base-cpu . # CPU docker build -t ultrarag:latest . # 完整 GPU 镜像
每日构建流程在 UTC 00:00(北京时间 08:00)检查 main,有最近 24 小时内的
提交时更新 latest 系列标签,也可手动触发强制重建。原有的 v0.3.0、
v0.3.0-base-cpu、v0.3.0-base-gpu 标签继续与新标签一起发布。这些标签会更新;
需要可复现部署时,请固定镜像 digest。
三个镜像均包含编译后的前端,以及远程 HTTP MCP 所需的 Node.js 22 和 npm/npx。
基础镜像安装核心 Python 依赖与默认启动命令需要的 mcp extra;使用本地检索或生成后端时,请按需安装对应 extras。
启动容器
# CPU:无需 GPU 运行时 docker run --rm -it -p 5050:5050 hdxin2002/ultrarag:latest-base-cpu # GPU:需安装 NVIDIA Container Toolkit docker run --rm -it --gpus all -p 5050:5050 hdxin2002/ultrarag:latest
提示:容器启动后会自动运行 UltraRAG UI,您可以直接在浏览器访问 http://localhost:5050 使用。
验证安装
安装完成后,运行以下示例命令来检查环境是否正常:
ultrarag build examples/experiments/sayhello.yaml --no-mcp ultrarag run examples/experiments/sayhello.yaml --no-mcp
通过 ultrarag show ui --no-mcp 为 UI 会话和知识库任务选择本地执行模式。
Python API 对应使用 initialize(..., no_mcp=True) 或
PipelineCall(..., no_mcp=True)。两种模式共用流水线 YAML 和参数文件。
本地服务脚本需通过 UltraRAG_MCP_Server 注册;直接使用 FastMCP 的脚本需要迁移注册方式,或继续使用默认 MCP 模式。
本地模式支持注册的工具和提示词;FastMCP 专用的 Context 注入、鉴权、中间件和资源需使用 MCP 模式。
长期运行的 Python 应用结束使用 ToolCall 后,应调用 ultrarag.api.shutdown();
在异步函数中使用 await shutdown()。
看到以下输出即代表安装成功:
Hello, UltraRAG v3!
🚀 快速开始
我们提供了从入门到进阶的完整教学示例,无论您是进行学术研究还是构建工业级应用,都能在这里找到指引。欢迎访问教程文档 获取更多细节。
🔬 科研实验
专为研究人员设计,提供数据、实验流程与可视化分析工具。
- 实验上手:了解如何基于 UltraRAG 快速跑通标准的 RAG 实验流程。
- 评测数据:下载 RAG 领域最常用的公开评测数据集以及大规模检索语料库,直接用于科研基准测试。
- 案例分析:提供可视化的 Case Study 界面,深入追踪工作流的每一步中间输出,辅助分析与错误归因。
- 结构化排障指南:当回答结果可疑、检索命中不稳定、推理链路漂移或部署后行为异常时,可按输入与检索、推理与规划、状态与上下文、部署与运行四个层级进行快速排查。
- 代码集成:了解如何在 Python 代码中直接调用 UltraRAG 组件,实现更灵活的定制化开发。
🛠️ 演示系统
专为开发者与最终用户设计,提供完整的 UI 交互与复杂应用案例。
- 快速启动:了解如何启动 UltraRAG UI,并熟悉管理员模式下的各项高级配置。
- 部署指南:详细的生产环境部署教程,涵盖检索器 (Retriever)、生成模型 (LLM) 以及 Milvus 向量库的搭建。
- 深度研究:旗舰案例,部署一个深度研究 Pipeline。配合 AgentCPM-Report 模型,可自动执行多步检索与整合,生成数万字的综述报告。
🤝 贡献
感谢以下贡献者在代码提交和测试中的付出。我们也欢迎新的成员加入,共同构建完善的 RAG 生态!
您可以通过以下标准流程来贡献:Fork 本仓库 → 提交 Issue → 发起 Pull Request (PR)。
⭐ 支持我们
如果您觉得本项目对您的研究有所帮助,欢迎点亮一颗 ⭐ 来支持我们!
💬 联系我们
- 关于技术问题及功能请求,请使用 GitHub Issues 功能。
- 关于使用上的问题、意见以及任何关于 RAG 技术的讨论,欢迎加入我们的微信群组,飞书群组和discord,与我们共同交流。
- 如果您有任何疑问、反馈或想与我们取得联系,请随时通过电子邮件发送至 yanyk.thu@gmail.com。
![]() 微信群组 |
![]() 飞书群组 |
Discord |
原作者与许可证
文档来自 OpenBMB/UltraRAG 的上述提交,保留原文并调整了站内排版与链接。
查看仓库许可证原文 ↗ Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023 OpenBMB
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

