Files
matrix-ai-agent/docker-compose.yml
Christian Gick d6dae1da8e feat: Haiku-default model routing with Sonnet escalation + Sentry observability
Route ~90% of simple chat to claude-haiku (4x cheaper), escalate to
claude-sonnet for code blocks, long messages, technical keywords,
multimodal, and explicit requests. Sentry tags track model_used,
escalation_reason, and token usage breadcrumbs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:25:10 +02:00

79 lines
2.2 KiB
YAML

services:
agent:
build:
context: .
dockerfile: Dockerfile
command: python agent.py start
env_file: .env
restart: unless-stopped
network_mode: host
bot:
build:
context: .
dockerfile: Dockerfile
command: python bot.py
env_file: .env
restart: unless-stopped
environment:
- LITELLM_BASE_URL
- LITELLM_API_KEY
- DEFAULT_MODEL
- BASE_MODEL=${BASE_MODEL:-claude-haiku}
- ESCALATION_MODEL=${ESCALATION_MODEL:-claude-sonnet}
- MEMORY_SERVICE_URL=http://memory-service:8090
- MEMORY_SERVICE_TOKEN
- PORTAL_URL
- BOT_API_KEY
volumes:
- bot-data:/data
depends_on:
memory-service:
condition: service_healthy
memory-db:
image: pgvector/pgvector:pg17
restart: unless-stopped
environment:
POSTGRES_USER: memory
POSTGRES_PASSWORD: ${MEMORY_DB_PASSWORD:-memory}
POSTGRES_DB: memories
volumes:
- memory-pgdata:/var/lib/postgresql/data
- ./memory-db-ssl/server.crt:/var/lib/postgresql/server.crt:ro
- ./memory-db-ssl/server.key:/var/lib/postgresql/server.key:ro
command: >
postgres
-c ssl=on
-c ssl_cert_file=/var/lib/postgresql/server.crt
-c ssl_key_file=/var/lib/postgresql/server.key
healthcheck:
test: ["CMD-SHELL", "pg_isready -U memory -d memories"]
interval: 5s
timeout: 3s
retries: 5
memory-service:
build: ./memory-service
restart: unless-stopped
environment:
DATABASE_URL: postgresql://memory_app:${MEMORY_APP_PASSWORD}@memory-db:5432/memories?sslmode=require
MEMORY_ENCRYPTION_KEY: ${MEMORY_ENCRYPTION_KEY}
MEMORY_DB_OWNER_PASSWORD: ${MEMORY_DB_PASSWORD:-memory}
LITELLM_BASE_URL: ${LITELLM_BASE_URL}
LITELLM_API_KEY: ${LITELLM_MASTER_KEY}
EMBED_MODEL: ${EMBED_MODEL:-text-embedding-3-small}
MEMORY_SERVICE_TOKEN: ${MEMORY_SERVICE_TOKEN:-}
depends_on:
memory-db:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8090/health')"]
interval: 10s
timeout: 5s
retries: 3
volumes:
bot-data:
memory-pgdata: