Engine & deployment

Deployment

A summary of how the platform is run on a server, for operators.

This page is for whoever operates a deployment. It summarises the deployment guide that ships with the backend.

Limitation: The production stack has been validated as configuration but has not yet been run on a real server. Certificate issuance, WebSocket routing through the proxy and Exotel reaching the engine through it are untested. Treat a first deployment as a rehearsal.

What runs

ServiceRole
ProxyTLS, and the only service with public ports
APIThe HTTP API
WorkerCalls, batches, workflows, webhooks, post-call work, scheduled jobs
Voice engineLive conversations
Postgres with pgvectorData and knowledge-base vectors
RedisJob queue, rate limits, live call sessions

The model servers (speech-to-text, language model, text-to-speech) are separate and sized on their own.

Steps

  1. Machine: a Linux host with Docker. Open ports 80 and 443 only.
  2. Names: two DNS names, one for the API and the engine's WebSockets, one for the dashboard. The proxy obtains certificates once they resolve.
  3. Configuration: one environment file for the platform, one for the engine. Set the domains, database and Redis passwords, a random SECRET_KEY, the operator and metrics tokens, the engine's shared secret (the same value on both sides), and the email, payment and messaging providers.
  4. Start: bring the stack up. Migrations run before the API and the worker start. Create the first workspace with the provided script.
  5. Check: GET /ready should report every dependency as ok.

With APP_ENV=production the API refuses to start on a placeholder SECRET_KEY and logs a warning for every development setting still on. The mock payment provider, the mock code sender and the development outboxes are switched off.

Telephony wiring

UseSetting
Outbound calls on the engineOWN_AGENT_WS_URL points at the engine's /ws through the proxy
Exotel inboundThe Voicebot applet is given the engine's /exotel address with credentials
Browser voice testENGINE_PUBLIC_WS_URL points at /web, and the engine's WEB_ALLOWED_ORIGINS lists the dashboard

See Exotel and Twilio and Plivo.

Scaling

  • API: stateless. More processes or containers behind the proxy.
  • Workers: replicas. Admission control and the ledger are safe across workers.
  • Voice engine: one engine per set of model servers. Its limits are per process, so a second engine against the same model servers adds load, not capacity. To add capacity, add model servers with an engine in front of them.
  • Database: count pool size plus overflow for every API and worker process against the server's connection limit.

A single machine is what is described. High availability, zero-downtime upgrades and automatic rollback are not provided.

Health and monitoring

EndpointUse
GET /healthLiveness: the process answers
GET /readyReadiness: database and Redis, and the engine and models when configured
GET /metricsMetrics for a scraper, behind its own token. Keep it off the public internet.

Logs are JSON lines with the request id and workspace id; secrets, tokens, full phone numbers and transcripts are redacted centrally. Failed background jobs and exhausted webhook deliveries are visible in dead-letter lists: see Operations.

Backups and upgrades

  • A backup service writes a verified database dump and keeps the newest few. Copy dumps and the storage volume (recordings, uploads) off the machine, and rehearse a restore.
  • To upgrade: back up, pull, rebuild. Migrations run first. Workers and the engine get a grace period to finish what they are doing.
  • There is no scheduled backup, no point-in-time recovery and no blue/green switch out of the box.

Before going live

  1. Real prices in the price book, and the currency decided. The shipped numbers are placeholders.
  2. A payment provider and a messaging provider run end to end in their test modes. Both adapters have only been tested against local fakes.
  3. An email backend other than the outbox.
  4. MAX_CALLS and the model concurrency caps sized to what the model servers can serve.
  5. Recording retention decided.
  6. The security checklist in Security notes.
  7. Legal review of the compliance features for the places you call.