2024-03-11 16:19:03 +08:00
< div align = "center" >
2024-03-27 09:53:42 +08:00
< a href = "https://demo.ragflow.io/" >
2024-04-08 19:20:57 +08:00
< img src = "web/src/assets/logo-with-text.png" width = "520" alt = "ragflow logo" >
2024-03-11 16:19:03 +08:00
< / a >
< / div >
2024-02-28 15:01:12 +08:00
2024-03-11 16:19:03 +08:00
< p align = "center" >
< a href = "./README.md" > English< / a > |
2024-04-04 10:26:39 +09:00
< a href = "./README_zh.md" > 简体中文< / a > |
< a href = "./README_ja.md" > 日本語< / a >
2024-03-11 16:19:03 +08:00
< / p >
2024-02-28 15:01:12 +08:00
2024-03-11 16:19:03 +08:00
< p align = "center" >
2024-04-25 19:34:21 +08:00
< a href = "https://github.com/infiniflow/ragflow/releases/latest" >
2024-04-25 14:31:54 +08:00
< img src = "https://img.shields.io/github/v/release/infiniflow/ragflow?color=blue&label=Latest%20Release" alt = "Latest Release" >
< / a >
2024-03-27 09:53:42 +08:00
< a href = "https://demo.ragflow.io" target = "_blank" >
2024-03-11 16:19:03 +08:00
< img alt = "Static Badge" src = "https://img.shields.io/badge/RAGFLOW-LLM-white?&labelColor=dd0af7" > < / a >
< a href = "https://hub.docker.com/r/infiniflow/ragflow" target = "_blank" >
2024-04-26 20:07:26 +08:00
< img src = "https://img.shields.io/badge/docker_pull-ragflow:v0.4.0-brightgreen"
alt="docker pull infiniflow/ragflow:v0.4.0">< / a >
2024-03-11 16:19:03 +08:00
< a href = "https://github.com/infiniflow/ragflow/blob/main/LICENSE" >
< img height = "21" src = "https://img.shields.io/badge/License-Apache--2.0-ffffff?style=flat-square&labelColor=d4eaf7&color=7d09f1" alt = "license" >
< / a >
< / p >
2024-03-29 09:51:36 +08:00
2024-03-31 15:07:12 +08:00
## 💡 What is RAGFlow?
2024-03-28 17:22:02 +08:00
2024-04-04 01:00:20 +09:00
[RAGFlow ](https://demo.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.
2024-03-11 16:19:03 +08:00
2024-03-29 09:51:36 +08:00
## 🌟 Key Features
2024-04-01 10:54:11 +08:00
2024-03-31 21:22:40 +08:00
### 🍭 **"Quality in, quality out"**
2024-04-01 10:54:11 +08:00
2024-04-01 14:00:01 +08:00
- [Deep document understanding ](./deepdoc/README.md )-based knowledge extraction from unstructured data with complicated formats.
2024-04-01 10:54:11 +08:00
- Finds "needle in a data haystack" of literally unlimited tokens.
2024-03-31 21:35:59 +08:00
2024-03-31 21:22:40 +08:00
### 🍱 **Template-based chunking**
2024-04-01 10:54:11 +08:00
- Intelligent and explainable.
- Plenty of template options to choose from.
2024-03-31 21:35:59 +08:00
2024-03-31 21:22:40 +08:00
### 🌱 **Grounded citations with reduced hallucinations**
2024-04-01 10:54:11 +08:00
- Visualization of text chunking to allow human intervention.
- Quick view of the key references and traceable citations to support grounded answers.
2024-03-31 21:35:59 +08:00
2024-03-31 21:22:40 +08:00
### 🍔 **Compatibility with heterogeneous data sources**
2024-04-01 10:54:11 +08:00
- Supports Word, slides, excel, txt, images, scanned copies, structured data, web pages, and more.
2024-03-31 21:35:59 +08:00
2024-03-31 21:22:40 +08:00
### 🛀 **Automated and effortless RAG workflow**
2024-04-01 10:54:11 +08:00
- Streamlined RAG orchestration catered to both personal and large businesses.
- Configurable LLMs as well as embedding models.
- Multiple recall paired with fused re-ranking.
- Intuitive APIs for seamless integration with business.
2024-02-28 15:01:12 +08:00
2024-04-12 19:55:50 +08:00
## 📌 Latest Features
2024-04-26 17:21:53 +08:00
- 2024-04-26 Add file management.
2024-04-19 20:13:39 +08:00
- 2024-04-19 Support conversation API ([detail ](./docs/conversation_api.md )).
2024-04-16 19:23:09 +08:00
- 2024-04-16 Add an embedding model 'bce-embedding-base_v1' from [BCEmbedding ](https://github.com/netease-youdao/BCEmbedding ).
2024-04-17 16:32:36 +08:00
- 2024-04-16 Add [FastEmbed ](https://github.com/qdrant/fastembed ), which is designed specifically for light and speedy embedding.
2024-04-12 19:55:50 +08:00
- 2024-04-11 Support [Xinference ](./docs/xinference.md ) for local LLM deployment.
2024-04-15 17:01:18 +08:00
- 2024-04-10 Add a new layout recognization model for analyzing Laws documentation.
2024-04-12 19:55:50 +08:00
- 2024-04-08 Support [Ollama ](./docs/ollama.md ) for local LLM deployment.
- 2024-04-07 Support Chinese UI.
2024-03-29 09:51:36 +08:00
## 🔎 System Architecture
2024-03-28 17:22:02 +08:00
2024-03-29 09:51:36 +08:00
< div align = "center" style = "margin-top:20px;margin-bottom:20px;" >
< img src = "https://github.com/infiniflow/ragflow/assets/12318111/d6ac5664-c237-4200-a7c2-a4a00691b485" width = "1000" / >
< / div >
2024-03-28 17:22:02 +08:00
## 🎬 Get Started
2024-03-11 16:19:03 +08:00
2024-03-29 09:51:36 +08:00
### 📝 Prerequisites
2024-04-19 18:02:53 +08:00
- CPU >= 4 cores
2024-04-24 19:22:00 +08:00
- RAM >= 16 GB
2024-04-25 14:00:48 +08:00
- Disk >= 50 GB
2024-04-11 10:13:43 +08:00
- Docker >= 24.0.0 & Docker Compose >= v2.26.1
2024-03-31 17:51:14 +08:00
> If you have not installed Docker on your local machine (Windows, Mac, or Linux), see [Install Docker Engine](https://docs.docker.com/engine/install/).
2024-03-31 15:07:12 +08:00
2024-03-31 21:35:59 +08:00
### 🚀 Start up the server
2024-03-31 15:07:12 +08:00
2024-04-07 09:41:53 +08:00
1. Ensure `vm.max_map_count` >= 262144 ([more ](./docs/max_map_count.md )):
2024-03-31 15:07:12 +08:00
> To check the value of `vm.max_map_count`:
>
2024-04-01 10:54:11 +08:00
> ```bash
2024-03-31 15:07:12 +08:00
> $ sysctl vm.max_map_count
> ```
>
2024-04-07 09:41:53 +08:00
> Reset `vm.max_map_count` to a value at least 262144 if it is not.
2024-03-31 15:07:12 +08:00
>
> ```bash
> # In this case, we set it to 262144:
> $ sudo sysctl -w vm.max_map_count=262144
> ```
>
> 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:
>
> ```bash
> vm.max_map_count=262144
> ```
2. Clone the repo:
2024-03-29 09:51:36 +08:00
```bash
$ git clone https://github.com/infiniflow/ragflow.git
```
2024-04-01 10:54:11 +08:00
3. Build the pre-built Docker images and start up the server:
2024-03-29 09:51:36 +08:00
2024-03-31 13:15:42 +08:00
```bash
$ cd ragflow/docker
2024-04-08 19:59:31 +08:00
$ chmod +x ./entrypoint.sh
2024-03-31 13:15:42 +08:00
$ docker compose up -d
```
2024-03-11 16:19:03 +08:00
2024-04-07 09:41:53 +08:00
> The core image is about 9 GB in size and may take a while to load.
2024-03-31 13:15:42 +08:00
2024-03-31 19:43:16 +08:00
4. Check the server status after having the server up and running:
2024-04-01 10:54:11 +08:00
2024-03-31 13:15:42 +08:00
```bash
2024-03-31 15:07:12 +08:00
$ docker logs -f ragflow-server
2024-03-31 13:15:42 +08:00
```
2024-04-01 10:54:11 +08:00
_The following output confirms a successful launch of the system:_
2024-02-29 18:53:02 +08:00
2024-03-31 17:51:14 +08:00
```bash
2024-04-01 10:54:11 +08:00
____ ______ __
2024-03-31 17:51:14 +08:00
/ __ \ ____ _ ____ _ / ____ // /____ _ __
/ /_/ // __ `// __ ` // /_ / // __ \| | /| / /
2024-04-01 10:54:11 +08:00
/ _, _ // /_/ // /_/ // __ / / // /_/ /| |/ |/ /
/_/ |_| \__,_/ \__, //_/ /_/ \____/ |__/|__/
/____/
2024-03-31 17:51:14 +08:00
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:9380
2024-04-08 19:20:57 +08:00
* Running on http://x.x.x.x:9380
2024-03-31 17:51:14 +08:00
INFO:werkzeug:Press CTRL+C to quit
2024-04-01 10:54:11 +08:00
```
2024-04-24 17:04:23 +08:00
> If you skip this confirmation step and directly log in to RAGFlow, your browser may prompt a `network anomaly` error because, at that moment, your RAGFlow may not be fully initialized.
2024-03-11 16:19:03 +08:00
2024-04-08 19:20:57 +08:00
5. In your web browser, enter the IP address of your server and log in to RAGFlow.
2024-04-24 17:04:23 +08:00
> With 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.
2024-03-31 21:35:59 +08:00
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.
2024-04-01 10:54:11 +08:00
2024-03-31 21:35:59 +08:00
> See [./docs/llm_api_key_setup.md](./docs/llm_api_key_setup.md) for more information.
2024-03-27 09:53:42 +08:00
2024-04-01 10:54:11 +08:00
_The show is now on!_
2024-03-28 19:15:16 +08:00
2024-03-28 17:22:02 +08:00
## 🔧 Configurations
2024-03-27 09:53:42 +08:00
2024-03-31 17:51:14 +08:00
When it comes to system configurations, you will need to manage the following files:
- [.env ](./docker/.env ): Keeps the fundamental setups for the system, such as `SVR_HTTP_PORT` , `MYSQL_PASSWORD` , and `MINIO_PASSWORD` .
- [service_conf.yaml ](./docker/service_conf.yaml ): Configures the back-end services.
2024-03-31 19:43:16 +08:00
- [docker-compose.yml ](./docker/docker-compose.yml ): The system relies on [docker-compose.yml ](./docker/docker-compose.yml ) to start up.
2024-03-31 17:51:14 +08:00
2024-04-01 10:54:11 +08:00
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.
2024-03-29 09:51:36 +08:00
2024-03-31 21:35:59 +08:00
> 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.
2024-03-11 16:19:03 +08:00
2024-04-01 10:58:12 +08:00
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` .
2024-03-27 13:14:36 +08:00
2024-03-31 17:51:14 +08:00
> Updates to all system configurations require a system reboot to take effect:
2024-04-01 10:54:11 +08:00
>
2024-03-31 17:51:14 +08:00
> ```bash
> $ docker-compose up -d
> ```
2024-03-27 13:14:36 +08:00
2024-03-31 15:07:12 +08:00
## 🛠️ Build from source
To build the Docker images from source:
```bash
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
2024-04-26 20:07:26 +08:00
$ docker build -t infiniflow/ragflow:v0.4.0 .
2024-03-31 15:07:12 +08:00
$ cd ragflow/docker
2024-04-08 19:59:31 +08:00
$ chmod +x ./entrypoint.sh
2024-03-31 15:07:12 +08:00
$ docker compose up -d
```
2024-04-12 19:55:50 +08:00
## 📚 Documentation
2024-04-08 19:20:57 +08:00
2024-04-12 19:55:50 +08:00
- [FAQ ](./docs/faq.md )
2024-04-08 19:20:57 +08:00
2024-03-28 17:22:02 +08:00
## 📜 Roadmap
2024-03-11 16:19:03 +08:00
2024-03-31 15:07:12 +08:00
See the [RAGFlow Roadmap 2024 ](https://github.com/infiniflow/ragflow/issues/162 )
2024-03-11 16:19:03 +08:00
2024-03-29 09:51:36 +08:00
## 🏄 Community
2024-03-11 16:19:03 +08:00
2024-04-15 10:51:32 +08:00
- [Discord ](https://discord.gg/4XxujFgUN7 )
2024-03-29 09:51:36 +08:00
- [Twitter ](https://twitter.com/infiniflowai )
2024-03-11 16:19:03 +08:00
2024-03-28 17:22:02 +08:00
## 🙌 Contributing
2024-03-11 16:19:03 +08:00
2024-04-01 20:28:43 +08:00
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 ](https://github.com/infiniflow/ragflow/blob/main/docs/CONTRIBUTING.md ) first.