您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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">English</a> |
  8. <a href="./README_zh.md">简体中文</a> |
  9. <a href="./README_ja.md">日本語</a> |
  10. <a href="./README_ko.md">한국어</a>
  11. </p>
  12. <p align="center">
  13. <a href="https://github.com/infiniflow/ragflow/releases/latest">
  14. <img src="https://img.shields.io/github/v/release/infiniflow/ragflow?color=blue&label=Latest%20Release" alt="Latest Release">
  15. </a>
  16. <a href="https://demo.ragflow.io" target="_blank">
  17. <img alt="Static Badge" src="https://img.shields.io/badge/Online-Demo-4e6b99"></a>
  18. <a href="https://hub.docker.com/r/infiniflow/ragflow" target="_blank">
  19. <img src="https://img.shields.io/badge/docker_pull-ragflow:v0.12.0-brightgreen" alt="docker pull infiniflow/ragflow:v0.12.0"></a>
  20. <a href="https://github.com/infiniflow/ragflow/blob/main/LICENSE">
  21. <img height="21" src="https://img.shields.io/badge/License-Apache--2.0-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="license">
  22. </a>
  23. </p>
  24. <h4 align="center">
  25. <a href="https://ragflow.io/docs/dev/">Document</a> |
  26. <a href="https://github.com/infiniflow/ragflow/issues/162">Roadmap</a> |
  27. <a href="https://twitter.com/infiniflowai">Twitter</a> |
  28. <a href="https://discord.gg/4XxujFgUN7">Discord</a> |
  29. <a href="https://demo.ragflow.io">Demo</a>
  30. </h4>
  31. <details open>
  32. <summary></b>📕 Table of Contents</b></summary>
  33. - 💡 [What is RAGFlow?](#-what-is-ragflow)
  34. - 🎮 [Demo](#-demo)
  35. - 📌 [Latest Updates](#-latest-updates)
  36. - 🌟 [Key Features](#-key-features)
  37. - 🔎 [System Architecture](#-system-architecture)
  38. - 🎬 [Get Started](#-get-started)
  39. - 🔧 [Configurations](#-configurations)
  40. - 🔧 [Build a docker image without embedding models](#-build-the-docker-image-without-embedding-models)
  41. - 🔧 [Build a docker image including embedding models](#-build-the-docker-image-including-embedding-models)
  42. - 🔨 [Launch service from source for development](#-launch-service-from-source-for-development)
  43. - 📚 [Documentation](#-documentation)
  44. - 📜 [Roadmap](#-roadmap)
  45. - 🏄 [Community](#-community)
  46. - 🙌 [Contributing](#-contributing)
  47. </details>
  48. ## 💡 What is RAGFlow?
  49. [RAGFlow](https://ragflow.io/) is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding. It offers a streamlined RAG workflow for businesses of any scale, combining LLM (Large Language Models) to provide truthful question-answering capabilities, backed by well-founded citations from various complex formatted data.
  50. ## 🎮 Demo
  51. Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io).
  52. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  53. <img src="https://github.com/infiniflow/ragflow/assets/7248/2f6baa3e-1092-4f11-866d-36f6a9d075e5" width="1200"/>
  54. <img src="https://github.com/infiniflow/ragflow/assets/12318111/b083d173-dadc-4ea9-bdeb-180d7df514eb" width="1200"/>
  55. </div>
  56. ## 🔥 Latest Updates
  57. - 2024-09-29 Optimizes multi-round conversations.
  58. - 2024-09-13 Adds search mode for knowledge base Q&A.
  59. - 2024-09-09 Adds a medical consultant agent template.
  60. - 2024-08-22 Support text to SQL statements through RAG.
  61. - 2024-08-02 Supports GraphRAG inspired by [graphrag](https://github.com/microsoft/graphrag) and mind map.
  62. ## 🎉 Stay Tuned
  63. ⭐️ Star our repository to stay up-to-date with exciting new features and improvements! Get instant notifications for new releases! 🌟
  64. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  65. <img src="https://github.com/user-attachments/assets/18c9707e-b8aa-4caf-a154-037089c105ba" width="1200"/>
  66. </div>
  67. ## 🌟 Key Features
  68. ### 🍭 **"Quality in, quality out"**
  69. - [Deep document understanding](./deepdoc/README.md)-based knowledge extraction from unstructured data with complicated formats.
  70. - Finds "needle in a data haystack" of literally unlimited tokens.
  71. ### 🍱 **Template-based chunking**
  72. - Intelligent and explainable.
  73. - Plenty of template options to choose from.
  74. ### 🌱 **Grounded citations with reduced hallucinations**
  75. - Visualization of text chunking to allow human intervention.
  76. - Quick view of the key references and traceable citations to support grounded answers.
  77. ### 🍔 **Compatibility with heterogeneous data sources**
  78. - Supports Word, slides, excel, txt, images, scanned copies, structured data, web pages, and more.
  79. ### 🛀 **Automated and effortless RAG workflow**
  80. - Streamlined RAG orchestration catered to both personal and large businesses.
  81. - Configurable LLMs as well as embedding models.
  82. - Multiple recall paired with fused re-ranking.
  83. - Intuitive APIs for seamless integration with business.
  84. ## 🔎 System Architecture
  85. <div align="center" style="margin-top:20px;margin-bottom:20px;">
  86. <img src="https://github.com/infiniflow/ragflow/assets/12318111/d6ac5664-c237-4200-a7c2-a4a00691b485" width="1000"/>
  87. </div>
  88. ## 🎬 Get Started
  89. ### 📝 Prerequisites
  90. - CPU >= 4 cores
  91. - RAM >= 16 GB
  92. - Disk >= 50 GB
  93. - Docker >= 24.0.0 & Docker Compose >= v2.26.1
  94. > If you have not installed Docker on your local machine (Windows, Mac, or Linux), see [Install Docker Engine](https://docs.docker.com/engine/install/).
  95. ### 🚀 Start up the server
  96. 1. Ensure `vm.max_map_count` >= 262144:
  97. > To check the value of `vm.max_map_count`:
  98. >
  99. > ```bash
  100. > $ sysctl vm.max_map_count
  101. > ```
  102. >
  103. > Reset `vm.max_map_count` to a value at least 262144 if it is not.
  104. >
  105. > ```bash
  106. > # In this case, we set it to 262144:
  107. > $ sudo sysctl -w vm.max_map_count=262144
  108. > ```
  109. >
  110. > This change will be reset after a system reboot. To ensure your change remains permanent, add or update the `vm.max_map_count` value in **/etc/sysctl.conf** accordingly:
  111. >
  112. > ```bash
  113. > vm.max_map_count=262144
  114. > ```
  115. 2. Clone the repo:
  116. ```bash
  117. $ git clone https://github.com/infiniflow/ragflow.git
  118. ```
  119. 3. Build the pre-built Docker images and start up the server:
  120. > Running the following commands automatically downloads the *dev* version RAGFlow Docker image. To download and run a specified Docker version, update `RAGFLOW_IMAGE` in **docker/.env** to the intended version, for example `RAGFLOW_IMAGE=infiniflow/ragflow:v0.12.0`, before running the following commands.
  121. ```bash
  122. $ cd ragflow/docker
  123. $ docker compose up -d
  124. ```
  125. > The core image is about 9 GB in size and may take a while to load.
  126. 4. Check the server status after having the server up and running:
  127. ```bash
  128. $ docker logs -f ragflow-server
  129. ```
  130. _The following output confirms a successful launch of the system:_
  131. ```bash
  132. ____ ___ ______ ______ __
  133. / __ \ / | / ____// ____// /____ _ __
  134. / /_/ // /| | / / __ / /_ / // __ \| | /| / /
  135. / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
  136. /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
  137. * Running on all addresses (0.0.0.0)
  138. * Running on http://127.0.0.1:9380
  139. * Running on http://x.x.x.x:9380
  140. INFO:werkzeug:Press CTRL+C to quit
  141. ```
  142. > If you skip this confirmation step and directly log in to RAGFlow, your browser may prompt a `network abnormal` error because, at that moment, your RAGFlow may not be fully initialized.
  143. 5. In your web browser, enter the IP address of your server and log in to RAGFlow.
  144. > With the default settings, you only need to enter `http://IP_OF_YOUR_MACHINE` (**sans** port number) as the default HTTP serving port `80` can be omitted when using the default configurations.
  145. 6. In [service_conf.yaml](./docker/service_conf.yaml), select the desired LLM factory in `user_default_llm` and update the `API_KEY` field with the corresponding API key.
  146. > See [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup) for more information.
  147. _The show is on!_
  148. ## 🔧 Configurations
  149. When it comes to system configurations, you will need to manage the following files:
  150. - [.env](./docker/.env): Keeps the fundamental setups for the system, such as `SVR_HTTP_PORT`, `MYSQL_PASSWORD`, and `MINIO_PASSWORD`.
  151. - [service_conf.yaml](./docker/service_conf.yaml): Configures the back-end services.
  152. - [docker-compose.yml](./docker/docker-compose.yml): The system relies on [docker-compose.yml](./docker/docker-compose.yml) to start up.
  153. You must ensure that changes to the [.env](./docker/.env) file are in line with what are in the [service_conf.yaml](./docker/service_conf.yaml) file.
  154. > The [./docker/README](./docker/README.md) file provides a detailed description of the environment settings and service configurations, and you are REQUIRED to ensure that all environment settings listed in the [./docker/README](./docker/README.md) file are aligned with the corresponding configurations in the [service_conf.yaml](./docker/service_conf.yaml) file.
  155. To update the default HTTP serving port (80), go to [docker-compose.yml](./docker/docker-compose.yml) and change `80:80` to `<YOUR_SERVING_PORT>:80`.
  156. Updates to the above configurations require a reboot of all containers to take effect:
  157. > ```bash
  158. > $ docker compose -f docker/docker-compose.yml up -d
  159. > ```
  160. ## 🔧 Build a Docker image without embedding models
  161. This image is approximately 1 GB in size and relies on external LLM and embedding services.
  162. ```bash
  163. git clone https://github.com/infiniflow/ragflow.git
  164. cd ragflow/
  165. pip3 install huggingface-hub nltk
  166. python3 download_deps.py
  167. docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim .
  168. ```
  169. ## 🔧 Build a Docker image including embedding models
  170. This image is approximately 9 GB in size. As it includes embedding models, it relies on external LLM services only.
  171. ```bash
  172. git clone https://github.com/infiniflow/ragflow.git
  173. cd ragflow/
  174. pip3 install huggingface-hub nltk
  175. python3 download_deps.py
  176. docker build -f Dockerfile -t infiniflow/ragflow:dev .
  177. ```
  178. ## 🔨 Launch service from source for development
  179. 1. Install Poetry, or skip this step if it is already installed:
  180. ```bash
  181. curl -sSL https://install.python-poetry.org | python3 -
  182. ```
  183. 2. Clone the source code and install Python dependencies:
  184. ```bash
  185. git clone https://github.com/infiniflow/ragflow.git
  186. cd ragflow/
  187. export POETRY_VIRTUALENVS_CREATE=true POETRY_VIRTUALENVS_IN_PROJECT=true
  188. ~/.local/bin/poetry install --sync --no-root # install RAGFlow dependent python modules
  189. ```
  190. 3. Launch the dependent services (MinIO, Elasticsearch, Redis, and MySQL) using Docker Compose:
  191. ```bash
  192. docker compose -f docker/docker-compose-base.yml up -d
  193. ```
  194. Add the following line to `/etc/hosts` to resolve all hosts specified in **docker/service_conf.yaml** to `127.0.0.1`:
  195. ```
  196. 127.0.0.1 es01 mysql minio redis
  197. ```
  198. In **docker/service_conf.yaml**, update mysql port to `5455` and es port to `1200`, as specified in **docker/.env**.
  199. 4. If you cannot access HuggingFace, set the `HF_ENDPOINT` environment variable to use a mirror site:
  200. ```bash
  201. export HF_ENDPOINT=https://hf-mirror.com
  202. ```
  203. 5. Launch backend service:
  204. ```bash
  205. source .venv/bin/activate
  206. export PYTHONPATH=$(pwd)
  207. bash docker/launch_backend_service.sh
  208. ```
  209. 6. Install frontend dependencies:
  210. ```bash
  211. cd web
  212. npm install --force
  213. ```
  214. 7. Configure frontend to update `proxy.target` in **.umirc.ts** to `http://127.0.0.1:9380`:
  215. 8. Launch frontend service:
  216. ```bash
  217. npm run dev
  218. ```
  219. _The following output confirms a successful launch of the system:_
  220. ![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)
  221. ## 📚 Documentation
  222. - [Quickstart](https://ragflow.io/docs/dev/)
  223. - [User guide](https://ragflow.io/docs/dev/category/user-guides)
  224. - [References](https://ragflow.io/docs/dev/category/references)
  225. - [FAQ](https://ragflow.io/docs/dev/faq)
  226. ## 📜 Roadmap
  227. See the [RAGFlow Roadmap 2024](https://github.com/infiniflow/ragflow/issues/162)
  228. ## 🏄 Community
  229. - [Discord](https://discord.gg/4XxujFgUN7)
  230. - [Twitter](https://twitter.com/infiniflowai)
  231. - [GitHub Discussions](https://github.com/orgs/infiniflow/discussions)
  232. ## 🙌 Contributing
  233. RAGFlow flourishes via open-source collaboration. In this spirit, we embrace diverse contributions from the community. If you would like to be a part, review our [Contribution Guidelines](./CONTRIBUTING.md) first.