Deployment Guide

Comprehensive deployment documentation for production, development, and scaling Soothe.

Overview

This guide covers production deployment patterns, monitoring setup, security hardening, scaling strategies, and disaster recovery. For basic daemon management, see Daemon Management.

Quick Reference

Topic Guide Key Focus
Production Setup Production Setup Helm chart, PostgreSQL, pgvector
Monitoring Monitoring Guide Langfuse, logs, health checks
Security Security Hardening Reverse proxy, TLS, access control
Scaling Scaling Strategies Horizontal scaling, load balancing
Backup & Recovery Backup Recovery PostgreSQL backup, disaster recovery
Dashboard User Guide Dashboard User Guide Langfuse, CLI top, TUI cards — usage walkthroughs
Dashboard Data Dictionary Dashboard Data Dictionary Field-level reference for metrics, dimensions, sources

Deployment Architecture

Soothe supports three deployment tiers:

Tier 1: Local Development

┌─────────────┐
│ CLI/TUI     │
│ (WebSocket) │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│  Soothe     │
│  Daemon     │
│ (SQLite)    │
└─────────────┘

Best for: Development, testing, single-user environments

Configuration:

persistence:
  default_backend: sqlite

Tier 2: Single-Node Production

┌──────────────┐
│ CLI/TUI/Web  │
└──────┬───────┘
       │ WebSocket
       ▼
┌──────────────┐
│  Soothe      │
│  Daemon      │
└──────┬───────┘
       │ PostgreSQL
       ▼
┌──────────────┐
│ PostgreSQL   │
│ + pgvector   │
└──────────────┘

Best for: Small teams, moderate load (<100 concurrent threads)

Configuration: See Production Setup

Tier 3: Multi-Node Production

┌──────────────┐
│ Load Balancer│
└──────┬───────┘
       │
       ├─→ ┌──────────────┐
       │   │ Soothe Node 1│
       │   └──────┬───────┘
       │          │
       ├─→ ┌──────────────┐
       │   │ Soothe Node 2│
       │   └──────┬───────┘
       │          │
       └─────→ ┌──────────────┐
               │ PostgreSQL   │
               │ Cluster      │
               └──────────────┘

Best for: High availability, large teams (>100 concurrent threads)

Configuration: See Scaling Strategies

Deployment Checklist

Before deploying to production, verify:

Infrastructure

  • PostgreSQL database configured and accessible
  • pgvector extension installed
  • Network connectivity between daemon and database
  • Persistent storage mounted (PVCs)
  • Reverse proxy configured (if exposing WebSocket/HTTP)

Security

  • API keys stored securely (environment variables, secrets manager)
  • TLS enabled on reverse proxy
  • Authentication configured on reverse proxy
  • Firewall rules set (database port, daemon ports)
  • Security policy configured in nano.yml

Monitoring

  • Langfuse observability enabled (optional but recommended)
  • Log collection configured
  • Health checks enabled in the Helm chart
  • Alerting configured for critical errors

Backup & Recovery

  • PostgreSQL backup strategy implemented
  • Disaster recovery plan documented
  • Configuration files backed up
  • Recovery testing performed

Quick Start: Production Deployment

Using the Helm chart (recommended):

# 1. Validate the chart and render manifests locally
make helm-lint && make helm-template

# 2. Deploy the production stack.
#    Provider keys are read from the host environment (OPENAI_BASE_URL,
#    OPENAI_API_KEY, TAVILY_API_KEY, TYPESAFE_API_KEY); the daemon's
#    config/production/nano.yml is mounted from a ConfigMap via --set-file.
make helm-prod-up

# 3. Verify deployment
make helm-prod-status
kubectl -n soothe-prod logs deploy/soothe-daemon

config/production/example.env has been removed. API keys instead come from the host environment, a gitignored values-secrets.yaml passed via HELM_EXTRA_VALUES="-f <path>", or an existingSecret pointing at an externally managed Kubernetes Secret.

See Production Setup for detailed steps.

Deployment Patterns

Pros:

  • Single-command deployment via the Makefile targets
  • Built-in health probes
  • Rolling updates and automatic restarts
  • PVC-backed persistent storage (retained on uninstall)
  • Namespace/NetworkPolicy isolation

Use: Standard production deployments

Compose profiles no longer exist: Langfuse is enabled only in values-dev.yaml, and the daemon only in values-prod.yaml.

See: deploy/helm/soothe/ and Production Setup

Pattern 2: Kubernetes

Pros:

  • Horizontal scaling
  • Rolling updates
  • Service mesh integration
  • Advanced orchestration

Use: Large-scale, high-availability deployments

See: Scaling Strategies

Pattern 3: Bare Metal / systemd

Pros:

  • Maximum control
  • No container overhead
  • Direct hardware access

Use: Specialized environments, performance-critical applications

See: Production Setup

Common Deployment Scenarios

Scenario 1: Development Team (10 users)

Setup:

  • Single PostgreSQL instance (4 databases per RFC-802)
  • Single Soothe daemon
  • WebSocket transport (localhost)
  • SQLite fallback for testing

Config (nano.yml + daemon.yml):

# nano.yml
persistence:
  default_backend: postgresql
  postgres_base_dsn: postgresql://user:pass@postgres-host:5432
# daemon.yml
transports:
  websocket:
    enabled: true
    host: 127.0.0.1
    port: 8765
thread_pool:
  request_timeout_seconds: 1209600  # 14d per turn; 0 = no cap

Scenario 2: Production Team (50 users)

Setup:

  • PostgreSQL + pgvector (production-grade)
  • Reverse proxy (nginx) with TLS
  • WebSocket transport
  • Langfuse observability

Config (nano.yml + daemon.yml):

# nano.yml
persistence:
  default_backend: postgresql
  
observability:
  langfuse:
    enabled: true
    public_key: ${LANGFUSE_PUBLIC_KEY}
    secret_key: ${LANGFUSE_SECRET_KEY}
# daemon.yml
transports:
  websocket:
    enabled: true
    host: 127.0.0.1
    port: 8765
thread_pool:
  request_timeout_seconds: 1209600

Scenario 3: Large Organization (500 users)

Setup:

  • PostgreSQL cluster (primary + replicas)
  • Multiple Soothe nodes (horizontal scaling)
  • Load balancer (nginx/HAProxy)
  • Redis for distributed coordination
  • Kafka for event streaming

Config: See Scaling Strategies

Post-Deployment Tasks

After successful deployment:

1. Verify Connectivity

# Test daemon health
soothed status

# Test database connection
psql -h postgres-host -U user -d soothe_checkpoints -c "SELECT 1"

# Test API connectivity (if WebSocket/HTTP enabled)
curl http://localhost:8765/health

2. Configure Observability

observability:
  langfuse:
    enabled: true
    host: https://your-langfuse-instance.com
  log_file_path: /var/log/soothe/soothed.log
  log_file_level: INFO

3. Set Up Monitoring

  • Enable health checks in the Helm chart
  • Configure log aggregation (ELK, Loki, etc.)
  • Set up alerting (PagerDuty, Slack, etc.)

See Monitoring Guide

4. Implement Backup Strategy

# PostgreSQL backup
pg_dump -h postgres-host -U user soothe_checkpoints > backup.sql

# PVC backup (pgvector data on data-soothe-pgvector-0)
kubectl -n soothe-prod exec statefulset/soothe-pgvector -- \
  tar czf - -C /var/lib/postgresql/data . > postgres_data.tar.gz

See Backup Recovery

5. Security Hardening

security:
  allow_paths_outside_workspace: false
  denied_paths:
    - /etc/**
    - ~/.ssh/**
    - ~/.aws/**

See Security Hardening

Troubleshooting

Deployment Issues

Issue Solution Reference
PostgreSQL connection fails Check DSN, credentials, firewall Production Setup
Daemon won’t start Check nano.yml syntax, logs Troubleshooting
WebSocket connection refused Enable transport, check port Daemon Management
pgvector extension missing Install extension, restart PostgreSQL Production Setup

Performance Issues

Issue Solution Reference
Slow thread resumption Tune PostgreSQL pool size Scaling Strategies
Memory exhaustion Limit parallel goals, adjust pool Scaling Strategies
High latency Enable connection pooling, optimize queries Scaling Strategies

Next Steps

  1. Production Setup: Follow Production Setup Guide for detailed deployment steps
  2. Monitoring: Configure observability with Monitoring Guide
  3. Security: Harden deployment with Security Hardening
  4. Scaling: Plan growth with Scaling Strategies
  5. Backup: Protect data with Backup Recovery

Need help? See Troubleshooting or check the Soothe repository.


Table of contents