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 file | config/rag.compose.yml |
| Service name | rag-api |
| Module | rag (optional; disabled by default) |
| Image variable | RAG_IMAGE (e.g. intelliask-rag-api:2) |
| Exposed | internal only (app reaches it at RAG_API_URL) |
| Depends on | the Vector DB (vectordb) and an embeddings provider |
| Data | bind-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:
| Key | Default | Purpose |
|---|---|---|
DB_HOST | vectordb | Database host. |
DB_PORT | 5432 | Database port. |
POSTGRES_DB | IntelliAsk | Database name. |
POSTGRES_USER | intelliask | Database 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:
If RAG is still disabled (the default), enable the module instead — it clears rag
from DISABLED_MODULES and starts the service:
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
The Vector DB is a separate service — update it on its own (see
Vector DB). To roll back, restore the
previous RAG_IMAGE tag.
Related
- Features → RAG API
- Services → RAG API — full configuration & embeddings reference
Last updated on