Janus

Documentation

Deployment

Install, configure, and run Janus, then complete your first agent-to-agent task handoff.

Production Deployment

For Kubernetes, Janus ships a Helm chart with liveness/readiness probes, a migration Job hook, HPA, PDB, and Prometheus scrape annotations:

helm install janus deployments/helm/janus-core/

See the GitHub repo for the full chart values and the ops runbook.

Distributed Deployment

Janus Core is a stateless compute node — all persistent state is externalized to PostgreSQL, NATS JetStream, and Redis. You can run multiple replicas horizontally; any replica can serve any request, a single replica crash loses no business state, and traffic is balanced behind a front load balancer.

Load Balancer / Ingress
↓
Janus Core (stateless)
#1 #2 … #N
HPA · 2–10 replicas
↓
PostgreSQLpersistent state
NATS JetStreamevents / messaging
Redisrate limit / cache
The compute tier scales horizontally; all state is externalized to PG / NATS / Redis.

When multiple replicas consume outbox events concurrently, a database-level lease provides mutual exclusion so events are neither double-delivered nor lost. Migration 000011_outbox_worker_lease adds lease columns to outbox_events, and 000012_outbox_dedupe_key adds an idempotency key:

locked_by        text         -- worker that claimed the row
locked_at        timestamptz
lease_expires_at timestamptz  -- reclaimable by another worker after expiry
dedupe_key       text         -- unique (tenant_id, dedupe_key) prevents double delivery

If a replica crashes, its locked rows are reclaimed by a live replica once the lease expires; dedupe_key guarantees retries and concurrent schedulers never insert the same delivery twice.

Scaling the Compute Tier

The Helm chart enables the HorizontalPodAutoscaler by default, auto-scaling on CPU and memory:

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 70
  targetMemoryUtilizationPercentage: 80

A PodDisruptionBudget (minAvailable: 1) keeps at least one replica available during rollouts and node maintenance.

Scaling the State Tier

As the compute tier scales horizontally, each state store scales its own way:

  • PostgreSQL — a single primary handles Janus's workload; add PgBouncer for higher throughput, and read replicas for read-heavy access patterns.
  • NATS JetStream — natively supports clustering with RAFT consensus; scale JetStream nodes horizontally for more messaging throughput and fault tolerance.
  • Redis — a single instance is usually enough; use Redis Cluster or Sentinel when you need higher availability.
Janus Core runs with a readOnlyRootFilesystem; the only persistent volume is for artifact storage (artifacts) — it holds no runtime state, so replicas are stateless and replaceable at any time.