Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <div align="center">
  2. <a href="https://demo.ragflow.io/">
  3. <img src="web/src/assets/logo-with-text.png" width="350" alt="ragflow logo">
  4. </a>
  5. </div>
  6. <p align="center">
  7. <a href="./README.md">English</a> |
  8. <a href="./README_zh.md">简体中文</a> |
  9. <a href="./README_tzh.md">繁体中文</a> |
  10. <a href="./README_ja.md">日本語</a> |
  11. <a href="./README_ko.md">한국어</a> |
  12. <a href="./README_id.md">Bahasa Indonesia</a> |
  13. <a href="/README_pt_br.md">Português (Brasil)</a>
  14. </p>
  15. <p align="center">
  16. <a href="https://x.com/intent/follow?screen_name=infiniflowai" target="_blank">
  17. <img src="https://img.shields.io/twitter/follow/infiniflow?logo=X&color=%20%23f5f5f5" alt="follow on X(Twitter)">
  18. </a>
  19. <a href="https://demo.ragflow.io" target="_blank">
  20. <img alt="Static Badge" src="https://img.shields.io/badge/Online-Demo-4e6b99">
  21. </a>
  22. <a href="https://hub.docker.com/r/infiniflow/ragflow" target="_blank">
  23. <img src="https://img.shields.io/badge/docker_pull-ragflow:v0.19.0-brightgreen" alt="docker pull infiniflow/ragflow:v0.19.0">
  24. </a>
  25. <a href="https://github.com/infiniflow/ragflow/releases/latest">
  26. <img src="https://img.shields.io/github/v/release/infiniflow/ragflow?color=blue&label=Latest%20Release" alt="Latest Release">
  27. </a>
  28. <a href="https://github.com/infiniflow/ragflow/blob/main/LICENSE">
  29. <img height="21" src="https://img.shields.io/badge/License-Apache--2.0-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="license">
  30. </a>
  31. <a href="https://deepwiki.com/infiniflow/ragflow">
  32. <img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg">
  33. </a>
  34. </p>
  35. <h4 align="center">
  36. <a href="https://ragflow.io/docs/dev/">Document</a> |
  37. <a href="https://github.com/infiniflow/ragflow/issues/4214">Roadmap</a> |
  38. <a href="https://twitter.com/infiniflowai">Twitter</a> |
  39. <a href="https://discord.gg/NjYzJD3GM3">Discord</a> |
  40. <a href="https://demo.ragflow.io">Demo</a>
  41. </h4>
  42. ## 💡 RAGFlow 是什么?
  43. [RAGFlow](https://ragflow.io/) 是一款基于深度文档理解构建的开源 RAG(Retrieval-Augmented Generation)引擎。RAGFlow 可以为各种规模的企业及个人提供一套精简的 RAG 工作流程,结合大语言模型(LLM)针对用户各类不同的复杂格式数据提供可靠的问答以及有理有据的引用。
  44. ## 🎮 Demo 试用
  45. 请登录网址 [https://demo.ragflow.io](https://demo.ragflow.io) 试用 demo。
  46. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  47. <img src="https://github.com/infiniflow/ragflow/assets/7248/2f6baa3e-1092-4f11-866d-36f6a9d075e5" width="1200"/>
  48. <img src="https://github.com/user-attachments/assets/504bbbf1-c9f7-4d83-8cc5-e9cb63c26db6" width="1200"/>
  49. </div>
  50. ## 🔥 近期更新
  51. - 2025-03-19 PDF和DOCX中的图支持用多模态大模型去解析得到描述.
  52. - 2025-02-28 结合互联网搜索(Tavily),对于任意大模型实现类似 Deep Research 的推理功能.
  53. - 2025-01-26 优化知识图谱的提取和应用,提供了多种配置选择。
  54. - 2024-12-18 升级了 DeepDoc 的文档布局分析模型。
  55. - 2024-11-01 对解析后的 chunk 加入关键词抽取和相关问题生成以提高召回的准确度。
  56. - 2024-08-22 支持用 RAG 技术实现从自然语言到 SQL 语句的转换。
  57. ## 🎉 关注项目
  58. ⭐️ 点击右上角的 Star 关注 RAGFlow,可以获取最新发布的实时通知 !🌟
  59. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  60. <img src="https://github.com/user-attachments/assets/18c9707e-b8aa-4caf-a154-037089c105ba" width="1200"/>
  61. </div>
  62. ## 🌟 主要功能
  63. ### 🍭 **"Quality in, quality out"**
  64. - 基于[深度文档理解](./deepdoc/README.md),能够从各类复杂格式的非结构化数据中提取真知灼见。
  65. - 真正在无限上下文(token)的场景下快速完成大海捞针测试。
  66. ### 🍱 **基于模板的文本切片**
  67. - 不仅仅是智能,更重要的是可控可解释。
  68. - 多种文本模板可供选择
  69. ### 🌱 **有理有据、最大程度降低幻觉(hallucination)**
  70. - 文本切片过程可视化,支持手动调整。
  71. - 有理有据:答案提供关键引用的快照并支持追根溯源。
  72. ### 🍔 **兼容各类异构数据源**
  73. - 支持丰富的文件类型,包括 Word 文档、PPT、excel 表格、txt 文件、图片、PDF、影印件、复印件、结构化数据、网页等。
  74. ### 🛀 **全程无忧、自动化的 RAG 工作流**
  75. - 全面优化的 RAG 工作流可以支持从个人应用乃至超大型企业的各类生态系统。
  76. - 大语言模型 LLM 以及向量模型均支持配置。
  77. - 基于多路召回、融合重排序。
  78. - 提供易用的 API,可以轻松集成到各类企业系统。
  79. ## 🔎 系统架构
  80. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  81. <img src="https://github.com/infiniflow/ragflow/assets/12318111/d6ac5664-c237-4200-a7c2-a4a00691b485" width="1000"/>
  82. </div>
  83. ## 🎬 快速开始
  84. ### 📝 前提条件
  85. - CPU >= 4 核
  86. - RAM >= 16 GB
  87. - Disk >= 50 GB
  88. - Docker >= 24.0.0 & Docker Compose >= v2.26.1
  89. - [gVisor](https://gvisor.dev/docs/user_guide/install/): 仅在你打算使用 RAGFlow 的代码执行器(沙箱)功能时才需要安装。
  90. > [!TIP]
  91. > 如果你并没有在本机安装 Docker(Windows、Mac,或者 Linux), 可以参考文档 [Install Docker Engine](https://docs.docker.com/engine/install/) 自行安装。
  92. ### 🚀 启动服务器
  93. 1. 确保 `vm.max_map_count` 不小于 262144:
  94. > 如需确认 `vm.max_map_count` 的大小:
  95. >
  96. > ```bash
  97. > $ sysctl vm.max_map_count
  98. > ```
  99. >
  100. > 如果 `vm.max_map_count` 的值小于 262144,可以进行重置:
  101. >
  102. > ```bash
  103. > # 这里我们设为 262144:
  104. > $ sudo sysctl -w vm.max_map_count=262144
  105. > ```
  106. >
  107. > 你的改动会在下次系统重启时被重置。如果希望做永久改动,还需要在 **/etc/sysctl.conf** 文件里把 `vm.max_map_count` 的值再相应更新一遍:
  108. >
  109. > ```bash
  110. > vm.max_map_count=262144
  111. > ```
  112. 2. 克隆仓库:
  113. ```bash
  114. $ git clone https://github.com/infiniflow/ragflow.git
  115. ```
  116. 3. 进入 **docker** 文件夹,利用提前编译好的 Docker 镜像启动服务器:
  117. > [!CAUTION]
  118. > 请注意,目前官方提供的所有 Docker 镜像均基于 x86 架构构建,并不提供基于 ARM64 的 Docker 镜像。
  119. > 如果你的操作系统是 ARM64 架构,请参考[这篇文档](https://ragflow.io/docs/dev/build_docker_image)自行构建 Docker 镜像。
  120. > 运行以下命令会自动下载 RAGFlow slim Docker 镜像 `v0.19.0-slim`。请参考下表查看不同 Docker 发行版的描述。如需下载不同于 `v0.19.0-slim` 的 Docker 镜像,请在运行 `docker compose` 启动服务之前先更新 **docker/.env** 文件内的 `RAGFLOW_IMAGE` 变量。比如,你可以通过设置 `RAGFLOW_IMAGE=infiniflow/ragflow:v0.19.0` 来下载 RAGFlow 镜像的 `v0.19.0` 完整发行版。
  121. ```bash
  122. $ cd ragflow/docker
  123. # Use CPU for embedding and DeepDoc tasks:
  124. $ docker compose -f docker-compose.yml up -d
  125. # To use GPU to accelerate embedding and DeepDoc tasks:
  126. # docker compose -f docker-compose-gpu.yml up -d
  127. ```
  128. | RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
  129. | ----------------- | --------------- | --------------------- | ------------------------ |
  130. | v0.19.0 | &approx;9 | :heavy_check_mark: | Stable release |
  131. | v0.19.0-slim | &approx;2 | ❌ | Stable release |
  132. | nightly | &approx;9 | :heavy_check_mark: | _Unstable_ nightly build |
  133. | nightly-slim | &approx;2 | ❌ | _Unstable_ nightly build |
  134. > [!TIP]
  135. > 如果你遇到 Docker 镜像拉不下来的问题,可以在 **docker/.env** 文件内根据变量 `RAGFLOW_IMAGE` 的注释提示选择华为云或者阿里云的相应镜像。
  136. >
  137. > - 华为云镜像名:`swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow`
  138. > - 阿里云镜像名:`registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow`
  139. 4. 服务器启动成功后再次确认服务器状态:
  140. ```bash
  141. $ docker logs -f ragflow-server
  142. ```
  143. _出现以下界面提示说明服务器启动成功:_
  144. ```bash
  145. ____ ___ ______ ______ __
  146. / __ \ / | / ____// ____// /____ _ __
  147. / /_/ // /| | / / __ / /_ / // __ \| | /| / /
  148. / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
  149. /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
  150. * Running on all addresses (0.0.0.0)
  151. ```
  152. > 如果您在没有看到上面的提示信息出来之前,就尝试登录 RAGFlow,你的浏览器有可能会提示 `network anormal` 或 `网络异常`。
  153. 5. 在你的浏览器中输入你的服务器对应的 IP 地址并登录 RAGFlow。
  154. > 上面这个例子中,您只需输入 http://IP_OF_YOUR_MACHINE 即可:未改动过配置则无需输入端口(默认的 HTTP 服务端口 80)。
  155. 6. 在 [service_conf.yaml.template](./docker/service_conf.yaml.template) 文件的 `user_default_llm` 栏配置 LLM factory,并在 `API_KEY` 栏填写和你选择的大模型相对应的 API key。
  156. > 详见 [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup)。
  157. _好戏开始,接着奏乐接着舞!_
  158. ## 🔧 系统配置
  159. 系统配置涉及以下三份文件:
  160. - [.env](./docker/.env):存放一些基本的系统环境变量,比如 `SVR_HTTP_PORT`、`MYSQL_PASSWORD`、`MINIO_PASSWORD` 等。
  161. - [service_conf.yaml.template](./docker/service_conf.yaml.template):配置各类后台服务。
  162. - [docker-compose.yml](./docker/docker-compose.yml): 系统依赖该文件完成启动。
  163. 请务必确保 [.env](./docker/.env) 文件中的变量设置与 [service_conf.yaml.template](./docker/service_conf.yaml.template) 文件中的配置保持一致!
  164. 如果不能访问镜像站点 hub.docker.com 或者模型站点 huggingface.co,请按照 [.env](./docker/.env) 注释修改 `RAGFLOW_IMAGE` 和 `HF_ENDPOINT`。
  165. > [./docker/README](./docker/README.md) 解释了 [service_conf.yaml.template](./docker/service_conf.yaml.template) 用到的环境变量设置和服务配置。
  166. 如需更新默认的 HTTP 服务端口(80), 可以在 [docker-compose.yml](./docker/docker-compose.yml) 文件中将配置 `80:80` 改为 `<YOUR_SERVING_PORT>:80`。
  167. > 所有系统配置都需要通过系统重启生效:
  168. >
  169. > ```bash
  170. > $ docker compose -f docker-compose.yml up -d
  171. > ```
  172. ### 把文档引擎从 Elasticsearch 切换成为 Infinity
  173. RAGFlow 默认使用 Elasticsearch 存储文本和向量数据. 如果要切换为 [Infinity](https://github.com/infiniflow/infinity/), 可以按照下面步骤进行:
  174. 1. 停止所有容器运行:
  175. ```bash
  176. $ docker compose -f docker/docker-compose.yml down -v
  177. ```
  178. Note: `-v` 将会删除 docker 容器的 volumes,已有的数据会被清空。
  179. 2. 设置 **docker/.env** 目录中的 `DOC_ENGINE` 为 `infinity`.
  180. 3. 启动容器:
  181. ```bash
  182. $ docker compose -f docker-compose.yml up -d
  183. ```
  184. > [!WARNING]
  185. > Infinity 目前官方并未正式支持在 Linux/arm64 架构下的机器上运行.
  186. ## 🔧 源码编译 Docker 镜像(不含 embedding 模型)
  187. 本 Docker 镜像大小约 2 GB 左右并且依赖外部的大模型和 embedding 服务。
  188. ```bash
  189. git clone https://github.com/infiniflow/ragflow.git
  190. cd ragflow/
  191. docker build --platform linux/amd64 --build-arg LIGHTEN=1 --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:nightly-slim .
  192. ```
  193. ## 🔧 源码编译 Docker 镜像(包含 embedding 模型)
  194. 本 Docker 大小约 9 GB 左右。由于已包含 embedding 模型,所以只需依赖外部的大模型服务即可。
  195. ```bash
  196. git clone https://github.com/infiniflow/ragflow.git
  197. cd ragflow/
  198. docker build --platform linux/amd64 --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:nightly .
  199. ```
  200. ## 🔨 以源代码启动服务
  201. 1. 安装 uv。如已经安装,可跳过本步骤:
  202. ```bash
  203. pipx install uv pre-commit
  204. export UV_INDEX=https://mirrors.aliyun.com/pypi/simple
  205. ```
  206. 2. 下载源代码并安装 Python 依赖:
  207. ```bash
  208. git clone https://github.com/infiniflow/ragflow.git
  209. cd ragflow/
  210. uv sync --python 3.10 --all-extras # install RAGFlow dependent python modules
  211. uv run download_deps.py
  212. pre-commit install
  213. ```
  214. 3. 通过 Docker Compose 启动依赖的服务(MinIO, Elasticsearch, Redis, and MySQL):
  215. ```bash
  216. docker compose -f docker/docker-compose-base.yml up -d
  217. ```
  218. 在 `/etc/hosts` 中添加以下代码,目的是将 **conf/service_conf.yaml** 文件中的所有 host 地址都解析为 `127.0.0.1`:
  219. ```
  220. 127.0.0.1 es01 infinity mysql minio redis sandbox-executor-manager
  221. ```
  222. 4. 如果无法访问 HuggingFace,可以把环境变量 `HF_ENDPOINT` 设成相应的镜像站点:
  223. ```bash
  224. export HF_ENDPOINT=https://hf-mirror.com
  225. ```
  226. 5. 如果你的操作系统没有 jemalloc,请按照如下方式安装:
  227. ```bash
  228. # ubuntu
  229. sudo apt-get install libjemalloc-dev
  230. # centos
  231. sudo yum install jemalloc
  232. ```
  233. 6. 启动后端服务:
  234. ```bash
  235. source .venv/bin/activate
  236. export PYTHONPATH=$(pwd)
  237. bash docker/launch_backend_service.sh
  238. ```
  239. 7. 安装前端依赖:
  240. ```bash
  241. cd web
  242. npm install
  243. ```
  244. 8. 启动前端服务:
  245. ```bash
  246. npm run dev
  247. ```
  248. _以下界面说明系统已经成功启动:_
  249. ![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)
  250. 9. 开发完成后停止 RAGFlow 前端和后端服务:
  251. ```bash
  252. pkill -f "ragflow_server.py|task_executor.py"
  253. ```
  254. ## 📚 技术文档
  255. - [Quickstart](https://ragflow.io/docs/dev/)
  256. - [Configuration](https://ragflow.io/docs/dev/configurations)
  257. - [Release notes](https://ragflow.io/docs/dev/release_notes)
  258. - [User guides](https://ragflow.io/docs/dev/category/guides)
  259. - [Developer guides](https://ragflow.io/docs/dev/category/developers)
  260. - [References](https://ragflow.io/docs/dev/category/references)
  261. - [FAQs](https://ragflow.io/docs/dev/faq)
  262. ## 📜 路线图
  263. 详见 [RAGFlow Roadmap 2025](https://github.com/infiniflow/ragflow/issues/4214) 。
  264. ## 🏄 开源社区
  265. - [Discord](https://discord.gg/zd4qPW6t)
  266. - [Twitter](https://twitter.com/infiniflowai)
  267. - [GitHub Discussions](https://github.com/orgs/infiniflow/discussions)
  268. ## 🙌 贡献指南
  269. RAGFlow 只有通过开源协作才能蓬勃发展。秉持这一精神,我们欢迎来自社区的各种贡献。如果您有意参与其中,请查阅我们的 [贡献者指南](https://ragflow.io/docs/dev/contributing) 。
  270. ## 🤝 商务合作
  271. - [预约咨询](https://aao615odquw.feishu.cn/share/base/form/shrcnjw7QleretCLqh1nuPo1xxh)
  272. ## 👥 加入社区
  273. 扫二维码添加 RAGFlow 小助手,进 RAGFlow 交流群。
  274. <p align="center">
  275. <img src="https://github.com/infiniflow/ragflow/assets/7248/bccf284f-46f2-4445-9809-8f1030fb7585" width=50% height=50%>
  276. </p>