Scaling Projections
Scaling Projections
Section titled “Scaling Projections”AgentCTX is designed to scale from single-developer setups to enterprise deployments with hundreds of agents. This page covers scaling characteristics across key dimensions.
Scaling Dimensions
Section titled “Scaling Dimensions”Agents
Section titled “Agents”| Agents | Architecture | Notes |
|---|---|---|
| 1–5 | Standalone or Docker Compose | Single gateway instance |
| 5–20 | Docker Compose with persistence | SurrealDB + NATS for state |
| 20–100 | Kubernetes + load balancer | Multiple gateway replicas |
| 100+ | Kubernetes + NATS superclusters | Federated, multi-region |
The gateway is stateless — scaling is horizontal. Add replicas behind a load balancer.
MCP Backends
Section titled “MCP Backends”| Backends | Behavior |
|---|---|
| 1–10 | All lazy-spawned, minimal resource use |
| 10–50 | Consider grouping by role for efficient scoping |
| 50+ | Use backend pools with dedicated gateway instances |
Lazy spawning means unused backends consume zero resources.
Memory Volume
Section titled “Memory Volume”| Memories | Storage | Performance |
|---|---|---|
| < 10K | In-memory (SurrealDB) | < 1ms queries |
| 10K–100K | SurrealDB with HNSW indices | < 5ms queries |
| 100K–1M | SurrealDB cluster | < 10ms queries |
| 1M+ | Sharded SurrealDB + archive tier | < 20ms queries |
The decay system naturally prunes stale memories, keeping the active set focused.
Knowledge Base
Section titled “Knowledge Base”| Documents | Chunks | Index Size |
|---|---|---|
| 100 | ~2K | ~50MB |
| 1,000 | ~20K | ~500MB |
| 10,000 | ~200K | ~5GB |
| 100,000 | ~2M | ~50GB |
Knowledge search uses MiniSearch (full-text) by default. When surrealqlNative=true, HNSW vector indices provide sub-linear scaling — doubling the corpus doesn’t double query time.
Throughput
Section titled “Throughput”| Transport | Ops/sec (TypeScript) | Ops/sec (Rust) |
|---|---|---|
| stdio | ~50K | ~200K |
| SSE | ~30K | ~150K |
| HTTP | ~40K | ~180K |
| CTXB (binary) | ~500K | ~2M+ |
The Rust gateway provides 4–5x throughput improvement over the TypeScript gateway.
Cost Projections
Section titled “Cost Projections”| Team Size | Monthly Token Savings | Annual Value |
|---|---|---|
| 5 developers | ~$1,500/mo | ~$18,000/yr |
| 20 developers | ~$6,000/mo | ~$72,000/yr |
| 100 developers | ~$30,000/mo | ~$360,000/yr |
Based on the 90% token reduction measured in Token Savings.
See Also
Section titled “See Also”- Token Savings — measured savings
- Performance Data — latency benchmarks
- Deployment — infrastructure options