What you need to ship
| Resource | Why |
|---|---|
| Container host | Runs the FastAPI process |
| PostgreSQL | Sessions, memory, knowledge, traces, schedules |
| Public hostname | Required for Slack, Telegram, WhatsApp interfaces |
| HTTPS | Required for every webhook interface; terminate at your load balancer or reverse proxy |
| Env vars | At minimum OPENAI_API_KEY and JWT_VERIFICATION_KEY (in prod) |
Local with Docker Compose
agnohq/pgvector is Postgres 18 with the pgvector extension preinstalled — needed for knowledge embeddings.
Railway
Each tutorial template ships with Railway scripts for one-command deploys:up.sh provisions the project, adds pgvector with a persistent volume, creates the app service with env vars, and assigns a public domain.
Walkthroughs: Scout deploy, Dash deploy, Coda deploy.
AWS, GCP, and Azure
Any container platform works. The shape:| Component | Service options | What runs in it |
|---|---|---|
| App service | ECS Fargate, Cloud Run, App Service | The AgentOS container, port 8000 |
| Postgres | RDS, Cloud SQL, Postgres Flexible Server | Sessions, memory, knowledge, traces |
| Load balancer / ingress | ALB, Cloud Load Balancing, Application Gateway | Public HTTPS termination |
| Secret manager | Secrets Manager, Secret Manager, Key Vault | OPENAI_API_KEY, JWT_VERIFICATION_KEY |
/health endpoint. AgentOS responds {"status":"ok"} when the app is ready.
Scaling
AgentOS is stateless. State lives indb. Scale horizontally:
| Concern | Solution |
|---|---|
| Throughput | Add app replicas behind a load balancer |
| LLM rate limits | Use a queue or rate limiter in front of the model client |
| Long-running runs | Use background=true on the run endpoint, then poll for completion (see Serve as an API) |
| Side effects without blocking the response | Background hooks with run_in_background=True |
| Schedule fan-out | The scheduler runs on a single replica’s lifespan; for HA, use leader election or pin scheduling to one replica |
| Trace volume | Use a separate trace_db to keep the primary lean (see Observability) |
Production checklist
Auth and secretsRUNTIME_ENV=prdenables JWT authJWT_VERIFICATION_KEYset (see Security & Auth)OPENAI_API_KEYand other model keys in a secret manager, not in source
- Postgres has a persistent volume or managed backup
- HTTPS terminating at your load balancer or reverse proxy
- Health check pointed at
/health
- Tracing on (
tracing=True) so you can debug bad runs - At least one interface wired up
- Pre-hooks for PII or injection guarding if you handle untrusted input
requires_confirmation=Trueon irreversible tools
Updating your deployment
Code changes:git push if CI auto-deploys, or ./scripts/railway_redeploy.sh. Env changes: ./scripts/railway_env.sh (Railway auto-redeploys when env values change). Database changes: AgentOS handles its own tables — schema changes are additive and forward-compatible, so no migration tool is required for stock AgentOS tables. Application tables you migrate however you like (Alembic, raw SQL, dbt, your call).