You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. # Frequently Asked Questions
  2. ## General
  3. ### 1. What sets RAGFlow apart from other RAG products?
  4. The "garbage in garbage out" status quo remains unchanged despite the fact that LLMs have advanced Natural Language Processing (NLP) significantly. In response, RAGFlow introduces two unique features compared to other Retrieval-Augmented Generation (RAG) products.
  5. - Fine-grained document parsing: Document parsing involves images and tables, with the flexibility for you to intervene as needed.
  6. - Traceable answers with reduced hallucinations: You can trust RAGFlow's responses as you can view the citations and references supporting them.
  7. ### 2. Which languages does RAGFlow support?
  8. English, simplified Chinese, traditional Chinese for now.
  9. ## Performance
  10. ### 1. Why does it take longer for RAGFlow to parse a document than LangChain?
  11. We put painstaking effort into document pre-processing tasks like layout analysis, table structure recognition, and OCR (Optical Character Recognition) using our vision model. This contributes to the additional time required.
  12. ### 2. Why does RAGFlow require more resources than other projects?
  13. RAGFlow has a number of built-in models for document structure parsing, which account for the additional computational resources.
  14. ## Feature
  15. ### 1. Which architectures or devices does RAGFlow support?
  16. Currently, we only support x86 CPU and Nvidia GPU.
  17. ### 2. Do you offer an API for integration with third-party applications?
  18. The corresponding APIs are now available. See the [Conversation API](./conversation_api.md) for more information.
  19. ### 3. Do you support stream output?
  20. No, this feature is still in development. Contributions are welcome.
  21. ### 4. Is it possible to share dialogue through URL?
  22. Yes, this feature is now available.
  23. ### 5. Do you support multiple rounds of dialogues, i.e., referencing previous dialogues as context for the current dialogue?
  24. This feature and the related APIs are still in development. Contributions are welcome.
  25. ## Troubleshooting
  26. ### 1. Issues with docker images
  27. #### 1.1 How to build the RAGFlow image from scratch?
  28. ```
  29. $ git clone https://github.com/infiniflow/ragflow.git
  30. $ cd ragflow
  31. $ docker build -t infiniflow/ragflow:latest .
  32. $ cd ragflow/docker
  33. $ chmod +x ./entrypoint.sh
  34. $ docker compose up -d
  35. ```
  36. #### 1.2 `process "/bin/sh -c cd ./web && npm i && npm run build"` failed
  37. 1. Check your network from within Docker, for example:
  38. ```bash
  39. curl https://hf-mirror.com
  40. ```
  41. 2. If your network works fine, the issue lies with the Docker network configuration. Replace the Docker building command:
  42. ```bash
  43. docker build -t infiniflow/ragflow:vX.Y.Z.
  44. ```
  45. With this:
  46. ```bash
  47. docker build -t infiniflow/ragflow:vX.Y.Z. --network host
  48. ```
  49. ### 2. Issues with huggingface models
  50. #### 2.1 Cannot access https://huggingface.co
  51. A *locally* deployed RAGflow downloads OCR and embedding modules from [Huggingface website](https://huggingface.co) by default. If your machine is unable to access this site, the following error occurs and PDF parsing fails:
  52. ```
  53. FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/huggingface/hub/models--InfiniFlow--deepdoc/snapshots/be0c1e50eef6047b412d1800aa89aba4d275f997/ocr.res'
  54. ```
  55. To fix this issue, use https://hf-mirror.com instead:
  56. 1. Stop all containers and remove all related resources:
  57. ```bash
  58. cd ragflow/docker/
  59. docker compose down
  60. ```
  61. 2. Replace `https://huggingface.co` with `https://hf-mirror.com` in **ragflow/docker/docker-compose.yml**.
  62. 3. Start up the server:
  63. ```bash
  64. docker compose up -d
  65. ```
  66. #### 2.2. `MaxRetryError: HTTPSConnectionPool(host='hf-mirror.com', port=443)`
  67. This error suggests that you do not have Internet access or are unable to connect to hf-mirror.com. Try the following:
  68. 1. Manually download the resource files from [huggingface.co/InfiniFlow/deepdoc](https://huggingface.co/InfiniFlow/deepdoc) to your local folder **~/deepdoc**.
  69. 2. Add a volumes to **docker-compose.yml**, for example:
  70. ```
  71. - ~/deepdoc:/ragflow/rag/res/deepdoc
  72. ```
  73. #### 2.3 `FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/huggingface/hub/models--InfiniFlow--deepdoc/snapshots/FileNotFoundError: [Errno 2] No such file or directory: '/ragflow/rag/res/deepdoc/ocr.res'be0c1e50eef6047b412d1800aa89aba4d275f997/ocr.res'`
  74. 1. Check your network from within Docker, for example:
  75. ```bash
  76. curl https://hf-mirror.com
  77. ```
  78. 2. Run `ifconfig` to check the `mtu` value. If the server's `mtu` is `1450` while the NIC's `mtu` in the container is `1500`, this mismatch may cause network instability. Adjust the `mtu` policy as follows:
  79. ```
  80. vim docker-compose-base.yml
  81. # Original configuration:
  82. networks:
  83. ragflow:
  84. driver: bridge
  85. # Modified configuration:
  86. networks:
  87. ragflow:
  88. driver: bridge
  89. driver_opts:
  90. com.docker.network.driver.mtu: 1450
  91. ```
  92. ### 3. Issues with RAGFlow servers
  93. #### 3.1 `WARNING: can't find /raglof/rag/res/borker.tm`
  94. Ignore this warning and continue. All system warnings can be ignored.
  95. #### 3.2 `network anomaly There is an abnormality in your network and you cannot connect to the server.`
  96. ![anomaly](https://github.com/infiniflow/ragflow/assets/93570324/beb7ad10-92e4-4a58-8886-bfb7cbd09e5d)
  97. You will not log in to RAGFlow unless the server is fully initialized. Run `docker logs -f ragflow-server`.
  98. *The server is successfully initialized, if your system displays the following:*
  99. ```
  100. ____ ______ __
  101. / __ \ ____ _ ____ _ / ____// /____ _ __
  102. / /_/ // __ `// __ `// /_ / // __ \| | /| / /
  103. / _, _// /_/ // /_/ // __/ / // /_/ /| |/ |/ /
  104. /_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
  105. /____/
  106. * Running on all addresses (0.0.0.0)
  107. * Running on http://127.0.0.1:9380
  108. * Running on http://x.x.x.x:9380
  109. INFO:werkzeug:Press CTRL+C to quit
  110. ```
  111. ### 4. Issues with RAGFlow backend services
  112. #### 4.1 `dependency failed to start: container ragflow-mysql is unhealthy`
  113. `dependency failed to start: container ragflow-mysql is unhealthy` means that your MySQL container failed to start. Try replacing `mysql:5.7.18` with `mariadb:10.5.8` in **docker-compose-base.yml**.
  114. #### 4.2 `Realtime synonym is disabled, since no redis connection`
  115. Ignore this warning and continue. All system warnings can be ignored.
  116. ![](https://github.com/infiniflow/ragflow/assets/93570324/ef5a6194-084a-4fe3-bdd5-1c025b40865c)
  117. #### 4.3 Why does it take so long to parse a 2MB document?
  118. Parsing requests have to wait in queue due to limited server resources. We are currently enhancing our algorithms and increasing computing power.
  119. #### 4.4 Why does my document parsing stall at under one percent?
  120. ![stall](https://github.com/infiniflow/ragflow/assets/93570324/3589cc25-c733-47d5-bbfc-fedb74a3da50)
  121. If your RAGFlow is deployed *locally*, try the following:
  122. 1. Check the log of your RAGFlow server to see if it is running properly:
  123. ```bash
  124. docker logs -f ragflow-server
  125. ```
  126. 2. Check if the **task_executor.py** process exists.
  127. 3. Check if your RAGFlow server can access hf-mirror.com or huggingface.com.
  128. #### 4.5 Why does my pdf parsing stall near completion, while the log does not show any error?
  129. If your RAGFlow is deployed *locally*, the parsing process is likely killed due to insufficient RAM. Try increasing your memory allocation by increasing the `MEM_LIMIT` value in **docker/.env**.
  130. > Ensure that you restart up your RAGFlow server for your changes to take effect!
  131. > ```bash
  132. > docker compose stop
  133. > ```
  134. > ```bash
  135. > docker compose up -d
  136. > ```
  137. ![nearcompletion](https://github.com/infiniflow/ragflow/assets/93570324/563974c3-f8bb-4ec8-b241-adcda8929cbb)
  138. #### 4.6 `Index failure`
  139. An index failure usually indicates an unavailable Elasticsearch service.
  140. #### 4.7 How to check the log of RAGFlow?
  141. ```bash
  142. tail -f path_to_ragflow/docker/ragflow-logs/rag/*.log
  143. ```
  144. #### 4.8 How to check the status of each component in RAGFlow?
  145. ```bash
  146. $ docker ps
  147. ```
  148. *The system displays the following if all your RAGFlow components are running properly:*
  149. ```
  150. 5bc45806b680 infiniflow/ragflow:latest "./entrypoint.sh" 11 hours ago Up 11 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:9380->9380/tcp, :::9380->9380/tcp ragflow-server
  151. 91220e3285dd docker.elastic.co/elasticsearch/elasticsearch:8.11.3 "/bin/tini -- /usr/l…" 11 hours ago Up 11 hours (healthy) 9300/tcp, 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp ragflow-es-01
  152. d8c86f06c56b mysql:5.7.18 "docker-entrypoint.s…" 7 days ago Up 16 seconds (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp ragflow-mysql
  153. cd29bcb254bc quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Z "/usr/bin/docker-ent…" 2 weeks ago Up 11 hours 0.0.0.0:9001->9001/tcp, :::9001->9001/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp ragflow-minio
  154. ```
  155. #### 4.9 `Exception: Can't connect to ES cluster`
  156. 1. Check the status of your Elasticsearch component:
  157. ```bash
  158. $ docker ps
  159. ```
  160. *The status of a 'healthy' Elasticsearch component in your RAGFlow should look as follows:*
  161. ```
  162. 91220e3285dd docker.elastic.co/elasticsearch/elasticsearch:8.11.3 "/bin/tini -- /usr/l…" 11 hours ago Up 11 hours (healthy) 9300/tcp, 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp ragflow-es-01
  163. ```
  164. 2. If your container keeps restarting, ensure `vm.max_map_count` >= 262144 as per [this README](https://github.com/infiniflow/ragflow?tab=readme-ov-file#-start-up-the-server). Updating the `vm.max_map_count` value in **/etc/sysctl.conf** is required, if you wish to keep your change permanent. This configuration works only for Linux.
  165. 3. If your issue persists, ensure that the ES host setting is correct:
  166. - If you are running RAGFlow with Docker, it is in **docker/service_conf.yml**. Set it as follows:
  167. ```
  168. es:
  169. hosts: 'http://es01:9200'
  170. ```
  171. - If you run RAGFlow outside of Docker, verify the ES host setting in **conf/service_conf.yml** using:
  172. ```bash
  173. curl http://<IP_OF_ES>:<PORT_OF_ES>
  174. ```
  175. #### 4.10 Can't start ES container and get `Elasticsearch did not exit normally`
  176. This is because you forgot to update the `vm.max_map_count` value in **/etc/sysctl.conf** and your change to this value was reset after a system reboot.
  177. #### 4.11 `{"data":null,"retcode":100,"retmsg":"<NotFound '404: Not Found'>"}`
  178. Your IP address or port number may be incorrect. If you are using the default configurations, enter http://<IP_OF_YOUR_MACHINE> (**NOT 9380, AND NO PORT NUMBER REQUIRED!**) in your browser. This should work.
  179. #### 4.12 `Ollama - Mistral instance running at 127.0.0.1:11434 but cannot add Ollama as model in RagFlow`
  180. A correct Ollama IP address and port is crucial to adding models to Ollama:
  181. - If you are on demo.ragflow.io, ensure that the server hosting Ollama has a publicly accessible IP address.Note that 127.0.0.1 is not a publicly accessible IP address.
  182. - If you deploy RAGFlow locally, ensure that Ollama and RAGFlow are in the same LAN and can comunicate with each other.
  183. #### 4.13 Do you offer examples of using deepdoc to parse PDF or other files?
  184. Yes, we do. See the Python files under the **rag/app** folder.
  185. #### 4.14 Why did I fail to upload a 10MB+ file to my locally deployed RAGFlow?
  186. You probably forgot to update the **MAX_CONTENT_LENGTH** environment variable:
  187. 1. Add environment variable `MAX_CONTENT_LENGTH` to **ragflow/docker/.env**:
  188. ```
  189. MAX_CONTENT_LENGTH=100000000
  190. ```
  191. 2. Update **docker-compose.yml**:
  192. ```
  193. environment:
  194. - MAX_CONTENT_LENGTH=${MAX_CONTENT_LENGTH}
  195. ```
  196. 3. Restart the RAGFlow server:
  197. ```
  198. docker compose up ragflow -d
  199. ```
  200. *Now you should be able to upload files of sizes less than 100MB.*
  201. #### 4.15 `Table 'rag_flow.document' doesn't exist`
  202. This exception occurs when starting up the RAGFlow server. Try the following:
  203. 1. Prolong the sleep time: Go to **docker/entrypoint.sh**, locate line 26, and replace `sleep 60` with `sleep 280`.
  204. 2. If using Windows, ensure that the **entrypoint.sh** has LF end-lines.
  205. 3. Go to **docker/docker-compose.yml**, add the following:
  206. ```
  207. ./entrypoint.sh:/ragflow/entrypoint.sh
  208. ```
  209. 4. Change directory:
  210. ```bash
  211. cd docker
  212. ```
  213. 5. Stop the RAGFlow server:
  214. ```bash
  215. docker compose stop
  216. ```
  217. 6. Restart up the RAGFlow server:
  218. ```bash
  219. docker compose up
  220. ```
  221. #### 4.16 `hint : 102 Fail to access model Connection error`
  222. ![hint102](https://github.com/infiniflow/ragflow/assets/93570324/6633d892-b4f8-49b5-9a0a-37a0a8fba3d2)
  223. 1. Ensure that the RAGFlow server can access the base URL.
  224. 2. Do not forget to append **/v1/** to **http://IP:port**:
  225. **http://IP:port/v1/**
  226. #### 4.17 `FileNotFoundError: [Errno 2] No such file or directory`
  227. 1. Check if the status of your minio container is healthy:
  228. ```bash
  229. docker ps
  230. ```
  231. 2. Ensure that the username and password settings of MySQL and MinIO in **docker/.env** are in line with those in **docker/service_conf.yml**.
  232. ## Usage
  233. ### 1. How to increase the length of RAGFlow responses?
  234. 1. Right click the desired dialog to display the **Chat Configuration** window.
  235. 2. Switch to the **Model Setting** tab and adjust the **Max Tokens** slider to get the desired length.
  236. 3. Click **OK** to confirm your change.
  237. ### 2. What does Empty response mean? How to set it?
  238. You limit what the system responds to what you specify in **Empty response** if nothing is retrieved from your knowledge base. If you do not specify anything in **Empty response**, you let your LLM improvise, giving it a chance to hallucinate.
  239. ### 3. Can I set the base URL for OpenAI somewhere?
  240. ![](https://github.com/infiniflow/ragflow/assets/93570324/8cfb6fa4-8a97-415d-b9fa-b6f405a055f3)
  241. ### 4. How to run RAGFlow with a locally deployed LLM?
  242. You can use Ollama to deploy local LLM. See [here](https://github.com/infiniflow/ragflow/blob/main/docs/ollama.md) for more information.
  243. ### 5. How to link up ragflow and ollama servers?
  244. - If RAGFlow is locally deployed, ensure that your RAGFlow and Ollama are in the same LAN.
  245. - If you are using our online demo, ensure that the IP address of your Ollama server is public and accessible.
  246. ### 6. How to configure RAGFlow to respond with 100% matched results, rather than utilizing LLM?
  247. 1. Click **Knowledge Base** in the middle top of the page.
  248. 2. Right click the desired knowledge base to display the **Configuration** dialogue.
  249. 3. Choose **Q&A** as the chunk method and click **Save** to confirm your change.
  250. ### 7 Do I need to connect to Redis?
  251. No, connecting to Redis is not required.
  252. ### 8 `Error: Range of input length should be [1, 30000]`
  253. This error occurs because there are too many chunks matching your search criteria. Try reducing the **TopN** and increasing **Similarity threshold** to fix this issue:
  254. 1. Click **Chat** in the middle top of the page.
  255. 2. Right click the desired conversation > **Edit** > **Prompt Engine**
  256. 3. Reduce the **TopN** and/or raise **Silimarity threshold**.
  257. 4. Click **OK** to confirm your changes.
  258. ![topn](https://github.com/infiniflow/ragflow/assets/93570324/7ec72ab3-0dd2-4cff-af44-e2663b67b2fc)
  259. ### 9 How to update RAGFlow to the latest version?
  260. 1. Pull the latest source code
  261. ```bash
  262. cd ragflow
  263. git pull
  264. ```
  265. 2. If you used `docker compose up -d` to start up RAGFlow server:
  266. ```bash
  267. docker pull infiniflow/ragflow:dev
  268. ```
  269. ```bash
  270. docker compose up ragflow -d
  271. ```
  272. 3. If you used `docker compose -f docker-compose-CN.yml up -d` to start up RAGFlow server:
  273. ```bash
  274. docker pull swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:dev
  275. ```
  276. ```bash
  277. docker compose -f docker-compose-CN.yml up -d
  278. ```