- Curated guides under docs/; trim China-only integration docs and screenshots - Root and main README set aligned with westernized product positioning - LICENSE text update where applicable
6.8 KiB
RAGFlow Integration Guide
This guide covers two parts:
- how to deploy RAGFlow
- how to connect RAGFlow to the Admin Console
If you already run RAGFlow successfully, you can skip the deployment section and go straight to the Admin Console setup.
Part 1: Deploy RAGFlow
Step 1: Confirm that MySQL and Redis are reachable
RAGFlow depends on MySQL and Redis. If you already deployed the Admin Console stack, you may be able to reuse the same services.
From the host machine, test whether MySQL and Redis are reachable:
telnet 127.0.0.1 3306
telnet 127.0.0.1 6379
If both ports are reachable, continue to Step 2.
If they are not reachable:
- if your MySQL installation is isolated by your own packaging or service setup, fix host access to
3306first - if you deployed MySQL and Redis through this project's
docker-compose_all.yml, expose those ports explicitly
Example before:
xiaozhi-esp32-server-db:
...
networks:
- default
expose:
- "3306:3306"
xiaozhi-esp32-server-redis:
...
expose:
- 6379
Example after:
xiaozhi-esp32-server-db:
...
networks:
- default
ports:
- "3306:3306"
xiaozhi-esp32-server-redis:
...
ports:
- "6379:6379"
After updating the compose file, restart the services:
# Run this in the directory that contains docker-compose_all.yml
cd xiaozhi-server
docker compose -f docker-compose_all.yml down
docker compose -f docker-compose.yml up -d
Then test again:
telnet 127.0.0.1 3306
telnet 127.0.0.1 6379
Step 2: Create the database and user
Once MySQL is reachable from the host, create the rag_flow database and user:
CREATE DATABASE IF NOT EXISTS rag_flow CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'rag_flow'@'%' IDENTIFIED BY 'infini_rag_flow';
GRANT ALL PRIVILEGES ON rag_flow.* TO 'rag_flow'@'%';
FLUSH PRIVILEGES;
Step 3: Download the RAGFlow project
Choose a working directory and clone RAGFlow. The original guide used v0.22.0:
git clone https://ghfast.top/https://github.com/infiniflow/ragflow.git
cd ragflow
git checkout v0.22.0
cd docker
Edit ragflow/docker/docker-compose.yml and remove the depends_on block from ragflow-cpu and ragflow-gpu so they no longer expect RAGFlow's bundled MySQL service.
Before:
ragflow-cpu:
depends_on:
mysql:
condition: service_healthy
profiles:
- cpu
...
ragflow-gpu:
depends_on:
mysql:
condition: service_healthy
profiles:
- gpu
After:
ragflow-cpu:
profiles:
- cpu
...
ragflow-gpu:
profiles:
- gpu
Then edit ragflow/docker/docker-compose-base.yml and remove the bundled mysql and redis services if you want RAGFlow to reuse the services from your Xiaozhi deployment.
Before:
services:
minio:
image: quay.io/minio/minio:RELEASE.2025-06-13T11-33-47Z
...
mysql:
image: mysql:8.0
...
redis:
image: redis:6.2-alpine
...
After:
services:
minio:
image: quay.io/minio/minio:RELEASE.2025-06-13T11-33-47Z
...
Step 4: Update environment variables
Edit ragflow/docker/.env and update the database and Redis settings carefully.
Important: make sure MYSQL_USER exists. Missing this field is a common setup mistake.
# Port settings
SVR_WEB_HTTP_PORT=8008
SVR_WEB_HTTPS_PORT=8009
# MySQL
MYSQL_HOST=host.docker.internal
MYSQL_PORT=3306
MYSQL_USER=rag_flow
MYSQL_PASSWORD=infini_rag_flow
MYSQL_DBNAME=rag_flow
# Redis
REDIS_HOST=host.docker.internal
REDIS_PORT=6379
REDIS_PASSWORD=
If your Redis instance does not require a password, also edit ragflow/docker/service_conf.yaml.template.
Before:
redis:
db: 1
password: '${REDIS_PASSWORD:-infini_rag_flow}'
host: '${REDIS_HOST:-redis}:6379'
After:
redis:
db: 1
password: '${REDIS_PASSWORD:-}'
host: '${REDIS_HOST:-redis}:6379'
Step 5: Start RAGFlow
docker-compose -f docker-compose.yml up -d
To inspect logs:
docker logs -n 20 -f docker-ragflow-cpu-1
If the logs show no startup errors, RAGFlow should be running successfully.
Step 6: Create an account
Open http://127.0.0.1:8008, choose Sign Up, and create an account.
If you want to disable public signups later, set:
REGISTER_ENABLED=0
Then restart the stack:
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose.yml up -d
Step 7: Configure models inside RAGFlow
Sign in to RAGFlow, open the user menu, and go to settings.
Then:
- open
Model Providers - add an
LLMprovider and enter its API key - add a
TEXT EMBEDDINGprovider and enter its API key - refresh the page
- choose default models for both LLM and embedding
Make sure your provider account has access to the models you select.
Part 2: Connect RAGFlow to the Admin Console
Step 1: Create an API key in RAGFlow
Open http://127.0.0.1:8008 and sign in.
From the user menu:
- open settings
- choose
API - open
API Key - select
Create new Key - copy the generated API key
You will need that key in the Admin Console.
Step 2: Enable the knowledge base feature
Make sure your Admin Console version is 0.8.7 or newer, and sign in with a super administrator account.
Enable the knowledge base feature first:
- open
Parameter Dictionary - open
System Feature Configuration - enable
Knowledge Base - save the configuration
The knowledge base section should now appear in the navigation.
Step 3: Configure the RAGFlow provider
In the Admin Console:
- open
Model Configuration - open the
Knowledge Basesection - find
RAG_RAGFlow - choose
Edit
Set:
Service Address: the LAN-accessible RAGFlow URL, for examplehttp://192.168.1.100:8008API Key: the key you created in RAGFlow
Save the configuration.
Step 4: Create a knowledge base
Sign in to the Admin Console as a super administrator.
Then:
- open
Knowledge Base - choose
Add - enter a meaningful name and description
- save it
Use descriptive names and summaries so retrieval quality is better. For example, if the knowledge base is about company information, use a name such as Company Overview and a description that explains what the documents contain.
After saving:
- open the knowledge base details page
- choose
Addto upload documents - select
Parseafter upload - inspect the parsed chunks
- run
Retrieval Testto validate recall quality
Step 5: Attach the knowledge base to an agent
In the Admin Console:
- open
Agent - find the agent you want to configure
- choose
Configure Role - use
Edit Functionsnear the intent configuration area - select the knowledge base you want to attach
- save the change
At that point, the agent can use the RAGFlow-backed knowledge base during interactions.