Client image release
The application repository has a manual **Client Release** workflow at .github/workflows/client-release.yml for self-host customer images. It builds and pushes API, UI, Hermes-base, and OpenClaw-base images. It does not deploy a customer cluster and is separate from the k3s deployment and public hosted release workflows.
- 01.1
The
taginput supplies API/UI image versions. Runtime image versions come from their correspondingVERSIONfiles. Registry configuration usesCLIENT_REGISTRY_URL,CLIENT_REGISTRY_USERNAME, andCLIENT_REGISTRY_PASSWORD. Images are named<client-registry>/agent-barn/<component>and receive the resolved version tag and a movinglatesttag. - 01.2
The UI build uses
NEXT_PUBLIC_BACKEND_URL=http://agentbarn-api:8000for its in-cluster backend. This assumes the corresponding Service and namespace/network topology; it is not a browser-facing public API URL or an automatic fit for every custom deployment. - 01.3
A client image publication and a hosted cluster deployment are different operations. Choose deployment image references deliberately rather than treating
latestas an immutable release identifier.
Local workflow and migrations
Install API dependencies with uv and UI dependencies with pnpm. Use repository Make targets and create and review every Alembic migration before it is applied.
- 02.1
Local services are the web app on
3000at/, Product API on8000at/api/v1, Ingest API on8001at/ingest/v1, Communications on8002at/communications/v1, LiteLLM on7070, PostgreSQL on5432, and Redis on6379. - 02.2
make dev-apistarts the Product API, Ingest API, and Communications process together without making Ingest or Communications part of the Product API boundary. Usemake dev-ingestfor the telemetry sink alone,make dev-communicationsfor the Communications application alone,make dev-uifor Next.js, andmake dev-workerfor Dramatiq.make rundelegates to the complete Docker and local Kubernetes workflow. - 02.3
./run.shruns PostgreSQL, Redis, Product API, Ingest, worker, Communications, UI, and local k3d;./stop.shstops the full environment, while./stop.sh --cleanalso removes the local k3d cluster. Usemake restart-uiafter adding an App Router directory so the Docker UI route manifest refreshes. - 02.4
Local Agent pods use
INGEST_BASE_URL=http://host.docker.internal:8001/ingest/v1andCOMMUNICATIONS_BASE_URL=http://host.docker.internal:8002/communications/v1; Kubernetes deployments use namespace-local internal Services instead. - 02.5
Communications is separately served with its own ingress supervision and outbound Delivery loop. Its durable Connection, Delivery, Conversation, and operation-journal records share the application database, so schema changes use the common Alembic sequence. The content-free operation journal is retained for
COMMUNICATION_JOURNAL_RETENTION_DAYS, defaulting to31days with an allowed range of1through3650; the Communications supervisor prunes it. Retention is operational configuration, not a chart or application version change. - 02.6
make setup,make db-up,make dev-api,make dev-communications,make dev-ingest,make dev-ui, andmake dev-workerestablish focused local workflows. - 02.7
make run,make restart-ui,make migrate,make merge-heads,make rollback, andmake makemigrationscover complete startup, UI routes, and migration lifecycle.
AAI Labs hosted-service operations
This section is for maintainers operating AAI Labs’ Agent Barn installations. It describes company cluster access, workflow configuration, registries, domains, and shared service accounts.
- 03.1
If you are deploying Agent Barn for your own team, start with
/guides/self-hosting/configure-productionand use your own infrastructure values. - 03.2
The k3s branch deployment workflows and the Talos public release workflow are separate AAI Labs environments. Their
PUBLIC_*andSTAGING_*settings, storage classes, hostnames, and account-sharing arrangements apply to those workflows. - 03.3
The hosted-environments, staging-hook-identity, staging-isolation, email-operations, and versioning-and-deployment sections that follow describe those company environments. Independent installations should read them as examples rather than as requirements.
Hosted environments and workflow configuration
AAI Labs runs three repository-managed environments with deliberately different deployment targets. k3s remains the AAI Labs testing ground and hosted public Agent Barn runs on Talos. The public agent-farm namespace does not collide with the k3s agent-farm namespace because they are different clusters; the frozen namespace name remains an intentional infrastructure identifier.
- 04.1
.github/workflows/deploy.ymldeploys the k3s testing environments fromstagingandmainwith moving environment tags and branch-specific configuration. The public workflow may also publishlatestin the public registry, but deployment remains pinned to the release tag. ChartappVersionis not the source of truth for API or UI deployment images, and documentation-only changes do not require an application image release. See the versioning and deployment section below for the release-tag boundary itself. - 04.2
Change detection compares with the latest successful deployment on the same branch, and a failed deployment does not advance that baseline. Manual dispatch or an unavailable baseline builds all four Agent Barn images. Branch-group concurrency does not cancel an in-progress deployment when a newer run starts, so two overlapping k3s testing deployments mean a deployment path bypassed that concurrency group; inspect active runs and standardize on
deploy.yml. A hosted public release that does not start usually has no matching pushedvX.Y.Ztag, or a manual dispatch selected a tag that does not exist onmain. - 04.3
The public registry
registry.agentbarn.devis configured throughPUBLIC_REGISTRY_URLwith separate public credentials. The public cluster must not depend on or write to the k3s testing registry. - 04.4
Public production uses separately managed
PUBLIC_*values for PostgreSQL passwords, signing and encryption keys, registry password, LiteLLM master key, Firecrawl key, Platform Administrator credentials, Grafana administrator password, alerting webhook, and OpenRouter key where quota isolation is required. Cloudflare email account/token, Google OAuth application credentials, database usernames and names, model defaults, and allowlist configuration are shared company accounts and may be shared only deliberately. Public-only infrastructure Secrets use thePUBLIC_prefix; copy testing-cluster passwords or signing keys only through a deliberate, reviewed exception. - 04.5
Public hostname and storage variables are workflow configuration for these environments:
PUBLIC_API_HOSTfor the public Product API and provider-webhook hostname,PUBLIC_UI_HOSTfor the hosted web application,PUBLIC_WEB_APP_URLfor its full HTTPS URL,PUBLIC_GRAFANA_HOSTfor product monitoring,PUBLIC_SENDER_EMAILfor the public transactional sender, andPUBLIC_STORAGE_CLASS=rook-ceph-block-mainfor durable public storage. - 04.6
Staging: k3s, namespace
agent-farm-staging, push tostagingthroughdeploy.yml,latest-stagingand-stagingRuntime versions. - 04.7
Main testing ground: k3s, namespace
agent-farm, push tomainthroughdeploy.yml, movinglatesttags. - 04.8
Hosted public production: dedicated Talos cluster, namespace
agent-farm,vX.Y.Ztag throughdeploy-public.yml, API and UI pinned to the release tag. - 04.9
Testing image tags: API and UI use
lateston main andlatest-stagingon staging; Hermes and OpenClaw use their version-file tag, suffixed-stagingon staging.
Staging hook identity
This note applies to AAI Labs’ staging workflow and bootstrap manifest. Their ServiceAccount names must agree before the LiteLLM key hook can run. It is not an additional setup step for every independent installation.
- 05.1
The current CI workflow selects
agent-farm-staging-userfor staging, whilek8s/agent-farm-user.staging.yamlcreatesagent-farm-userinagent-farm-staging. The LiteLLM key bootstrap Job runs as the account named byLITELLM_KEY_SERVICE_ACCOUNT, so staging cannot createlitellm-api-keywhile the two names differ. Reconcile the workflow value and the staging bootstrap manifest before the hook runs; this discrepancy is unresolved in the repository, so do not assume a deployment has already corrected it. - 05.2
References:
.github/workflows/deploy.yml,k8s/agent-farm-user.staging.yaml, andk8s/agent-farm-user.yaml.
Staging isolation
Staging uses the frozen agent-farm-staging namespace and staging-suffixed images. Per-environment secrets use STAGING_ values, while selected shared accounts and keys remain common. The release-derived K8S_NAMESPACE value must remain correct or an environment can create Agent workloads in the wrong namespace.
- 06.1
The Communications Deployment and Service run in the same release namespace as the Product API. Product API and Agent Runtimes receive the namespace-local Communications base URL for that release, and provider webhook ingress routes only
/communications/v1/webhooksto the Communications Service. - 06.2
The
stagingbranch deploys to the staging namespace on the AAI Labs k3s testing cluster;maindeploys to the main namespace on that same testing cluster. Neither is hosted public production. Movinglatestandlatest-stagingtags belong only to those branch testing deployments.
Email operations
Transactional email uses Cloudflare Email Sending through one infrastructure adapter. Each environment sends from its own verified mail subdomain, while the account and API token are shared. Delivery is disabled when required configuration is absent, and the account-wide daily quota is shared by staging and main testing deployments.
Versioning and deployment
Hosted public Agent Barn deploys through .github/workflows/deploy-public.yml only from a vX.Y.Z release tag, or a manual dispatch naming an existing release tag. Public images use registry.agentbarn.dev; branch workflows remain the testing ground and do not publish a hosted-public release. Public release tags must come from a commit already on main.
- 08.1
The API image contains Product, Ingest, worker, and Communications application code. Helm runs Communications as a separate workload using that image, so Communications needs no separate application version. API and UI tags are explicit deployment inputs; Hermes and OpenClaw retain their own
VERSIONfiles. Chartversionis packaging-only and changes only when chart templates or values change; documentation-only changes require neither image tags nor chart-version changes. - 08.2
Public deployment must not reuse k3s registry credentials, signing keys, database passwords, or kubeconfig unless sharing is explicitly intended. Use
.github/workflows/deploy.yml,.github/workflows/deploy-public.yml, anddocs/adr/2026-08-27-public-cluster-release-tags.mdas the release-boundary references.
Monitoring and safety
The monitoring chart stays namespace-scoped and creates no RBAC. Communications exposes GET http://localhost:8002/health and GET http://localhost:8002/metrics; Kubernetes uses the corresponding Communications Service and probes rather than localhost.
- 09.1
Low-cardinality Communications metric families cover observed Connection status, inbound and outbound Delivery outcomes, pending queue depth, oldest queued Delivery age, Delivery latency, reconnect requests, and provider admission-policy dispositions. Metrics summarize system behavior; operators use Connection diagnostics and journal views for one Connection or Delivery. Metric failures must never interrupt Communications processing.
- 09.2
Keep labels low-cardinality: never label metrics with Organization, Agent, Connection, Delivery, provider-message, channel, or user IDs, or credential fingerprints. Run
make check-monitoringafter alert-rule or dashboard changes. - 09.3
Treat signing and encryption key rotation as migrations, preserve migration and secret-hook behavior and LiteLLM quota-aware rollout, and use deployment workflows instead of manual mutable-tag publishing. Continue with
/guides/self-hosting/communications,/guides/self-hosting/configuration,/guides/self-hosting/deploy-kubernetes,/guides/self-hosting/monitoring,/guides/self-hosting/upgrades, and/guides/observe-and-govern/communication-diagnosticsfor detailed procedures. - 09.4
agentbarn_communication_connection_statusandagentbarn_communication_delivery_outcomes. - 09.5
agentbarn_communication_queue_depth,agentbarn_communication_oldest_queued_age_seconds, andagentbarn_communication_delivery_latency_seconds. - 09.6
agentbarn_communication_reconnectsandagentbarn_communication_policy_dispositions.