Sign in

RAGflow

Retrieval-Augmented Generation service for enterprise document indexing, semantic search, and knowledge graphs

ragflow
ragflowragvector-searchpgvectorembeddingsdocument-indexingknowledge-graph

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_TYPE default postgres)
  • 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 (default azure) with EMBEDDING_MODEL (default text-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 runs uv sync into /app/.venv
  • Telemetry: Cloud deployments start each process under opentelemetry-instrument, which reports to Azure Monitor through APPLICATIONINSIGHTS_CONNECTION_STRING

Components

ComponentContainerDescription
API Serverragflow-webREST API for parsing, indexing, search, graphs, and evaluation
Workerragflow-workerCelery worker for bulk document indexing
Interactive Workerragflow-interactive-workerCelery worker for short interactive tasks
Search Workerragflow-search-workerCelery worker for deep-search jobs

Processing Pipeline

RAGflow indexing and retrieval pipeline

Source

Loading diagram...

API Overview

Files

MethodEndpointDescription
POST/api/v1/parseParse a Storage file into text
POST/api/v1/inspectInspect a file's structure (sheets, pages, tables)
POST/api/v1/read-rangeBounded read of part of a file
POST/api/v1/query-file-tableQuery a table inside a file
POST/api/v1/search-fileSearch 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.

MethodEndpointDescription
POST/api/v1/collections/index/createCreate an index from files
PUT/api/v1/collections/index/{index_id}/updateAdd or replace files in an index
GET/api/v1/collections/index/status/{request_id}Indexing request status
POST/api/v1/collections/index/{index_id}/cancelCancel indexing
GET/api/v1/collections/index/listList indexes
GET, DELETE/api/v1/collections/index/{index_id}/filesList or remove indexed files
DELETE/api/v1/collections/index/{index_id}Delete an index
DELETE/api/v1/collections/indexesDelete several indexes
POST/api/v1/collections/index/metricsSize metrics for 1–100 index IDs
POST/api/v1/collections/searchSemantic search
POST/api/v1/collections/search/deepStart 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

MethodEndpointDescription
POST/api/v1/graph/buildBuild a knowledge graph
GET/api/v1/graph/listList graphs
GET/api/v1/graph/{graph_id}/statusGraph build status
GET, POST/api/v1/graph/{graph_id}/filesList or add graph files
GET/api/v1/graph/{graph_id}/visualizationVisualization data (nodes 1–5000)
GET/api/v1/graph/{graph_id}/communitiesCommunities (1–500; values outside the range return 422)
GET/api/v1/graph/{graph_id}/suggested-entity-typesSuggested entity types for a graph
POST/api/v1/graph/{graph_id}/approve-entity-typesApprove entity types and continue the build
POST/api/v1/graph/{graph_id}/cancelCancel a graph build
DELETE/api/v1/graph/{graph_id}Delete a graph
POST/api/v1/evaluation/run, /api/v1/evaluation/compareRun 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}/chunksRetrieved chunks for one question
DELETE/api/v1/evaluation/{evaluation_id}/questionsRemove questions from an evaluation
POST/api/v1/evaluation/{evaluation_id}/recomputeRecompute 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

VariableDescription
POSTGRES_HOSTPostgreSQL host
POSTGRES_USERDatabase user
POSTGRESPASSWORDBase64-encoded password
POSTGRES_DBDatabase name (ragflow_dev)
EMBEDDING_PROVIDEREmbedding provider (default azure)
EMBEDDING_MODELEmbedding model (default text-embedding-3-small)
GRAPH_STORE_TYPEGraph store (default neo4j)
GRAPH_TASK_SOFT_TIME_LIMITSoft time limit for graph tasks (default 4 hours)
MAX_UPLOAD_BYTESUpload limit for the upload endpoints (default 150 MiB)
INDEXING_HARD_CEILING_BYTESLargest file accepted for indexing (default 3 GiB; 0 disables). Excel files use INDEXING_EXCEL_CEILING_BYTES (default 100 MB).

Prerequisites

  • PostgreSQL 15+ with pgvector extension enabled
  • Redis server for Celery task queue
  • Tesseract OCR for image document parsing (installed in the image)
bash
# Enable pgvector (run as PostgreSQL admin)
CREATE EXTENSION IF NOT EXISTS vector;

Integration Points

ServiceIntegration
ConfiguratorCollection management — creates/deletes indexes via Configurator
StorageSource files for parsing and indexing, with DMS file authorization
ADKAgent knowledge base search during conversations
MCPInbuilt KB search tool

ℹ️ Info: RAGflow is an optional service. Start it with ./manage.sh dev start knowledge.