Skip to main content

Purpose

This service is optional. document-api and opensearch are only needed for knowledge base / RAG features. Voice assistants (STT/LLM/TTS) work fully without them. Use make up-all-with-knowledge to start with knowledge base support.
The document-api is the knowledge backend for the Rapida platform. It ingests documents (PDF, Word, CSV, and others), splits them into chunks, generates vector embeddings, and indexes everything in OpenSearch. At call time, assistant-api queries this service to inject relevant context into the LLM prompt.

Port

9010 — HTTP (FastAPI / uvicorn)

Language

Python 3.11+ FastAPI + Celery

Storage

PostgreSQL assistant_db Redis (Celery broker) OpenSearch (vectors + text)
Document processing is asynchronous. Upload returns immediately with status: processing. Text extraction, chunking, and embedding generation run as Celery background tasks.

Document Processing Pipeline


Supported File Formats


At call time, assistant-api sends a text query to document-api. The service performs vector similarity search and returns the top-k most relevant chunks. Request:
Response:

Embedding Models

Embeddings are generated using sentence-transformers. The model is configurable via EMBEDDINGS_MODEL in config.yaml:
If you change EMBEDDINGS_MODEL, you must also update EMBEDDINGS_DIMENSION to match and re-index all existing documents. Existing embeddings stored with a different dimension will not match.

Running

document-api is part of the knowledge Docker Compose profile and is not started by default.

Health Endpoints


Troubleshooting

The Celery worker is likely not running.
Adjust the Celery worker batch size:

Next Steps

Configuration

config.yaml reference — chunking, embedding, Celery, and storage settings.

Assistant API

How assistants query knowledge bases during calls.

Architecture

Full system topology and RAG data flow.

Overview

Deploy the full platform with Docker Compose.