Guluji
官方使用文档

RAGFlow README

infiniflow/ragflow · Apache-2.0 · 源码版本 d7009351

上手导读

安装与准备

按 Docker 指南部署,再导入少量文档检查切分效果。

试用示例

团队维护手册问答时,可先导入相互接近的几个产品版本,检查回答是否能回到正确页、段落或表格。

官方 READMEREADME_zh.md

README in English 简体中文版自述文件 繁體版中文自述文件 日本語のREADME 한국어 README en Français Bahasa Indonesia Português(Brasil) README in Arabic Türkçe README Русская версия README

follow on X(Twitter) Static Badge RAGFlow Docker image downloads Latest Release license

RAGFlow in the GitHub Octoverse
infiniflow%2Fragflow | Trendshift
📕 目录

💡 RAGFlow 是什么?

RAGFlow 是一款领先的开源检索增强生成(RAG)引擎,通过融合前沿的 RAG 技术与 Agent 能力,为大型语言模型提供卓越的上下文层。它提供可适配任意规模企业的端到端 RAG 工作流,凭借融合式上下文引擎与预置的 Agent 模板,助力开发者以极致效率与精度将复杂数据转化为高可信、生产级的人工智能系统。

🎮 快速开始

请登录网址 https://cloud.ragflow.io 体验云服务。

如果想在本地部署,请参阅本地部署。

Chunking demonstration Agentic workflow demonstration

🔥 近期更新

  • 2026-11-06 发布 RAGFlow 1.0.0。
  • 2026-09-30 发布 RAGFlow 1.0.0-rc1。
  • 2026-09-10 支持通过 Sitemap 接入网站内容。
  • 2026-08-19 推出知识编译,支持在文档级和知识库级生成 Wiki、Graph、Tree、PageIndex、Mind Map、Timeline 及 Skills。
  • 2026-08-19 推出 Agentic RAG,支持 Low、Medium、High、Ultra 四种思考模式。
  • 2026-07-02 支持 Google BigQuery 数据源接入与增量同步。

更多更新请参阅完整发布记录。

🌟 主要功能

🍭 "Quality in, quality out"

  • 基于深度文档理解,能够从各类复杂格式的非结构化数据中提取真知灼见。
  • 真正在无限上下文(token)的场景下快速完成大海捞针测试。

🍱 基于模板的文本切片

  • 不仅仅是智能,更重要的是可控可解释。
  • 多种文本模板可供选择。

🧩 知识编译(Knowledge Compilation)

  • 支持文档级和知识库级编译,将原始内容组织为结构化的知识产物。
  • 通过编译模板生成 Wiki、Graph、Tree、PageIndex、Mind Map、Timeline 及 Skills,满足不同的知识组织和复用需求。
  • 支持配置编译模型与处理规则,并查看、更新和重新生成知识产物。

🧠 Agentic Retrieval

  • 面向复杂问题进行多步检索:模型会分析问题,并在需要时执行问题拆解、知识检索和证据核验。
  • 通过多轮检索与推理获取更完整的上下文,帮助生成有依据的回答。
  • 支持 Low、Medium、High、Ultra 思考模式,可按问题复杂度控制检索和推理深度。

🌱 有理有据、最大程度降低幻觉(hallucination)

  • 文本切片过程可视化,支持手动调整。
  • 有理有据:答案提供关键引用的快照并支持追根溯源。

🍔 兼容各类异构数据源

  • 支持丰富的文件类型,包括 Word 文档、PPT、Excel 表格、TXT 文件、图片、PDF、影印件、复印件、结构化数据、网页等。

🛀 全程无忧、自动化的 RAG 工作流

  • 自动化的 RAG 工作流可以支持从个人应用乃至超大型企业的各类生态系统。
  • 大语言模型 LLM 以及向量模型均支持配置。
  • 基于多路召回、融合重排序。
  • 提供易用的 API,可以轻松集成到各类企业系统。

🔎 系统架构

RAGFlow system architecture

🏠 本地部署

本地部署提供 Docker 部署和源码启动两种方式:Docker 适合快速体验、集成测试和生产部署;源码启动适合 RAGFlow 开发和调试。Docker 部署无需安装 Go 编译器,源码启动需要安装 go.mod 指定版本的 Go 编译器;前端开发还需要 Node.js 和 npm。

🐳 Docker 部署

📝 Docker 部署前提条件

  • 建议起步配置:4 核 CPU、16 GB 内存和 50 GB 可用磁盘。实际资源需求取决于文档引擎、数据规模、解析任务和并发量;启用本地模型或其他额外组件时,请同时满足相应组件的资源要求。
  • Docker ≥ 24.0.0,Docker Compose ≥ v2.26.1。

⚠️ 提示: 如果你尚未在本机安装 Docker(Windows、macOS 或 Linux),可以参考 Install Docker Engine 自行安装。

🚀 启动服务器

  1. 如果使用 Elasticsearch,将 Docker 宿主机的 vm.max_map_count 设置为至少 262144。使用 Infinity 时则不需要执行此步骤:

    如需确认 vm.max_map_count 的大小:

    sysctl vm.max_map_count

    如果使用 Elasticsearch 且 vm.max_map_count 的值小于 262144,可以进行重置:

    # 这里我们设为 262144:
    sudo sysctl -w vm.max_map_count=262144

    你的改动会在下次系统重启时被重置。如果希望做永久改动,还需要在 /etc/sysctl.conf 文件里把 vm.max_map_count 的值再相应更新一遍:

    vm.max_map_count=262144
  2. 克隆仓库:

    git clone https://github.com/infiniflow/ragflow.git
  3. 切换到发布标签并使用 Docker Compose 启动服务器:

    进入仓库中的 Docker 部署目录。

    cd ragflow/docker

    切换到 v1.0.0 发布标签。

    git checkout v1.0.0

    在启动 RAGFlow 服务及其依赖服务。

    docker compose -f docker-compose.yml up -d

    💡 镜像下载提示: 如果无法从默认仓库拉取镜像,请先在 docker/.env 中将 RAGFLOW_IMAGE 设置为以下镜像源之一,并保留 v1.0.0 标签:

    • 华为云:swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:v1.0.0
    • 阿里云:registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:v1.0.0

    默认 MySQL 配置下,镜像入口会先执行数据库迁移,再启动 Admin、Syncer、Ingestor 和 API 等服务。

    RAGFlow 开源版 1.0 的 DeepDoc 版面分析、OCR 和表格识别使用 CPU 推理。

  4. 服务器启动成功后再次确认服务器状态:

    使用 docker ps 检查依赖服务状态;依赖服务显示 healthy 且 RAGFlow 容器持续运行后,通过 HTTP 接口判断 RAGFlow 是否就绪(RAGFlow 容器本身未定义 Compose healthcheck):

    curl -f http://localhost/api/v1/system/healthz

    返回 HTTP 200 后,再访问 Web 页面。如果修改了 SVR_WEB_HTTP_PORT,请将健康检查地址中的端口替换为对应值。

    如果服务启动异常,再查看对应容器日志:

    docker logs --tail 50 ragflow-cpu
  5. 在你的浏览器中输入你的服务器对应的 IP 地址并登录 RAGFlow。

    上面这个例子中,您只需输入 http://IP_OF_YOUR_MACHINE 即可:未改动过配置则无需输入端口(默认的 HTTP 服务端口 80)。

  6. 登录 RAGFlow 后,在模型提供商页面添加 LLM、Embedding 和 Reranker,并填写对应的模型名称、服务地址和 API key。

    详见 llm_api_key_setup。

    好戏开始,接着奏乐接着舞!

详情请见 快速入门指南。

⚙️ Docker 配置与调整

Docker 部署使用 docker/.env 和 docker/docker-compose.yml。镜像、端口、密码、文档引擎及模型镜像源请按Docker 配置说明修改;平台支持(注意:macOS 暂不受支持)请参阅Go Docker 镜像构建与平台支持指南。源码构建 Docker 镜像请参阅Go Docker 镜像构建与平台支持指南。

切换文档引擎、修改配置后重启服务,以及保留或清理已有数据的操作,也请按照上述 Docker 配置文档执行。

🔨 以源代码启动

📝 源码启动前提条件

  1. 克隆仓库,并安装 go.mod 中指定版本的 Go 编译器(当前为 Go 1.27)、Clang 20、LLD 20、CMake ≥ 4.0、PCRE2 开发文件 CGO 依赖的静态库;build.sh 会设置所需的构建参数。

    git clone https://github.com/infiniflow/ragflow.git
    cd ragflow
  2. 运行一次依赖下载脚本,准备本地 Go 服务构建、运行、解析文档和统计 token 所需的全部资源。download_dev_deps.py 会下载原生静态库及运行时资源,包括 cl100k 词表、DeepDoc .ort 模型和 embedding 分词器资源:

    uv run tools/scripts/download_dev_deps.py

    本地开发只需运行这一个脚本;再次运行时会跳过已有文件,不会重复下载。用于镜像构建的 deps/download_deps.py 下载相同的运行时资源,但不下载原生 .a 静态库;仅在构建依赖镜像或 CI 中运行,本地开发无需额外执行。

    download_dev_deps.py 将 pdfium、pdf_oxide、office_oxide 和 onnxruntime 下载并解压到 ~/ragflow-native-libs,将 cl100k 词表、DeepDoc 模型和 embedding 分词器资源写入 deps/。该脚本使用 Python 编写,uv run 会自动安装其声明的依赖(requests 和 huggingface-hub)。如果已通过其他方式准备好相同资源,可跳过这一步。Go 服务从仓库根目录启动时会自动查找 internal/rag/res/deepdoc;如需从其他目录启动,请将 DEEPDOC_MODEL_DIR 设为该目录的绝对路径。

  3. 编译:

    ./build.sh --all
  4. 启动本地依赖服务,并确认 conf/service_conf.yaml 中的主机与端口对应宿主机可访问的地址。如果使用 Elasticsearch,还需先将 Docker 主机的 vm.max_map_count 设为至少 262144。

    sudo sysctl -w vm.max_map_count=262144
    docker compose --env-file docker/.env -f docker/docker-compose-base.yml up -d --wait es01 mysql minio nats kvrocks
  5. 启动 RAGFlow:

    ./bin/ragflow_server

    开源版在一个 Go 进程中运行所有服务。启动时先执行数据库迁移,启动 Admin 并初始化超级管理员,随后启动 API、Ingestor、Syncer 和 Chatter。Admin 默认监听 9381 端口,API 默认监听 9380 端口。停止该进程会停止所有服务。服务设置通过 conf/service_conf.yaml 或环境变量配置。

  6. 运行 ./bin/ragflow_server --help 查看可用启动参数。

  7. 仅在前端开发时安装 Node.js 和 npm,然后启动 React 前端:

    cd web
    npm install

    服务启动后,运行下面命令来确认 API 服务已就绪:

    curl -f http://127.0.0.1:9380/api/v1/system/healthz

    返回 HTTP 200 表示 API 可以正常响应。前端 和 DeepDoc 的完整验证步骤请参阅从源代码启动服务。

详情请见 从源代码启动服务。

📚 技术文档

📜 路线图

详见 RAGFlow Roadmap 2026 。

🏄 开源社区

🙌 贡献指南

RAGFlow 只有通过开源协作才能蓬勃发展。秉持这一精神,我们欢迎来自社区的各种贡献。如果您有意参与其中,请查阅我们的贡献者指南。

🤝 商务合作

👥 加入社区

扫二维码添加 RAGFlow 小助手,进 RAGFlow 交流群。

RAGFlow assistant QR code

原作者与许可证

文档来自 infiniflow/ragflow 的上述提交,保留原文并调整了站内排版与链接。

查看仓库许可证原文 ↗
                                 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 [yyyy] [name of copyright owner]

   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.
返回 RAGFlow 项目分析