ragflow README

项目的 README,来自 github.com/infiniflow/ragflow。合并为一个 markdown 文件:README.md。

ragflow logo

README in English 简体中文版自述文件 繁體版中文自述文件 日本語のREADME 한국어 README en Français Bahasa Indonesia Português(Brasil) README in Arabic Türkçe README Русская версия README

follow on X(Twitter) Static Badge RAGFlow Docker image downloads Latest Release license

Cloud | Documentation | Roadmap | Discord

RAGFlow in the GitHub Octoverse
infiniflow%2Fragflow | Trendshift
📕 Table of Contents

💡 What is RAGFlow?

RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge RAG with Agent capabilities to create a superior context layer for LLMs. It offers a streamlined RAG workflow adaptable to enterprises of any scale. Powered by a converged context engine and pre-built agent templates, RAGFlow enables developers to transform complex data into high-fidelity, production-ready AI systems with exceptional efficiency and precision.

🎮 Get Started

Try our cloud service at https://cloud.ragflow.io.

For local deployment, see Local Deployment.

Chunking demonstration Agentic workflow demonstration

🔥 Latest Updates

See the full release notes for more updates.

🌟 Key Features

🍭 "Quality in, quality out"

🍱 Template-based chunking

🧩 Knowledge Compilation

🧠 Agentic Retrieval

🌱 Grounded citations with reduced hallucinations

🍔 Compatibility with heterogeneous data sources

🛀 Automated and effortless RAG workflow

🔎 System Architecture

RAGFlow system architecture

🏠 Local Deployment

Local deployment supports both Docker deployment and launching from source. Docker is suitable for quick evaluation, integration testing, and production deployment, while launching from source is intended for RAGFlow development and debugging. Docker deployment does not require a Go compiler. Launching from source requires the Go version specified in go.mod; frontend development additionally requires Node.js and npm.

🐳 Docker Deployment

📝 Docker Deployment Prerequisites

[!TIP] If you have not installed Docker on your local machine (Windows, macOS, or Linux), see Install Docker Engine.

🚀 Start up the server

  1. If using Elasticsearch, set vm.max_map_count on the Docker host to at least 262144. This step is usually unnecessary with Infinity:

    To check the value of vm.max_map_count:

    sysctl vm.max_map_count
    

    If you use Elasticsearch and the value is below 262144, reset it:

    # 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:

    vm.max_map_count=262144
    
  2. Clone the repository:

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

    Enter the Docker deployment directory.

    cd ragflow/docker
    

    Check out the v1.0.0 release tag.

    git checkout v1.0.0
    

    Start the RAGFlow services and their dependencies.

    docker compose -f docker-compose.yml up -d
    

    With the default MySQL configuration, the image entrypoint runs database migrations before starting Admin, Syncer, Ingestor, API, and other services.

    In the RAGFlow open-source 1.0 release, DeepDoc uses CPU inference for layout analysis, OCR, and table recognition.

  4. Check the server status after startup:

    Use docker ps to check the dependency services. After the dependencies show healthy and the RAGFlow container remains running, use the HTTP endpoint to determine whether RAGFlow is ready. The RAGFlow container itself does not define a Compose healthcheck.

    curl -f http://localhost/api/v1/system/healthz
    

    After receiving an HTTP 200 response, open the Web UI. If you changed SVR_WEB_HTTP_PORT, replace the port in the health-check URL accordingly.

    If startup fails, inspect the container logs:

    docker logs --tail 50 ragflow-cpu
    
  5. In your web browser, enter the IP address of your server and log in to RAGFlow.

    With the default settings, you only need to enter http://IP_OF_YOUR_MACHINE (without port number), because the default HTTP serving port 80 can be omitted when using the default configuration.

  6. After signing in, add an LLM, embedding, and reranker on the model provider page, including the model name, service address, and API key.

    For details, see llm_api_key_setup.

    The show is on!

See the Quickstart guide for details.

⚙️ Docker Configuration and Adjustment

Docker deployment uses docker/.env and docker/docker-compose.yml. Configure the image, ports, passwords, document engine, and model image source as described in the Docker configuration guide. For platform support (note that macOS is not currently supported), see the Go Docker image build and platform support guide. To build the Docker image from source, see the Go Docker image build and platform support guide.

For document-engine changes, configuration updates, restarting services, and retaining or removing existing data, follow the Docker configuration guide.

🔨 Launch from Source

📝 Source Build Prerequisites

  1. Clone the repository and install the Go version specified in go.mod (currently Go 1.27), Clang 20, LLD 20, CMake ≥ 4.0, and PCRE2 development files. Go services depend on CGO and native static libraries; build.sh sets the required build parameters.

    git clone https://github.com/infiniflow/ragflow.git
    cd ragflow
    
  2. Run the dependency download script once to prepare everything the local Go server needs to build, run, parse documents and count tokens (download_dev_deps.py fetches the native static libraries and the runtime resources — cl100k vocabulary, DeepDoc .ort weights, embedding tokenizer assets):

    uv run tools/scripts/download_dev_deps.py
    

    This is the local-dev one-stop: after one run the environment is ready, and already-present files are skipped so re-running never re-downloads. The image-facing counterpart deps/download_deps.py fetches the same runtime resources and skips the native .a files — run it only when building the dependency image or in CI, not for local development.

    download_dev_deps.py pulls and unpacks pdfium, pdf_oxide, office_oxide, and onnxruntime under ~/ragflow-native-libs, and writes the cl100k vocabulary, DeepDoc models, and embedding tokenizer assets under deps/. It is a Python script; uv run installs its declared dependencies (requests and huggingface-hub) automatically. Skip this step if you have prepared the same resources by other means. When started from the repository root, Go services automatically find internal/rag/res/deepdoc; to start from another directory, set DEEPDOC_MODEL_DIR to its absolute path.

  3. Build the services:

    ./build.sh --all
    
  4. Start the local dependency services and make sure the hosts and ports in conf/service_conf.yaml point to addresses accessible from the host. If using Elasticsearch, first set vm.max_map_count on the Docker host to at least 262144.

    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
    
  5. Start RAGFlow:

    ./bin/ragflow_server
    

    The OSS server runs all services in one Go process. It migrates the database, starts Admin and initializes the superuser, then starts API, Ingestor, Syncer, and Chatter. Admin listens on 9381 and API on 9380 by default. Stop the process to stop all services. Configure service settings in conf/service_conf.yaml or environment variables.

  6. Inspect the available options with ./bin/ragflow_server --help.

  7. Only when developing the frontend, install Node.js and npm, then start the React frontend:

    cd web
    npm install
    

    After the services start, confirm that the API is ready:

    curl -f http://127.0.0.1:9380/api/v1/system/healthz
    

    An HTTP 200 response indicates that the API is responding. See Launch Service from Source for complete frontend and DeepDoc verification steps.

See Launch Service from Source for details.

📚 Documentation

📜 Roadmap

See the RAGFlow Roadmap 2026.

🏄 Community

🙌 Contributing

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 first.

🤝 Sponsors

CodeRabbit
Code reviews powered by CodeRabbit

ragflow (infiniflow/ragflow)

正在搜索数据库…

这是什么?RAGFlow 是一个开源的检索增强生成(RAG)引擎,它将 RAG 与 Agent 能力相结合,为大语言模型构建上下文层,把复杂的企业数据转化为可用于生产环境的 AI 系统。
这是我要导入代码的库,还是需要部署的独立服务器?这是一个独立的自托管服务器,带有网页界面,通过 Docker Compose 启动,而不是需要导入到代码中的库。
我该怎么让它跑起来?克隆仓库,通过 docker compose 使用预构建的 Docker 镜像启动服务器,然后在浏览器中打开服务器的 IP 地址(默认端口为 80)即可登录。
启动之前需要先安装什么?你需要 Docker >=24.0.0 和 Docker Compose >=v2.26.1,还需要至少 4 个 CPU 核心、16GB 内存和 50GB 磁盘空间;如果从源码构建,还需要 Python >=3.13 和 uv 工具。
预构建的 Docker 镜像能在 ARM64 机器上直接使用吗?不能。所有官方 Docker 镜像都只为 x86 架构构建,ARM64 用户需要自行构建镜像。此外,在 Linux/arm64 上将文档引擎切换为 Infinity 目前也尚未获得官方支持。
RAGFlow 可以导入哪些文档格式?它支持 Word、幻灯片、Excel、TXT 文件、图片、扫描件、结构化数据和网页,并能深度理解复杂版式的文档。
我可以更换底层的搜索引擎吗?可以。RAGFlow 默认使用 Elasticsearch 存储文本和向量,但只需在 docker/.env 中设置 DOCENGINE 并重启容器,即可切换为 Infinity。
RAGFlow 支持 Agent 工作流和 MCP 吗?支持。它在 2025 年 8 月新增了 Agent 工作流和 MCP 支持,还加入了 Python/JavaScript 代码执行器组件,以及面向 AI Agent 的持久化“Memory”(记忆)功能。
如果我不想自己部署,有托管版本吗?有。RAGFlow 提供云服务,你可以直接试用,无需自己运行 Docker 部署。
大小
197.7 MB
星标
95K
时长
2年
提交 · 90 天