# RAGFlow

> Open-source RAG engine with deep document understanding and grounded, traceable citations

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/infiniflow/ragflow
- Website: https://ragflow.io
- Canonical page: https://ai-tldr.dev/tools/ragflow/

## In short

RAGFlow is an open-source Retrieval-Augmented Generation (RAG) engine from InfiniFlow. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed Apache-2.0. To get started: set vm.max_map_count.

## Overview

RAGFlow is an open-source Retrieval-Augmented Generation (RAG) engine from InfiniFlow. It focuses on deep document understanding, parsing messy real-world files such as Word documents, slides, spreadsheets, scanned images, web pages, and structured data into chunks that an LLM can answer questions over.

It is aimed at developers and teams who need to build a question-answering layer on top of their own documents. You configure your own LLMs and embedding models, and RAGFlow handles the chunking, retrieval, re-ranking, and citation tracking so answers stay grounded in the source material.

As a RAG framework, it sits between your raw documents and your application. Compared with writing a retrieval pipeline by hand, it provides template-based chunking, visualized text splitting for human review, and traceable citations to reduce hallucinations.

## What it does

- Deep document understanding that extracts knowledge from unstructured files with complex formats
- Template-based chunking with multiple template options and visualized splitting for human review
- Grounded answers with traceable citations and quick access to key references
- Works with heterogeneous sources: Word, slides, Excel, text, images, scanned copies, structured data, and web pages
- Configurable LLMs and embedding models, with multiple recall paths and fused re-ranking
- APIs for integrating retrieval and answering into your own applications

## Getting started

RAGFlow is self-hosted with Docker Compose. You need Docker >= 24.0.0, Docker Compose >= v2.26.1, and a host with at least 4 CPU cores, 16 GB RAM, and 50 GB disk.

1. Set vm.max_map_count

   RAGFlow's vector store needs the kernel map count raised to at least 262144. Check and set it before starting (this resets on reboot).

```bash
sudo sysctl -w vm.max_map_count=262144
```

2. Clone the repository

   Get the source, which includes the Docker Compose files under the docker/ directory.

```bash
git clone https://github.com/infiniflow/ragflow.git
```

3. Start the server

   Bring up the stack with Docker Compose. The containers include the RAGFlow server and its dependencies.

```bash
cd ragflow/docker
docker compose -f docker-compose.yml up -d
```

4. Open the web UI

   Once the server is up, open a browser at the IP address of your machine (port 80 by default) and log in to RAGFlow to upload documents and start asking questions.

```text
http://IP_OF_YOUR_MACHINE
```

## When to use it

- Build a question-answering assistant over internal company documents and knowledge bases
- Add citation-backed answers to a product so users can trace responses to source passages
- Turn scanned PDFs, contracts, or reports into a searchable, grounded retrieval layer
- Prototype and self-host a RAG pipeline with your own choice of LLM and embedding models
