Files
Benjamin Taylor 34fdba738e fix(integrations): self-heal missing intelligence_app DB in _intelligence overlay
The activation overlay's docker-compose.yml relied on a bind-mounted
docker/init-db script to create the intelligence_app database, but the
CLI copies only docker-compose.yml into scaffolded projects. The mount
source never exists there, Docker creates it as an empty directory,
postgres initializes without intelligence_app, and the composite's
migrations fail: 'database "intelligence_app" does not exist' →
'dependency failed to start: container ...intelligence-1 is unhealthy'.

Make the compose file self-contained:

- Set POSTGRES_DB: intelligence_app (drop the init-db bind mount and
  the now-unused init script; the shadow DB it also created is only
  used by repo-local dev tooling, never by the composite).
- Add an idempotent provision-db one-shot that creates the database
  when missing. POSTGRES_DB only applies on first init of an empty
  volume, and the volume is shared across all scaffolds via the fixed
  compose project name — so machines that already hit the bug have a
  data volume without the database. The one-shot heals those on the
  next 'docker compose up' with no manual 'down -v'.
- Gate the composite on provision-db completion instead of postgres
  health, and align the postgres healthcheck dbname.
2026-06-05 11:20:51 -05:00
..

_intelligence/ — CopilotKit Intelligence Activation Overlay

This directory is the framework-agnostic overlay consumed by copilotkit init -i and copilotkit add-intelligence. It contains everything needed to run the CopilotKit Intelligence stack locally, independent of which framework template your project uses.

Assets

docker-compose.yml

Starts three services:

  • postgres — relational store used by the Intelligence runtime
  • redis — cache and pub/sub broker
  • ghcr.io/copilotkit/intelligence/composite — the all-in-one Intelligence container (app-api on 4201, realtime-gateway on 4401, thread-culler, and a db-migrations oneshot)

Bring the stack up with:

docker compose up -d --wait

.env.intelligence

A fragment of environment variables appended to your project's .env when you run copilotkit add-intelligence. It wires the scaffolded app to the local stack:

COPILOTKIT_LICENSE_TOKEN=
INTELLIGENCE_API_URL=http://localhost:4201
INTELLIGENCE_GATEWAY_WS_URL=ws://localhost:4401
INTELLIGENCE_API_KEY=cpk_sPRVSEED_seed0privat0longtoken00

INTELLIGENCE_API_KEY is pre-seeded with the local-dev value the bundled composite container expects. To activate Intelligence, set COPILOTKIT_LICENSE_TOKEN (server-side secret, from your CopilotKit dashboard); each base template's runtime wires Intelligence from that token (see the per-framework dormant wiring below). The stack runs locally once the token is set.

Framework independence

This overlay is not tied to any specific framework template. The per-framework dormant runtime wiring (e.g. the CopilotRuntime provider, route handler, and hook configuration) lives in each base template. The overlay only supplies the Docker stack and the env-key fragment that activates it.