Skip to main content

RAG API

The RAG API powers IntelliAsk's file chat (retrieval-augmented generation) using a pgvector database. Its RAG_*/embeddings keys in config/.env, the Vector DB it pairs with, and update steps.

The RAG API powers IntelliAsk's chat-with-files feature — it chunks and embeds uploaded documents, stores the vectors in the Vector DB (pgvector), and retrieves the most relevant passages at query time (retrieval-augmented generation).

Full service reference

This page covers how the RAG API is wired into the stack. For the complete environment surface — including every embeddings provider — see Services → RAG API.

Optional — disabled by default

RAG needs a working embeddings provider or rag-api crash-loops, so the stack ships it disabled. Configure an embeddings provider in config/.env, then enable it with intelliask module enable rag (disable with intelliask module disable rag). intelliask provision also offers to enable it.

Overview

Compose fileconfig/rag.compose.yml
Service namerag-api
Modulerag (optional; disabled by default)
Image variableRAG_IMAGE (e.g. intelliask-rag-api:2)
Exposedinternal only (app reaches it at RAG_API_URL)
Depends onthe Vector DB (vectordb) and an embeddings provider
Databind-mounted at ${STORAGE_ROOT}/uploads-rag → /app/uploads

Configuration

Every RAG setting lives in config/.env and is read by the container under the same name — see Services → RAG API → Configuration for the full reference, and Services → RAG API → Embeddings for every embeddings provider. The stack pre-fills the Azure OpenAI endpoint and API version and shares the Azure API key, but leaves EMBEDDINGS_PROVIDER/EMBEDDINGS_MODEL blank — you pick and set a provider before enabling RAG.

The RAG API and the bundled Vector DB share one set of database keys, so they always agree:

KeyDefaultPurpose
DB_HOSTvectordbDatabase host.
DB_PORT5432Database port.
POSTGRES_DBIntelliAskDatabase name.
POSTGRES_USERintelliaskDatabase user.
POSTGRES_PASSWORD(auto-provisioned)Database password.

These DB keys are read by both services

DB_HOST/DB_PORT and POSTGRES_* are read by both rag-api and vectordb, so a change (e.g. the password) applies to both. The password is generated once during provisioning.

After editing any value, apply with:

intelliask up rag-api

If RAG is still disabled (the default), enable the module instead — it clears rag from DISABLED_MODULES and starts the service:

intelliask module enable rag

Resource limits

Embedding generation is CPU-bound, so RAG gets a higher ceiling than most services (RAG_CPUS=1.0, RAG_MEMORY=512m). Raise it if you ingest large documents or many files at once; watch docker stats during bulk uploads.

Updating the RAG API

# 1. Bump the tag in config/.env, e.g. RAG_IMAGE=intelliask-rag-api:3
# 2. Pull + recreate only the RAG API
intelliask update rag-api

The Vector DB is a separate service — update it on its own (see Vector DB). To roll back, restore the previous RAG_IMAGE tag.

Last updated on