Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README.md 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <div align="center">
  2. <a href="https://demo.ragflow.io/">
  3. <img src="web/src/assets/logo-with-text.png" width="520" alt="ragflow logo">
  4. </a>
  5. </div>
  6. <p align="center">
  7. <a href="./README.md"><img alt="README in English" src="https://img.shields.io/badge/English-DBEDFA"></a>
  8. <a href="./README_zh.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/简体中文-DFE0E5"></a>
  9. <a href="./README_tzh.md"><img alt="繁體版中文自述文件" src="https://img.shields.io/badge/繁體中文-DFE0E5"></a>
  10. <a href="./README_ja.md"><img alt="日本語のREADME" src="https://img.shields.io/badge/日本語-DFE0E5"></a>
  11. <a href="./README_ko.md"><img alt="한국어" src="https://img.shields.io/badge/한국어-DFE0E5"></a>
  12. <a href="./README_id.md"><img alt="Bahasa Indonesia" src="https://img.shields.io/badge/Bahasa Indonesia-DFE0E5"></a>
  13. <a href="./README_pt_br.md"><img alt="Português(Brasil)" src="https://img.shields.io/badge/Português(Brasil)-DFE0E5"></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/docker/pulls/infiniflow/ragflow?label=Docker%20Pulls&color=0db7ed&logo=docker&logoColor=white&style=flat-square" alt="docker pull infiniflow/ragflow:v0.20.1">
  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. #
  43. <div align="center">
  44. <a href="https://trendshift.io/repositories/9064" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9064" alt="infiniflow%2Fragflow | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
  45. </div>
  46. <details open>
  47. <summary><b>📕 Table of Contents</b></summary>
  48. - 💡 [What is RAGFlow?](#-what-is-ragflow)
  49. - 🎮 [Demo](#-demo)
  50. - 📌 [Latest Updates](#-latest-updates)
  51. - 🌟 [Key Features](#-key-features)
  52. - 🔎 [System Architecture](#-system-architecture)
  53. - 🎬 [Get Started](#-get-started)
  54. - 🔧 [Configurations](#-configurations)
  55. - 🔧 [Build a docker image without embedding models](#-build-a-docker-image-without-embedding-models)
  56. - 🔧 [Build a docker image including embedding models](#-build-a-docker-image-including-embedding-models)
  57. - 🔨 [Launch service from source for development](#-launch-service-from-source-for-development)
  58. - 📚 [Documentation](#-documentation)
  59. - 📜 [Roadmap](#-roadmap)
  60. - 🏄 [Community](#-community)
  61. - 🙌 [Contributing](#-contributing)
  62. </details>
  63. ## 💡 What is RAGFlow?
  64. [RAGFlow](https://ragflow.io/) is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document
  65. understanding. It offers a streamlined RAG workflow for businesses of any scale, combining LLM (Large Language Models)
  66. to provide truthful question-answering capabilities, backed by well-founded citations from various complex formatted
  67. data.
  68. ## 🎮 Demo
  69. Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io).
  70. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  71. <img src="https://raw.githubusercontent.com/infiniflow/ragflow-docs/refs/heads/image/image/chunking.gif" width="1200"/>
  72. <img src="https://raw.githubusercontent.com/infiniflow/ragflow-docs/refs/heads/image/image/agentic-dark.gif" width="1200"/>
  73. </div>
  74. ## 🔥 Latest Updates
  75. - 2025-08-08 Supports OpenAI's latest GPT-5 series models.
  76. - 2025-08-04 Supports new models, including Kimi K2 and Grok 4.
  77. - 2025-08-01 Supports agentic workflow and MCP.
  78. - 2025-05-23 Adds a Python/JavaScript code executor component to Agent.
  79. - 2025-05-05 Supports cross-language query.
  80. - 2025-03-19 Supports using a multi-modal model to make sense of images within PDF or DOCX files.
  81. - 2025-02-28 Combined with Internet search (Tavily), supports reasoning like Deep Research for any LLMs.
  82. - 2024-12-18 Upgrades Document Layout Analysis model in DeepDoc.
  83. - 2024-08-22 Support text to SQL statements through RAG.
  84. ## 🎉 Stay Tuned
  85. ⭐️ Star our repository to stay up-to-date with exciting new features and improvements! Get instant notifications for new
  86. releases! 🌟
  87. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  88. <img src="https://github.com/user-attachments/assets/18c9707e-b8aa-4caf-a154-037089c105ba" width="1200"/>
  89. </div>
  90. ## 🌟 Key Features
  91. ### 🍭 **"Quality in, quality out"**
  92. - [Deep document understanding](./deepdoc/README.md)-based knowledge extraction from unstructured data with complicated
  93. formats.
  94. - Finds "needle in a data haystack" of literally unlimited tokens.
  95. ### 🍱 **Template-based chunking**
  96. - Intelligent and explainable.
  97. - Plenty of template options to choose from.
  98. ### 🌱 **Grounded citations with reduced hallucinations**
  99. - Visualization of text chunking to allow human intervention.
  100. - Quick view of the key references and traceable citations to support grounded answers.
  101. ### 🍔 **Compatibility with heterogeneous data sources**
  102. - Supports Word, slides, excel, txt, images, scanned copies, structured data, web pages, and more.
  103. ### 🛀 **Automated and effortless RAG workflow**
  104. - Streamlined RAG orchestration catered to both personal and large businesses.
  105. - Configurable LLMs as well as embedding models.
  106. - Multiple recall paired with fused re-ranking.
  107. - Intuitive APIs for seamless integration with business.
  108. ## 🔎 System Architecture
  109. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  110. <img src="https://github.com/infiniflow/ragflow/assets/12318111/d6ac5664-c237-4200-a7c2-a4a00691b485" width="1000"/>
  111. </div>
  112. ## 🎬 Get Started
  113. ### 📝 Prerequisites
  114. - CPU >= 4 cores
  115. - RAM >= 16 GB
  116. - Disk >= 50 GB
  117. - Docker >= 24.0.0 & Docker Compose >= v2.26.1
  118. - [gVisor](https://gvisor.dev/docs/user_guide/install/): Required only if you intend to use the code executor (sandbox) feature of RAGFlow.
  119. > [!TIP]
  120. > If you have not installed Docker on your local machine (Windows, Mac, or Linux), see [Install Docker Engine](https://docs.docker.com/engine/install/).
  121. ### 🚀 Start up the server
  122. 1. Ensure `vm.max_map_count` >= 262144:
  123. > To check the value of `vm.max_map_count`:
  124. >
  125. > ```bash
  126. > $ sysctl vm.max_map_count
  127. > ```
  128. >
  129. > Reset `vm.max_map_count` to a value at least 262144 if it is not.
  130. >
  131. > ```bash
  132. > # In this case, we set it to 262144:
  133. > $ sudo sysctl -w vm.max_map_count=262144
  134. > ```
  135. >
  136. > This change will be reset after a system reboot. To ensure your change remains permanent, add or update the
  137. > `vm.max_map_count` value in **/etc/sysctl.conf** accordingly:
  138. >
  139. > ```bash
  140. > vm.max_map_count=262144
  141. > ```
  142. 2. Clone the repo:
  143. ```bash
  144. $ git clone https://github.com/infiniflow/ragflow.git
  145. ```
  146. 3. Start up the server using the pre-built Docker images:
  147. > [!CAUTION]
  148. > All Docker images are built for x86 platforms. We don't currently offer Docker images for ARM64.
  149. > If you are on an ARM64 platform, follow [this guide](https://ragflow.io/docs/dev/build_docker_image) to build a Docker image compatible with your system.
  150. > The command below downloads the `v0.20.1-slim` edition of the RAGFlow Docker image. See the following table for descriptions of different RAGFlow editions. To download a RAGFlow edition different from `v0.20.1-slim`, update the `RAGFLOW_IMAGE` variable accordingly in **docker/.env** before using `docker compose` to start the server. For example: set `RAGFLOW_IMAGE=infiniflow/ragflow:v0.20.1` for the full edition `v0.20.1`.
  151. ```bash
  152. $ cd ragflow/docker
  153. # Use CPU for embedding and DeepDoc tasks:
  154. $ docker compose -f docker-compose.yml up -d
  155. # To use GPU to accelerate embedding and DeepDoc tasks:
  156. # docker compose -f docker-compose-gpu.yml up -d
  157. ```
  158. | RAGFlow image tag | Image size (GB) | Has embedding models? | Stable? |
  159. |-------------------|-----------------|-----------------------|--------------------------|
  160. | v0.20.1 | &approx;9 | :heavy_check_mark: | Stable release |
  161. | v0.20.1-slim | &approx;2 | ❌ | Stable release |
  162. | nightly | &approx;9 | :heavy_check_mark: | _Unstable_ nightly build |
  163. | nightly-slim | &approx;2 | ❌ | _Unstable_ nightly build |
  164. 4. Check the server status after having the server up and running:
  165. ```bash
  166. $ docker logs -f ragflow-server
  167. ```
  168. _The following output confirms a successful launch of the system:_
  169. ```bash
  170. ____ ___ ______ ______ __
  171. / __ \ / | / ____// ____// /____ _ __
  172. / /_/ // /| | / / __ / /_ / // __ \| | /| / /
  173. / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
  174. /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
  175. * Running on all addresses (0.0.0.0)
  176. ```
  177. > If you skip this confirmation step and directly log in to RAGFlow, your browser may prompt a `network anormal`
  178. > error because, at that moment, your RAGFlow may not be fully initialized.
  179. 5. In your web browser, enter the IP address of your server and log in to RAGFlow.
  180. > With the default settings, you only need to enter `http://IP_OF_YOUR_MACHINE` (**sans** port number) as the default
  181. > HTTP serving port `80` can be omitted when using the default configurations.
  182. 6. In [service_conf.yaml.template](./docker/service_conf.yaml.template), select the desired LLM factory in `user_default_llm` and update
  183. the `API_KEY` field with the corresponding API key.
  184. > See [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup) for more information.
  185. _The show is on!_
  186. ## 🔧 Configurations
  187. When it comes to system configurations, you will need to manage the following files:
  188. - [.env](./docker/.env): Keeps the fundamental setups for the system, such as `SVR_HTTP_PORT`, `MYSQL_PASSWORD`, and
  189. `MINIO_PASSWORD`.
  190. - [service_conf.yaml.template](./docker/service_conf.yaml.template): Configures the back-end services. The environment variables in this file will be automatically populated when the Docker container starts. Any environment variables set within the Docker container will be available for use, allowing you to customize service behavior based on the deployment environment.
  191. - [docker-compose.yml](./docker/docker-compose.yml): The system relies on [docker-compose.yml](./docker/docker-compose.yml) to start up.
  192. > The [./docker/README](./docker/README.md) file provides a detailed description of the environment settings and service
  193. > configurations which can be used as `${ENV_VARS}` in the [service_conf.yaml.template](./docker/service_conf.yaml.template) file.
  194. To update the default HTTP serving port (80), go to [docker-compose.yml](./docker/docker-compose.yml) and change `80:80`
  195. to `<YOUR_SERVING_PORT>:80`.
  196. Updates to the above configurations require a reboot of all containers to take effect:
  197. > ```bash
  198. > $ docker compose -f docker-compose.yml up -d
  199. > ```
  200. ### Switch doc engine from Elasticsearch to Infinity
  201. RAGFlow uses Elasticsearch by default for storing full text and vectors. To switch to [Infinity](https://github.com/infiniflow/infinity/), follow these steps:
  202. 1. Stop all running containers:
  203. ```bash
  204. $ docker compose -f docker/docker-compose.yml down -v
  205. ```
  206. > [!WARNING]
  207. > `-v` will delete the docker container volumes, and the existing data will be cleared.
  208. 2. Set `DOC_ENGINE` in **docker/.env** to `infinity`.
  209. 3. Start the containers:
  210. ```bash
  211. $ docker compose -f docker-compose.yml up -d
  212. ```
  213. > [!WARNING]
  214. > Switching to Infinity on a Linux/arm64 machine is not yet officially supported.
  215. ## 🔧 Build a Docker image without embedding models
  216. This image is approximately 2 GB in size and relies on external LLM and embedding services.
  217. ```bash
  218. git clone https://github.com/infiniflow/ragflow.git
  219. cd ragflow/
  220. docker build --platform linux/amd64 --build-arg LIGHTEN=1 -f Dockerfile -t infiniflow/ragflow:nightly-slim .
  221. ```
  222. ## 🔧 Build a Docker image including embedding models
  223. This image is approximately 9 GB in size. As it includes embedding models, it relies on external LLM services only.
  224. ```bash
  225. git clone https://github.com/infiniflow/ragflow.git
  226. cd ragflow/
  227. docker build --platform linux/amd64 -f Dockerfile -t infiniflow/ragflow:nightly .
  228. ```
  229. ## 🔨 Launch service from source for development
  230. 1. Install uv, or skip this step if it is already installed:
  231. ```bash
  232. pipx install uv pre-commit
  233. ```
  234. 2. Clone the source code and install Python dependencies:
  235. ```bash
  236. git clone https://github.com/infiniflow/ragflow.git
  237. cd ragflow/
  238. uv sync --python 3.10 --all-extras # install RAGFlow dependent python modules
  239. uv run download_deps.py
  240. pre-commit install
  241. ```
  242. 3. Launch the dependent services (MinIO, Elasticsearch, Redis, and MySQL) using Docker Compose:
  243. ```bash
  244. docker compose -f docker/docker-compose-base.yml up -d
  245. ```
  246. Add the following line to `/etc/hosts` to resolve all hosts specified in **docker/.env** to `127.0.0.1`:
  247. ```
  248. 127.0.0.1 es01 infinity mysql minio redis sandbox-executor-manager
  249. ```
  250. 4. If you cannot access HuggingFace, set the `HF_ENDPOINT` environment variable to use a mirror site:
  251. ```bash
  252. export HF_ENDPOINT=https://hf-mirror.com
  253. ```
  254. 5. If your operating system does not have jemalloc, please install it as follows:
  255. ```bash
  256. # ubuntu
  257. sudo apt-get install libjemalloc-dev
  258. # centos
  259. sudo yum install jemalloc
  260. ```
  261. 6. Launch backend service:
  262. ```bash
  263. source .venv/bin/activate
  264. export PYTHONPATH=$(pwd)
  265. bash docker/launch_backend_service.sh
  266. ```
  267. 7. Install frontend dependencies:
  268. ```bash
  269. cd web
  270. npm install
  271. ```
  272. 8. Launch frontend service:
  273. ```bash
  274. npm run dev
  275. ```
  276. _The following output confirms a successful launch of the system:_
  277. ![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)
  278. 9. Stop RAGFlow front-end and back-end service after development is complete:
  279. ```bash
  280. pkill -f "ragflow_server.py|task_executor.py"
  281. ```
  282. ## 📚 Documentation
  283. - [Quickstart](https://ragflow.io/docs/dev/)
  284. - [Configuration](https://ragflow.io/docs/dev/configurations)
  285. - [Release notes](https://ragflow.io/docs/dev/release_notes)
  286. - [User guides](https://ragflow.io/docs/dev/category/guides)
  287. - [Developer guides](https://ragflow.io/docs/dev/category/developers)
  288. - [References](https://ragflow.io/docs/dev/category/references)
  289. - [FAQs](https://ragflow.io/docs/dev/faq)
  290. ## 📜 Roadmap
  291. See the [RAGFlow Roadmap 2025](https://github.com/infiniflow/ragflow/issues/4214)
  292. ## 🏄 Community
  293. - [Discord](https://discord.gg/NjYzJD3GM3)
  294. - [Twitter](https://twitter.com/infiniflowai)
  295. - [GitHub Discussions](https://github.com/orgs/infiniflow/discussions)
  296. ## 🙌 Contributing
  297. RAGFlow flourishes via open-source collaboration. In this spirit, we embrace diverse contributions from the community.
  298. If you would like to be a part, review our [Contribution Guidelines](https://ragflow.io/docs/dev/contributing) first.