Skip to main content

RAG API

Overview of IntelliAsk's Retrieval-Augmented Generation (RAG) API — the service that indexes uploaded files and retrieves relevant passages for context-aware answers. Points to the full configuration and embeddings reference.

The RAG API powers IntelliAsk's chat-with-files. When a user uploads a document, the RAG API splits it into chunks, embeds those chunks with a configurable embeddings provider, and stores the vectors in a vector database (PostgreSQL + pgvector by default). At query time it embeds the question, retrieves the most relevant chunks, and passes them to the model so the answer is grounded in the user's documents.

It runs as a separate FastAPI + LangChain service (rag-api) alongside the IntelliAsk app. For the end-user feature, see Features → RAG API.

RAG is optional and disabled by default

The RAG API needs a working embeddings provider — without one, rag-api crash-loops on start — so the stack ships it disabled. intelliask provision asks whether to enable it and points you at the embeddings setup first. Turn it on once configured with:

intelliask module enable rag

and off again with intelliask module disable rag. The app runs fine without it; RAG features are simply unavailable until it is enabled.

Configuration lives in the service reference

This page is just an overview. All RAG settings are environment variables in config/.env, read by the container under the same name. The complete, authoritative reference is under Services → RAG API:

Before you enable it

Provisioning already sets up the database credentials the RAG API shares with the bundled Vector DB. What you must supply is the embeddings provider: pick one, then fill the matching keys in config/.env (and, if needed, config/rag.compose.yml) following the Embeddings providers reference.

At minimum, set:

EMBEDDINGS_PROVIDER=azure   # openai | azure | huggingface | huggingfacetei | ollama | google_genai | vertexai | bedrock
EMBEDDINGS_MODEL=text-embedding-3-small
# ...plus the provider's credentials (see the Embeddings reference)

Don't change the model on a populated store

The embedding dimension is fixed per model (e.g. 1536 for text-embedding-3-small, 384 for all-MiniLM-L6-v2). Changing EMBEDDINGS_MODEL after documents are indexed makes existing vectors incompatible — keep it stable or plan a full re-index.

Then enable and start the service:

intelliask module enable rag

Run intelliask env doctor first to confirm the variables are wired between config/.env and the compose files.

Last updated on