Skip to content

Commit b1da4c7

Browse files
authored
feat(examples/langgraph-python-threads): use intelligence composite image (CopilotKit#4120)
## Summary Replaces the four separate intelligence containers (`db-migrations`, `app-api`, `realtime-gateway`, `thread-culler`) in the langgraph-python-threads example with a single `intelligence` composite container that runs all of them under `s6-overlay` supervision. Compose file drops from six services to three (`postgres`, `redis`, `intelligence`). README updated to match.
2 parents 4323454 + 8e6a320 commit b1da4c7

2 files changed

Lines changed: 17 additions & 83 deletions

File tree

examples/integrations/langgraph-python-threads/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ This project is a monorepo with three services:
1414

1515
When threads are enabled, additional infrastructure runs via Docker Compose:
1616

17-
| Service | Port | Description |
18-
| -------------------- | ---- | ---------------------------------------- |
19-
| **PostgreSQL** | 5432 | Thread and event storage |
20-
| **Redis** | 6379 | Session/cache |
21-
| **App API** | 4201 | Intelligence REST API |
22-
| **Realtime Gateway** | 4401 | WebSocket gateway for live thread events |
17+
| Service | Port | Description |
18+
| ---------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
19+
| **PostgreSQL** | 5432 | Thread and event storage |
20+
| **Redis** | 6379 | Session/cache |
21+
| **Intelligence** | 4201, 4401 | All-in-one CopilotKit Intelligence container (app-api on 4201, realtime-gateway on 4401, plus thread-culler and db-migrations, under s6-overlay). |
2322

2423
## Prerequisites
2524

@@ -59,7 +58,7 @@ This authenticates you and issues a `COPILOTKIT_LICENSE_TOKEN`. Add it to your `
5958
docker compose up -d --wait
6059
```
6160

62-
This pulls the GHCR images pinned to `0.1.0-rc.7`.
61+
This pulls `ghcr.io/copilotkit/intelligence/composite` — a single container that runs app-api, realtime-gateway, thread-culler, and the db-migrations oneshot together under s6-overlay supervision. The per-service images remain available at `ghcr.io/copilotkit/intelligence/{app-api,realtime-gateway,thread-culler,db-migrations}` if you'd rather run them separately.
6362

6463
5. Start all services:
6564

examples/integrations/langgraph-python-threads/docker-compose.yml

Lines changed: 11 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Intelligence infrastructure for threads support.
22
#
3-
# Starts postgres, redis, runs DB migrations, and the intelligence
4-
# app-api + realtime-gateway services.
3+
# Starts postgres, redis, and the all-in-one intelligence composite
4+
# container (runs app-api, realtime-gateway, thread-culler, and the
5+
# db-migrations oneshot internally under s6-overlay).
56
#
67
# Usage:
78
# docker compose up -d --wait
@@ -52,96 +53,30 @@ services:
5253
- intelligence
5354

5455
# ---------------------------------------------------------------------------
55-
# Database migrations (runs once then exits)
56+
# Intelligence composite (app-api + realtime-gateway + thread-culler +
57+
# db-migrations, all in one container under s6-overlay)
5658
# ---------------------------------------------------------------------------
5759

58-
db-migrations:
59-
image: ghcr.io/copilotkit/intelligence/db-migrations:0.1.0-rc.7
60-
environment:
61-
DATABASE_URL: postgresql://intelligence:intelligence@postgres:5432/intelligence_app
62-
depends_on:
63-
postgres:
64-
condition: service_healthy
65-
restart: "no"
66-
networks:
67-
- intelligence
68-
69-
# ---------------------------------------------------------------------------
70-
# Intelligence services
71-
# ---------------------------------------------------------------------------
72-
73-
app-api:
74-
image: ghcr.io/copilotkit/intelligence/app-api:0.1.0-rc.7
60+
intelligence:
61+
image: ghcr.io/copilotkit/intelligence/composite:0.0.0-ghcr.20260422.1
7562
ports:
7663
- "${APP_API_HOST_PORT:-4201}:4201"
77-
environment:
78-
NODE_ENV: development
79-
HOST: 0.0.0.0
80-
PORT: 4201
81-
LOG_LEVEL: debug
82-
DATABASE_URL: postgresql://intelligence:intelligence@postgres:5432/intelligence_app
83-
REDIS_URL: redis://redis:6379
84-
AUTH_SECRET: local-dev-secret-must-be-at-least-32-chars
85-
AUTH_TRUST_HOST: "true"
86-
DEPLOYMENT_MODE: self-hosted
87-
DEFAULT_ORGANIZATION_ID: casa-de-erlang
88-
depends_on:
89-
postgres:
90-
condition: service_healthy
91-
redis:
92-
condition: service_healthy
93-
db-migrations:
94-
condition: service_completed_successfully
95-
restart: unless-stopped
96-
networks:
97-
- intelligence
98-
99-
realtime-gateway:
100-
image: ghcr.io/copilotkit/intelligence/realtime-gateway:0.1.0-rc.7
101-
ports:
10264
- "${REALTIME_GATEWAY_HOST_PORT:-4401}:4401"
10365
environment:
10466
DATABASE_URL: postgresql://intelligence:intelligence@postgres:5432/intelligence_app
10567
REDIS_URL: redis://redis:6379
68+
AUTH_SECRET: local-dev-secret-must-be-at-least-32-chars
10669
RUNNER_AUTH_SECRET: dev-runner-secret
10770
SECRET_KEY_BASE: local-realtime-gateway-secret-key-base-at-least-64-bytes-long-for-dev
108-
PHX_HOST: localhost
109-
PORT: 4401
110-
depends_on:
111-
postgres:
112-
condition: service_healthy
113-
redis:
114-
condition: service_healthy
115-
db-migrations:
116-
condition: service_completed_successfully
117-
healthcheck:
118-
test: ["CMD-SHELL", "nc -z 127.0.0.1 4401"]
119-
interval: 10s
120-
timeout: 5s
121-
retries: 5
122-
start_period: 20s
123-
restart: unless-stopped
124-
networks:
125-
- intelligence
126-
127-
thread-culler:
128-
image: ghcr.io/copilotkit/intelligence/thread-culler:0.1.0-rc.7
129-
command:
130-
[
131-
"sh",
132-
"-lc",
133-
"while true; do node dist/apps/thread-culler/main.mjs; sleep 3600; done",
134-
]
135-
environment:
136-
DATABASE_URL: postgresql://intelligence:intelligence@postgres:5432/intelligence_app
71+
DEFAULT_ORGANIZATION_ID: casa-de-erlang
13772
COPILOTKIT_LICENSE_TOKEN: "${COPILOTKIT_LICENSE_TOKEN:-}"
13873
THREAD_STALE_HOURS: "${THREAD_STALE_HOURS:-3}"
13974
THREAD_CULL_BATCH_SIZE: "${THREAD_CULL_BATCH_SIZE:-1000}"
14075
depends_on:
14176
postgres:
14277
condition: service_healthy
143-
db-migrations:
144-
condition: service_completed_successfully
78+
redis:
79+
condition: service_healthy
14580
restart: unless-stopped
14681
networks:
14782
- intelligence

0 commit comments

Comments
 (0)