Skip to main content
KUSHAL SRINIVAS OP-2026
[ENGINEERING RECORD · DISTRIBUTED SYSTEMS]

Agent Platform — Durable Multi-Tenant AI Workflow Orchestration

GoPostgreSQLNATS JetStreamgRPCPythonLangGraphNext.jsReact FlowOpenTelemetryDocker / Helm

Most agent prototypes treat workflow state as in-memory Python objects. That works until a worker dies mid-tool-call, a message delivers twice, or two teams run untrusted workflows on the same cluster. Agent Platform (0.1.0-rc.1) flips the boundary: a Go orchestrator backed by PostgreSQL is the sole transactional authority for workflow state, and Python executes only untrusted LLM and tool steps inside isolated subprocesses with zero database or broker credentials.

251 req/s
k6 API stress (100 VUs)
P95 241 ms · 0% errors · M1 Compose RC
1,000/1,000
Echo loadgen completion
25.6/s · 0 retries · 64 worker slots
190
Automated tests
64 Go unit · 44 Go int/chaos · 82 Python
0
High/critical security issues
govulncheck, pip-audit, npm audit, Trivy

Architectural Boundary

[EXECUTION FLOW]

Next.js Studio / SDK / CLI → Go API (OIDC/JWT + RBAC + Audit) → Go Orchestrator + PostgreSQL 16 (RLS, Outbox, 13-Node CEL DAG) → NATS JetStream → Go Worker Host (Lease Heartbeat + prlimit) → Unix-Socket gRPC → Python LangGraph Runtime (Models + Tools + MCP)

The platform spans 24 PostgreSQL tables across control (7 migrations, 12 tables) and execution (8 migrations, 12 tables) schemas with Row-Level Security. Workflow and agent versions are immutable and pinned by RFC 8785 canonical JSON SHA-256 digests so in-flight runs cannot drift when a new revision is published.

  • Fenced attempts: Every dispatched task carries a per-attempt (worker_id, lease_id) fencing token. Stale workers returning after a partition or restart cannot commit duplicate state transitions.
  • Process isolation: The Go worker spawns a per-attempt Python LangGraph subprocess constrained with OS prlimit caps and talks over a Unix-domain gRPC socket. The runtime holds no DB connection string or NATS credentials.
  • Multi-provider + MCP runtime: Supports deterministic Echo, OpenAI-compatible, Anthropic, and Gemini providers (including Gemini thought signatures), built-in SSRF-guarded tools, and stdio or Streamable HTTP MCP servers with atomic gzip-JSON checkpoints.
  • Operator & developer surface: Next.js 16 + React Flow visual workflow builder and live SSE execution explorer (15 routes), sync/async Python SDK, Go client SDK, agentctl, platformctl, Prometheus/Grafana (7 dashboards), Loki, and OTLP tracing.

Measured RC Benchmarks (Local Apple M1)

All numbers below were measured on 2026-11-24 against the Docker Compose stack on an Apple M1 (8 cores, 8 GB RAM, 3.83 GiB Docker VM, single-node PostgreSQL 16.16, single-node NATS 2.15.3 JetStream, 1 orchestrator replica). Raw JSON outputs live in loadtest/results/.

Public API and execution-engine measurements (Apple M1 Compose RC baseline)
WorkloadVolumeThroughputLatencyReliability
k6 API smoke (20 VUs)8,316 reqs66.3 req/sP50 4.2 ms · P95 27.9 ms0% errors
k6 API stress (100 VUs)19,523 reqs251.0 req/sP50 18.9 ms · P95 241.0 ms · P99 578.9 ms0% errors
loadgen baseline (Go echo, c=16)100 / 10023.6 comp/s (138.8 sub/s)E2E P50 2.03 s · P95 3.36 s0 retries
loadgen target (Go echo, c=64)1,000 / 1,00025.6 comp/s (257.0 sub/s)E2E P50 18.95 s · P95 34.29 s0 retries
Queue pressure (Go echo, c=128)5,000 accepted (4,739 done in 205 s)23.1 comp/sPeak pending 4,981 execs3 retries (0.06%) · 0 failures
Burst (Go echo, c=256)10,000 accepted (7,437 done in 361 s)20.6 comp/sPeak pending 9,996 execs5 retries (0.07%) · 0 failures
Python LangGraph runtime (echo, c=8)100 / 1000.74 comp/s (96.4 sub/s)Attempt P95 12.76 s · E2E P50 72.29 s0 failures
Live Gemini provider check1 / 1—Submit 70 ms · Attempt 9.61 s · E2E 10.41 s1 / 1 succeeded

Subsystem micro-measurements on the same stack: PostgreSQL candidate query 4.49 ms, execution list query 1.87 ms, outbox claim 0.16 ms, and NATS broker resident memory ~138 MB.

Chaos & Security Verification

Chaos suite (44 Go integration & chaos tests, 251.8 s full run)
ScenarioOutcome
Worker container restart mid-flight9/9 executions succeeded in 80 s · 0 duplicate commits
10 concurrent duplicate execution requestsCollapsed cleanly into 1 logical execution
Cancel during parallel fan-out3/3 active tasks cancelled in 1.2 s
Provider outage2 attempts retried then marked durable failure in 5.6 s
Backup & migration verification1.3 MB dump restored clean; 15 migrations verified on scratch DB

Read next: the performance ledger and Web Research Engine.

BACK TO ALL ENTRIES