Architecture

One EC2, Docker Compose, typed events end to end.

nginx fronts the Next.js portal and the FastAPI API; a worker runs the agent loops; Redis streams carry every event; Postgres with pgvector keeps state, memory, knowledge and audit.

High-level design

The whole system on one page.

High-level design: browser → nginx → web / api / worker → Redis, Postgres, LiteLLM → Bedrock, AWS accounts via AssumeRole, Tailscale SSH targets
docs/hld-v2.jpg — the same diagram ships in the repository.

Components

What runs where.

web (Next.js 15)

App router, React Three Fiber office, zustand store hydrated from /api/state and fed by the WebSocket. Standalone output, PWA manifest and service worker.

api (FastAPI)

Auth (JWT cookie, TOTP, RBAC, CSRF header), REST under /api, WebSocket fan-out from the Redis stream, policy engine, orchestrator, audit.

worker

Consumes azzy:tasks, runs the Hermes-style loop per agent, publishes phases, tool logs, costs, memories and agent messages; checks cancel flags between steps.

Redis streams

azzy:events for the UI and audit, azzy:tasks as the work queue, pub/sub for approval decisions, token buckets for rate limits, locks for deployments.

Postgres 16 + pgvector

Users, tasks, approvals, incidents, environments, AWS accounts, deployments, agent and chat messages, documents and chunks, artifacts, audit.

LiteLLM gateway

Bedrock primary via the EC2 IAM role, Anthropic / OpenAI fallback, per-agent token and USD caps; a deterministic stub in DEMO.

Infrastructure

Terraform for the host, CloudFormation for clients.

  • EC2 Ubuntu 24.04 m7i.large with an IAM role for Bedrock, Secrets Manager, S3 backups and sts:AssumeRole
  • Security group 443/80 only, Elastic IP, certbot TLS, nightly pg_dump to S3
  • Client accounts: AzzyReadOnlyRole / AzzyAuditRole / AzzyDeploymentRole with External ID
  • Tailscale ACLs: tag:servers and an azzy-deploy user with limited sudoers for allowlisted SSH actions
  • Prometheus text metrics at /metrics on the internal network; health at /healthz
  • GitHub Actions: build, tests, Playwright e2e and SSM deploy on main

See the office running

Sign in to the portal — in DEMO mode everything runs end-to-end without cloud keys.