RAGflow
Retrieval-Augmented Generation service for enterprise document indexing, semantic search, and knowledge graphs
Updated 2026-11-03
Verified 2026-11-03
The RAGflow service (cosmos-ragflow-v3) provides Retrieval-Augmented Generation (RAG) capabilities for enterprise document indexing and semantic search. It processes documents, generates embeddings, and stores them in PostgreSQL with pgvector for vector similarity search. It also builds knowledge graphs over indexed files and runs retrieval evaluations.
Architecture
- Framework: FastAPI + SQLAlchemy; the webserver applies Alembic migrations (
alembic upgrade head) when it starts - Vector Database: PostgreSQL + pgvector (
VECTOR_STORE_TYPEdefaultpostgres) - Graph Store: Neo4j by default (
GRAPH_STORE_TYPE) - Async Processing: Celery + Redis, with separate queues for bulk indexing (
ragflow-indexing), interactive work (ragflow-interactive), and deep search (ragflow-search) - Embeddings:
EMBEDDING_PROVIDER(defaultazure) withEMBEDDING_MODEL(defaulttext-embedding-3-small) - Document Parsing: PDF (Docling, run in a subprocess), DOCX, PPTX, XLSX, and images including GIF (Tesseract OCR)
- Dependencies:
uv(pyproject.toml+uv.lock); the image runsuv syncinto/app/.venv - Telemetry: Cloud deployments start each process under
opentelemetry-instrument, which reports to Azure Monitor throughAPPLICATIONINSIGHTS_CONNECTION_STRING
Components
| Component | Container | Description |
|---|---|---|
| API Server | ragflow-web | REST API for parsing, indexing, search, graphs, and evaluation |
| Worker | ragflow-worker | Celery worker for bulk document indexing |
| Interactive Worker | ragflow-interactive-worker | Celery worker for short interactive tasks |
| Search Worker | ragflow-search-worker | Celery worker for deep-search jobs |
Processing Pipeline
RAGflow indexing and retrieval pipeline
SourceLoading diagram...
API Overview
Files
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/parse | Parse a Storage file into text |
| POST | /api/v1/inspect | Inspect a file's structure (sheets, pages, tables) |
| POST | /api/v1/read-range | Bounded read of part of a file |
| POST | /api/v1/query-file-table | Query a table inside a file |
| POST | /api/v1/search-file | Search within a single file |
The bounded-read endpoints also have upload variants that accept the file in the request instead of a Storage reference: /api/v1/inspect-upload, /api/v1/read-range-upload, /api/v1/query-file-table-upload, and /api/v1/search-upload.
Collections and search
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/collections/index/create | Create an index from files |
| PUT | /api/v1/collections/index/{index_id}/update | Add or replace files in an index |
| GET | /api/v1/collections/index/status/{request_id} | Indexing request status |
| POST | /api/v1/collections/index/{index_id}/cancel | Cancel indexing |
| GET | /api/v1/collections/index/list | List indexes |
| GET, DELETE | /api/v1/collections/index/{index_id}/files | List or remove indexed files |
| DELETE | /api/v1/collections/index/{index_id} | Delete an index |
| DELETE | /api/v1/collections/indexes | Delete several indexes |
| POST | /api/v1/collections/index/metrics | Size metrics for 1–100 index IDs |
| POST | /api/v1/collections/search | Semantic search |
| POST | /api/v1/collections/search/deep | Start a deep-search job |
| GET | /api/v1/collections/search/deep/{job_id} | Deep-search job result |
POST /index/metrics takes index_ids (1–100 unique UUIDs) and returns searchable_chunk_count and index_storage_bytes per index, plus missing_index_ids, measured_index_count, cached_index_count, and failed_indexes.
Knowledge graphs and evaluation
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/graph/build | Build a knowledge graph |
| GET | /api/v1/graph/list | List graphs |
| GET | /api/v1/graph/{graph_id}/status | Graph build status |
| GET, POST | /api/v1/graph/{graph_id}/files | List or add graph files |
| GET | /api/v1/graph/{graph_id}/visualization | Visualization data (nodes 1–5000) |
| GET | /api/v1/graph/{graph_id}/communities | Communities (1–500; values outside the range return 422) |
| GET | /api/v1/graph/{graph_id}/suggested-entity-types | Suggested entity types for a graph |
| POST | /api/v1/graph/{graph_id}/approve-entity-types | Approve entity types and continue the build |
| POST | /api/v1/graph/{graph_id}/cancel | Cancel a graph build |
| DELETE | /api/v1/graph/{graph_id} | Delete a graph |
| POST | /api/v1/evaluation/run, /api/v1/evaluation/compare | Run or compare retrieval evaluations |
| GET | /api/v1/evaluation/list, /api/v1/evaluation/{evaluation_id} | Evaluation results |
| GET | /api/v1/evaluation/{evaluation_id}/questions/{question_id}/chunks | Retrieved chunks for one question |
| DELETE | /api/v1/evaluation/{evaluation_id}/questions | Remove questions from an evaluation |
| POST | /api/v1/evaluation/{evaluation_id}/recompute | Recompute evaluation scores |
| GET | /health/ | Health check |
Multi-Tenant and Project Isolation
Indexes are isolated per organization. Search requests can be project-scoped with X-Project-Id; RAGflow then checks cosmos.kb.read and re-authorizes each target index. Deep-search jobs are bound to the subject and project that started them.
Configuration
| Variable | Description |
|---|---|
POSTGRES_HOST | PostgreSQL host |
POSTGRES_USER | Database user |
POSTGRESPASSWORD | Base64-encoded password |
POSTGRES_DB | Database name (ragflow_dev) |
EMBEDDING_PROVIDER | Embedding provider (default azure) |
EMBEDDING_MODEL | Embedding model (default text-embedding-3-small) |
GRAPH_STORE_TYPE | Graph store (default neo4j) |
GRAPH_TASK_SOFT_TIME_LIMIT | Soft time limit for graph tasks (default 4 hours) |
MAX_UPLOAD_BYTES | Upload limit for the upload endpoints (default 150 MiB) |
INDEXING_HARD_CEILING_BYTES | Largest file accepted for indexing (default 3 GiB; 0 disables). Excel files use INDEXING_EXCEL_CEILING_BYTES (default 100 MB). |
Prerequisites
- PostgreSQL 15+ with
pgvectorextension enabled - Redis server for Celery task queue
- Tesseract OCR for image document parsing (installed in the image)
# Enable pgvector (run as PostgreSQL admin)
CREATE EXTENSION IF NOT EXISTS vector;
Integration Points
| Service | Integration |
|---|---|
| Configurator | Collection management — creates/deletes indexes via Configurator |
| Storage | Source files for parsing and indexing, with DMS file authorization |
| ADK | Agent knowledge base search during conversations |
| MCP | Inbuilt KB search tool |
ℹ️ Info: RAGflow is an optional service. Start it with
./manage.sh dev start knowledge.