Docker Compose is the recommended way to run the full AI-Q blueprint stack (backend, frontend, and database) without managing individual processes.
- Docker Engine and Docker Compose v2.
- API keys for the models and tools you plan to use (refer to Installation -- API Key Setup).
- Ports
3000,8000, and5432available on your host. - Enough disk space for Docker volumes and cached model artifacts.
The Docker Compose setup uses these files:
| File | Purpose |
|---|---|
deploy/compose/docker-compose.yaml |
Standard stack (LlamaIndex or FRAG backend) |
deploy/.env |
Environment variables for all services |
deploy/.env.example |
Template with all available variables |
deploy/compose/init-db.sql |
PostgreSQL initialization script |
configs/config_web_default_llamaindex.yml |
LlamaIndex backend config (default) |
configs/config_web_frag.yml |
Foundational RAG backend config |
Copy the example environment file and edit it:
cp deploy/.env.example deploy/.envThe sections below explain each group of variables.
| Variable | Required | Description |
|---|---|---|
NVIDIA_API_KEY |
Yes | NVIDIA API key for NIM model access. |
TAVILY_API_KEY |
Conditional | Web search provider key (required if using tavily_web_search). |
EXA_API_KEY |
Conditional | Web search provider key (required if using exa_web_search). |
SERPER_API_KEY |
No | Google Scholar paper search key (optional). |
| Variable | Description |
|---|---|
OPENAI_API_KEY |
Required only if your config uses OpenAI models directly. |
JINA_API_KEY |
Required only if you enable the evaluation suite. |
WANDB_API_KEY |
Required only if you enable experiment tracking. |
| Variable | Default | Description |
|---|---|---|
APP_ENV |
production |
Application environment (development or production). The compose files default to production; deploy/.env.example sets development. |
LOG_LEVEL |
INFO |
Logging verbosity (DEBUG, INFO, WARNING, ERROR). |
Set BACKEND_CONFIG to select which workflow config the backend loads at startup. The compose stacks mount configs/ into the container at /app/configs.
| Config path | Description |
|---|---|
/app/configs/config_web_default_llamaindex.yml |
Default -- LlamaIndex backend (no external RAG required). |
/app/configs/config_web_frag.yml |
Foundational RAG mode (requires a running RAG Blueprint). |
Example in deploy/.env:
BACKEND_CONFIG=/app/configs/config_web_default_llamaindex.ymlChoose one of the following database configurations.
PostgreSQL (recommended for all deployments):
NAT_JOB_STORE_DB_URL=postgresql+asyncpg://aiq:aiq_dev@postgres:5432/aiq_jobs # pragma: allowlist secret
AIQ_CHECKPOINT_DB=postgresql://aiq:aiq_dev@postgres:5432/aiq_checkpoints # pragma: allowlist secret
AIQ_SUMMARY_DB=postgresql+psycopg://aiq:aiq_dev@postgres:5432/aiq_jobs # pragma: allowlist secretThese are the default values used by the compose stack when the variables are unset.
SQLite (development only):
NAT_JOB_STORE_DB_URL=sqlite+aiosqlite:///./data/jobs.db
AIQ_CHECKPOINT_DB=/app/data/checkpoints.db
# AIQ_SUMMARY_DB defaults to sqlite+aiosqlite:///./summaries.dbWhen using SQLite, you can optionally remove the depends_on block for the aiq-agent service since the postgres container is no longer needed.
| Variable | Default | Description |
|---|---|---|
backend_url |
http://aiq-agent:8000 |
Backend API URL as seen from the frontend container. |
| Variable | Default | Description |
|---|---|---|
DASK_NWORKERS |
1 |
Number of Dask workers for background job processing. |
DASK_NTHREADS |
4 |
Number of threads per Dask worker. |
DASK_DISTRIBUTED__LOGGING__DISTRIBUTED |
warning |
Dask log level (reduce noise). |
From the repository root:
cd deploy/compose
docker compose --env-file ../.env -f docker-compose.yaml up -d --buildThis starts three services:
| Service | Container name | Port | Description |
|---|---|---|---|
aiq-agent |
aiq-agent |
8000 | Backend API server with embedded Dask cluster |
frontend |
aiq-blueprint-ui |
3000 | Next.js web UI |
postgres |
aiq-postgres |
5432 | PostgreSQL database |
Open http://localhost:3000 to access the web UI.
To skip the local build and pull pre-built images from the NGC container registry:
# Log in to the container registry
docker login nvcr.io
# Run with pre-built images (no --build flag)
cd deploy/compose
BACKEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-agent:2.0.0 \
FRONTEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-frontend:2.0.0 \
docker compose --env-file ../.env -f docker-compose.yaml up -dYou can also add the image variables to deploy/.env instead of passing them on the command line:
BACKEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-agent:2.0.0
FRONTEND_IMAGE=nvcr.io/nvidia/blueprint/aiq-frontend:2.0.0To build the production (release) image instead of the development image:
cd deploy/compose
BUILD_TARGET=release docker compose --env-file ../.env -f docker-compose.yaml up -d --buildThe release image excludes the CLI and debug UI. Refer to Docker Build System for details on build targets.
If the default ports conflict with other services, override them in deploy/.env:
| Variable | Default | Description |
|---|---|---|
PORT |
8000 |
Backend API host port |
FRONTEND_PORT |
3000 |
Frontend UI host port |
PORT=8100 docker compose --env-file ../.env -f docker-compose.yaml up -dNote: The backend API always runs on port 8000 inside the container. The PORT variable only changes the host port mapping.
Common conflicts:
- The NVIDIA RAG Blueprint
page-elementsservice uses ports 8000--8002. SetPORT=8100to avoid this. - Other development servers may occupy ports 8000, 8080, or 3000.
If you switch the backend to configs/config_web_frag.yml, you must run a compatible RAG server and ingest server separately and set these variables in deploy/.env:
RAG_SERVER_URL=http://rag-server:8081/v1
RAG_INGEST_URL=http://ingestor-server:8082/v1Deploy the RAG services using the NVIDIA RAG Blueprint Docker guides:
- Get Started With the NVIDIA RAG Blueprint (self-hosted)
- Deploy NVIDIA RAG Blueprint with Docker (NVIDIA-hosted models)
When AI-Q and RAG are deployed as separate Docker Compose stacks, the AI-Q backend cannot resolve RAG service names (rag-server, ingestor-server) because the containers are on different Docker networks.
Connect the AI-Q backend container to the RAG network after both stacks are running:
docker network connect nvidia-rag aiq-agentThen use the RAG service names directly in deploy/.env:
RAG_SERVER_URL=http://rag-server:8081/v1
RAG_INGEST_URL=http://ingestor-server:8082/v1This must be re-run if the aiq-agent container is recreated (for example, after docker compose down && up).
The compose stack includes a PostgreSQL 16 container (postgres:16-alpine). On first startup with a fresh volume, the init-db.sql script runs automatically and:
- Creates the
aiq_checkpointsdatabase (theaiq_jobsdatabase is created by thePOSTGRES_DBenvironment variable). - Grants permissions to the
aiquser. - Creates the
job_infotable inaiq_jobswith performance indices.
Tables created automatically by the application at runtime:
job_events-- created byevent_store.pyusing SQLAlchemy.- LangGraph checkpoint tables -- created by
AsyncPostgresSaver. summaries-- created bysummary_store.pyif not present.
The PostgreSQL healthcheck verifies both aiq_jobs and aiq_checkpoints databases are ready before the backend starts.
For lightweight development without PostgreSQL, configure SQLite connection strings in deploy/.env (refer to Database Settings above). No init-db.sql is needed -- the application creates SQLite files on demand.
| Volume | Mount point | Purpose |
|---|---|---|
../../configs (bind mount, read-only) |
/app/configs |
Workflow configuration files |
aiq-data (named volume) |
/app/data |
LlamaIndex persistence (ChromaDB), SQLite databases |
postgres-data (named volume) |
/var/lib/postgresql/data |
PostgreSQL data directory |
cd deploy/compose
# Stop containers (preserves data volumes)
docker compose --env-file ../.env -f docker-compose.yaml down
# Stop and remove volumes (deletes all database data)
docker compose --env-file ../.env -f docker-compose.yaml down -vdocker logs aiq-agent -f
docker logs aiq-blueprint-ui -f
docker logs aiq-postgres -fcurl http://localhost:8000/healthdocker exec -it aiq-postgres psql -U aiq -d aiq_jobsIf containers fail to start or you suspect stale build layers:
cd deploy/compose
docker compose --env-file ../.env -f docker-compose.yaml down
docker compose --env-file ../.env -f docker-compose.yaml build --no-cache
docker compose --env-file ../.env -f docker-compose.yaml up -d| Symptom | Cause | Fix |
|---|---|---|
| Backend fails to start | Missing API keys in deploy/.env |
Verify NVIDIA_API_KEY and at least one search key are set. |
| Frontend shows connection error | Backend not yet ready | Wait for the backend healthcheck to pass; check docker logs aiq-agent. |
| Port already in use | Another service occupies 3000, 8000, or 5432 | Override with PORT or FRONTEND_PORT variables. |
| Database connection refused | PostgreSQL not healthy | Check docker logs aiq-postgres; verify init-db.sql ran correctly. |
| FRAG mode fails to connect to RAG | Separate Docker networks | Run docker network connect nvidia-rag aiq-agent. |