Deployment
Deployment
Section titled “Deployment”AgentCTX supports multiple deployment models, from single-machine setups to distributed Kubernetes clusters.
Deployment Models
Section titled “Deployment Models”| Model | Use Case | Complexity |
|---|---|---|
| Standalone | Local development, single user | Low |
| Docker Compose | Team development, small teams | Medium |
| Kubernetes | Production, multi-tenant | High |
| Edge | Embedded in applications | Variable |
Standalone
Section titled “Standalone”Install and run directly:
npm install -g @agentctx/coreactx initactx start --transport sse --port 3100No external dependencies required for basic operation. SurrealDB and NATS are optional for persistence and messaging.
Docker Compose
Section titled “Docker Compose”The recommended setup for teams:
git clone https://github.com/ryan-haver/agentctx.gitcd agentctxdocker compose up -d --build --waitThis starts 4 services:
- agentctx (port 3100) — TypeScript gateway
- ctx-gateway (port 3200) — Rust HTTP gateway
- surrealdb (port 8000) — Database
- nats (port 4222) — Message bus
Persistent Volumes
Section titled “Persistent Volumes”volumes: surrealdb_data: nats_data:
services: surrealdb: volumes: - surrealdb_data:/data nats: volumes: - nats_data:/dataKubernetes
Section titled “Kubernetes”For production deployments, deploy each component as a separate service:
Gateway Deployment
Section titled “Gateway Deployment”apiVersion: apps/v1kind: Deploymentmetadata: name: agentctx-gatewayspec: replicas: 3 template: spec: containers: - name: gateway image: agentctx/gateway:latest ports: - containerPort: 3100 env: - name: SURREAL_URL value: "ws://surrealdb:8000" - name: NATS_URL value: "nats://nats:4222"Scaling Considerations
Section titled “Scaling Considerations”- Gateway — stateless, scale horizontally behind a load balancer
- SurrealDB — use SurrealDB cluster mode for HA
- NATS — use NATS superclusters for cross-region federation
- Rust gateway — single binary, very low resource footprint
Edge Deployment
Section titled “Edge Deployment”Embed AgentCTX in applications using the WASM builds:
import { Parser } from '@agentctx/wasm';
const parser = new Parser();const stmt = parser.parse('?k "auth" ^3');The WASM parser runs in browsers, Cloudflare Workers, Deno Deploy, and other edge runtimes.
Production Checklist
Section titled “Production Checklist”- Change default SurrealDB credentials
- Enable mTLS between services
- Set up 1Password integration (
OP_SERVICE_ACCOUNT_TOKEN) - Configure token budgets
- Enable Sentinel monitoring (
activeorstrictmode) - Set up log aggregation (OpenTelemetry)
- Configure backup for SurrealDB volumes
- Test
actx verifyin CI pipeline
See Also
Section titled “See Also”- Docker Deployment — Docker Compose details
- Installation — all installation methods
- Security Model — production security