infiniflow/ragflow

Open-source RAG engine combining deep document understanding, agentic retrieval and knowledge compilation, deployable via Docker or built from source.

  • 91.9k GitHub stars
  • Go
  • ⚖️ Apache-2.0
  • 🎯 Intermediate
git clone https://github.com/infiniflow/ragflow.git
infiniflow/ragflow preview image

What it is

RAGFlow is an open-source Retrieval-Augmented Generation engine that fuses RAG with Agent capabilities to provide a context layer for LLMs. It uses a converged context engine and pre-built agent templates to help developers turn complex data into production-ready AI systems. It can be used via a cloud service or deployed locally with Docker or from source.

Who it's for

  • Developers building production RAG and agent-based AI systems
  • Enterprises of any scale needing a streamlined RAG workflow
  • Teams that need to ingest heterogeneous documents (Word, Slides, Excel, TXT, images, scans, web pages) into LLM applications

Requirements

Requirements

  • Recommended starting configuration: 4 CPU cores, 16 GB RAM, and 50 GB of available disk space
  • Docker >= 24.0.0 and Docker Compose >= v2.26.1
  • vm.max_map_count of at least 262144 on the Docker host when using Elasticsearch
  • gVisor, only when using the Self-Managed container Sandbox
  • Linux x86_64 host for the Go backend (macOS is temporarily not supported)
  • For source builds: Go version in go.mod (currently Go 1.27), Clang 20, LLD 20, CMake ≥ 4.0, PCRE2 development files, native CGO libraries; Node.js and npm only for frontend development

Setup

  1. Set vm.max_map_count (Elasticsearch only)

    If using Elasticsearch, check the value and raise it to at least 262144 if lower. Usually unnecessary with Infinity. Add it to /etc/sysctl.conf to persist across reboots.

    bash
    sysctl vm.max_map_count
    sudo sysctl -w vm.max_map_count=262144
  2. Clone the repository

    Clone the RAGFlow repository.

    bash
    git clone https://github.com/infiniflow/ragflow.git
  3. Check out the release tag and start with Docker Compose

    Enter the docker directory, check out the Go v1.0.0-rc1 release tag, and start the services in the background.

    bash
    # Enter the Docker deployment directory.
    cd ragflow/docker
    # Check out the Go v1.0.0-rc1 release tag.
    git checkout v1.0.0-rc1
    # Start the Go services and their dependencies in the background.
    docker compose -f docker-compose.yml up -d
  4. Verify service status and readiness

    docker ps shows dependency status. RAGFlow itself defines no Compose healthcheck, so confirm readiness through the API; HTTP 200 indicates readiness. If SVR_WEB_HTTP_PORT was changed, use that port.

    bash
    docker ps
    curl -f http://localhost/api/v1/system/healthz
  5. Log in and configure models

    Open http://IP_OF_YOUR_MACHINE in a browser (port 80 can be omitted by default) and log in. Then add an LLM, embedding, and reranker on the model provider page, including model name, service address, and API key.

Examples

Inspect logs if startup fails

bash
bash
docker logs --tail 50 <service>

What it does: The README suggests inspecting the relevant service logs this way when startup fails.

Start local dependencies for a source build

bash
bash
sudo sysctl -w vm.max_map_count=262144
docker compose --env-file docker/.env -f docker/docker-compose-base.yml \
  up -d --wait es01 mysql minio nats kvrocks clickhouse

What it does: Brings up the dependency containers needed when running the Go services from source.

Migrate the database and start the API from source

bash
bash
./bin/ragflow_server --migrate
RAGFLOW_DEV_MODE=true ./bin/ragflow_server --api

What it does: Migration runs first (in its own terminal); then the API service starts on target port 9380. Admin, Ingestor and Syncer are started separately in their own terminals.

Run the React frontend for development

bash
bash
cd web
npm install
API_PROXY_SCHEME=go npm run dev

What it does: Only needed when developing the frontend.

Pros & cons

Pros

  • Pro:Template-based chunking with visualization of text chunking allows human intervention and traceable citations to reduce hallucinations
  • Pro:Agentic Retrieval with Low, Medium, High, or Ultra thinking modes for multi-step retrieval on complex questions
  • Pro:Supports heterogeneous data sources including Word, Slides, Excel, TXT, images, scanned copies, structured data and web pages
  • Pro:Configurable LLMs and embedding models, multiple recall with fused re-ranking, and APIs for integration

Cons

  • Con:Docker deployment has a sizable recommended baseline (4 CPU cores, 16 GB RAM, 50 GB disk), with more needed for local models
  • Con:The Go backend does not currently support macOS; a Linux x86_64 host is required
  • Con:Building from source is involved, requiring Go, Clang 20, LLD 20, CMake ≥ 4.0, CGO native libraries and multiple service terminals

Images