Agent Barn
Run a fleet of AI coworkers in Slack, Teams, Telegram, and Discord on your own Kubernetes.
- Source repo
- aai-labs/agent-barn
- Stars
- ★ 110
- Last updated
- 3d ago
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 55/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changesOpenAI API (Needs adaptation)
- Cost
- Free software; you pay for model usage
- Setup effort
- High · needs real infrastructure
- You'll need
- Typical use
- Platform teams already running Kubernetes who want internal assistants for their department living in their own namespace, instead of asking colleagues to sign into another SaaS.
- Not a fit if
- Teams unwilling to operate a Kubernetes cluster plus PostgreSQL and Redis
- Individuals who want a turnkey SaaS and won't supply an OpenRouter key
- Source review
- 55/100 · Major gaps
What does this agent do, and when should you use it?
Agent Barn is an Apache-2.0 licensed, open-source control plane for AI agents from AAI Labs in Vilnius, Lithuania. It is assembled from a FastAPI control plane (api/, including the ingest, communications, memory and credential gateways plus a Dramatiq worker), a Next.js App Router frontend (ui/), one pod per running agent built from two pinned base images named OpenClaw and Hermes, and a Helm/Helmfile deployment layer (helm/, helmfile.yaml.gotmpl). An agent is defined as a template plus a model, one or more communication connections, and a set of credentialed skills; templates are content, not code, authored as settings.yaml plus Markdown artifacts (soul, identity, user, tools, agents, boot, bootstrap, heartbeat) and seeded on startup. Model traffic flows through a LiteLLM proxy you operate, with one virtual key per agent, so token and spend attribution is per agent rather than one opaque monthly figure. Everything — control plane, database, model proxy, and each agent pod — runs in your namespace (the shipped namespace is agent-farm), with credentials encrypted at rest in your own PostgreSQL. The software is free, but you bring an OpenRouter API key and pay for model usage.
Agent Barn reads your .env or .env.deploy configuration, brings up a k3d cluster via docker/k3d/k3d-up.sh for local use (or targets a real cluster on deploy), and turns each agent record into Kubernetes resources built by builders that can be reconciled with make reconcile. Every running agent is a pod launched from a pinned base image; the two supported runtimes, OpenClaw and Hermes, consume the same runtime-neutral communications protocol, so every messaging platform works on either one. Agents stream conversation and tool-call events from in-pod runtime plugins to the ingest API on port 8001, and the UI reads only what was persisted; Web Chat and Email go through the separately served communications gateway on port 8002, where pods claim and complete deliveries via http://host.docker.internal:8002/communications/v1. Skills mount provider documentation into the agent workspace and are gated on the credential their provider needs, so a skill is attached only once the matching credential exists; agents also reach a self-hosted Firecrawl for web retrieval. Model calls are minted per agent as LiteLLM virtual keys and forwarded to OpenRouter, giving per-agent and per-organisation token and spend attribution. Identity covers sign-up, login, logout, access and refresh tokens in an httpOnly cookie, password change and reset, organisations with fixed permission-backed roles, and separate per-agent access roles and assignments. Platform administration covers users, organisations, statistics and the Event Delivery Monitor, while domain events run through a transactional outbox, a Dramatiq worker and a security-audit projection. Each agent also has conversation history and a tool-call audit log.
- Platform teams already running Kubernetes who want internal assistants for their department living in their own namespace, instead of asking colleagues to sign into another SaaS.
- Companies with data-residency or compliance constraints that require credentials, conversations and model traffic to stay in their own PostgreSQL and network, reaching OpenRouter only through a self-operated LiteLLM proxy.
- Engineering or finance leads who need per-agent and per-organisation token and spend attribution rather than a single monthly bill.
- Development teams that want fixed roles such as PR Reviewer, Documentation Agent or Jira Task Helper and can start one straight from the shipped template seeds.
- Multilingual teams that need plain-language requests turned into structured Jira tasks, merged pull requests documented into Confluence, or a weekly Slack digest posted automatically.
- Teams evaluating the OpenClaw and Hermes runtimes side by side, since both share one communications protocol and can be chosen per agent along with the command-approval mode.
How do you install or deploy this agent?
You need Git, Docker with Compose v2, bash, kubectl, OpenSSL, curl and an OpenRouter API key; Python and Node.js are only needed for the native dev-* targets, tests and lint. Ports 3000, 5432, 7070, 8000, 8001, 8002, 8003, 8004 and 16443 must be free.
Clone the repository and create your local configuration:
git clone https://github.com/aai-labs/agent-barn.git
cd agent-barn
cp .env.spec .envGenerate the two keys — the Fernet key encrypts platform credentials at rest, and the LiteLLM master key must stay stable because LiteLLM encrypts the virtual keys it stores with it:
openssl rand -base64 32 | tr '+/' '-_'
echo "sk-$(openssl rand -hex 16)"Fill in POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB and POSTGRES_PORT, SECRET_SIGNING_KEY, PLATFORM_ADMIN_CREDENTIALS (email:password, at least 8 characters with upper, lower and a digit), AGENT_TOKEN_ENCRYPTION_KEY, OPENROUTER_API_KEY, LITELLM_MASTER_KEY, AGENT_LITELLM_BASE_URL=http://host.docker.internal:7070, and full image tags for OPENCLAW_IMAGE and HERMES_IMAGE whose tags match openclaw-base/VERSION and hermes-base/VERSION.
Then start the full stack (the first run builds both agent base images and takes a while):
./run.shDeploying to Kubernetes instead requires a cluster with an ingress controller, a cert-manager ClusterIssuer and a StorageClass, plus kubectl, Helm 3, Helmfile 0.171.0 and the helm-diff plugin on your machine:
cp .env.deploy.spec .env.deploy
# replace every example image tag; fill in registry, passwords, hosts and keys
./deploy.shHow do you use this agent?
Once the stack is up, open the UI and sign in with the email:password from PLATFORM_ADMIN_CREDENTIALS, then confirm the API and the cluster agents will run on are healthy:
curl -s localhost:8000/api/v1/health
# {"status":"ok","db":"connected"}export KUBECONFIG=.k3d/kubeconfig-host.yaml
kubectl get nodes
kubectl get ns agent-farmAgents are organisation-scoped and a fresh database has none, so create an organisation first. Then pick a template (PR Reviewer, Documentation Agent, Email Reminder, Jira Task Helper, Scrum Master or General Purpose), choose a model, attach any credentials its skills need, and start it. Connecting it to Slack, Microsoft Teams, Telegram or Discord is a per-agent Communication Connection, and the UI walks through each platform's setup including manual creation of a Slack app from the generated manifest.
For programmatic access, create a Personal API Key in Account settings and call the existing user-authenticated /api/v1 routes:
curl -H 'Authorization: Bearer <your-personal-api-key>' \
https://your-host/api/v1/openapi.jsonThe deployed API also serves an interactive reference at /api/v1/docs, an OpenAPI schema at /api/v1/openapi.json and agent guidance at /llms.txt. For fast iteration, switch to the native path (make setup, make db-up, make migrate, then make dev-api, dev-ui, dev-worker and the other dev-* targets), but make sure DB_CONNECTION_URL is correct in .env and that LITELLM_BASE_URL is set to http://127.0.0.1:7070, since nothing fills it in and agents will silently be created without a usable LiteLLM key.
What are this agent's strengths and limitations?
- Fully self-hosted data path: the control plane, PostgreSQL, LiteLLM proxy and every agent pod run in your namespace, credentials are encrypted at rest in your own database, and outbound model traffic goes only through the proxy you operate.
- Per-agent metering that most chat assistants do not expose: each agent gets its own LiteLLM virtual key, enabling token and spend attribution per agent and per organisation.
- Multi-tenancy is built into the data layer, with organisations on fixed permission-backed roles, separate per-agent access roles and assignments, versioned templates and skills that organisations can fork or override, and agents pinned to the skill version they run.
- Broad delivery surface for internal tools: Slack, Microsoft Teams, Telegram and Discord, with multiple connections per agent, plus Web Chat and Email through a dedicated communications gateway.
- Complete Helm and Helmfile deployment layer, including separate PostgreSQL instances for the app, LiteLLM and Firecrawl, Redis, Hindsight, and a namespace-scoped Prometheus and Grafana, alongside k3d scripts for local clusters.
- Auditability is a first-class feature: conversation history, a tool-call log, domain events via a transactional outbox and Dramatiq worker, and a security-audit projection, with an Event Delivery Monitor in platform administration.
- Setup is heavy by design: Git, Docker Compose v2, kubectl, OpenSSL, curl and an OpenRouter key locally, plus an ingress controller, cert-manager ClusterIssuer, StorageClass, Helmfile 0.171.0 and helm-diff for a real deployment.
- Kubernetes is not optional. Agents run as pods, the native development path still needs a k3d cluster with loaded images, and two full ./run.sh stacks cannot run side by side on one machine because container names, volumes and ports are shared.
- The model egress path is currently tied to OpenRouter through LiteLLM, so you need an external API key and pay per use; there is no documented alternative provider adapter in the repository.
- Some views depend on extra infrastructure: without Prometheus the Resource usage tab and the Agents overview report that resource usage is not configured.
- Several steps remain manual: Slack apps must be created by hand from a generated manifest, and the Cloudflare Email Worker routing rule cannot be configured by CI, so inbound mail bounces with 550 5.1.1 until someone points the rule at the Worker with subaddressing enabled.
- Paid-by-default telemetry: installs send business events to Agent Barn's PostHog EU project unless ANALYTICS_ENABLED is set to false and the deployment is redone, and local development stacks report too.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Agent Barn This agent | 55 · Major gaps | Self-hosted serviceFree + model costs | ★ 110 | 3d ago | Python | — |
| Moltis Personal Agent Server | 53 · Major gaps | Self-hosted serviceFree + model costs | ★ 2.9k | today | Rust | Codex · Claude Code |
| n8n-claw | 52 · Major gaps | Self-hosted serviceFree + model costs | ★ 560 | 2mo ago | Shell | ChatGPT · Claude Code · OpenAI API · Claude API |
| Second Brain Personal AI Assistant | 37 · Major gaps | CLIFree + model costs | ★ 670 | 24d ago | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
SECURITY.md explicitly asks for least-privilege deployment: a namespace-scoped identity for the API pod that creates agent workloads only in its own namespace, plus narrowly scoped credentials and per-agent channel allowlists/DM policies, so least_privilege scores 2. However the OpenClaw runtime pins command approval to AUTO (stated in README), so agent command execution needs no human confirmation; user_confirmation scores 1. Data-flow transparency is decent: README names outbound destinations (OpenRouter via LiteLLM, tool APIs, optional PostHog analytics) and states credentials are encrypted at rest in the operator's PostgreSQL, scoring 2. Sensitive-data handling covers encryption keys and rotation-as-migration, but no retention/deletion policy is given, scoring 2. Dependency security shows only uv --frozen and pinned image tags; no dependency scanning, SBOM, or vulnerability response process is visible, scoring 1. External effects: agents can act on GitHub/Jira/email, but no default guard or approval for destructive actions is described, scoring 1. Rollback: only stop.sh preserving volumes and the warning that changing LITELLM_MASTER_KEY breaks existing keys; no version rollback or migration-reversal path, scoring 1. Source attribution: LICENSE carries the AAI Labs UAB copyright, but upstream OpenClaw/Hermes attribution and licensing are not stated, scoring 1.
Self-consistency is good: the README port table, run.sh flow, CI workflows, and test config agree, and the README explains the deliberate agent-farm namespace name, scoring 2. Dependency availability is weaker: it depends on OpenRouter, LiteLLM, k3d, and Hindsight, and the README admits create_agent silently skips minting a LiteLLM key when LITELLM_BASE_URL is empty, scoring 1. Failure messages are solid: run.sh fails fast listing missing values, health endpoints exist, troubleshooting guidance and password-policy failure hints are present, scoring 2.
Audience and scenarios are clear: teams self-hosting on Kubernetes, with six seeded agent templates and Slack/Teams/Telegram/Discord scenarios, scoring 2. Capability boundaries are documented: skills are credential-gated, some are attachable but not auto-attached, Excel needs no credential, scoring 2. Trigger precision is weak: agents are triggered by channel messages, mailboxes, and heartbeats, but no explicit trigger conditions, deduplication, or rate-limit rules are given, scoring 1. Environment fit is strong: Docker Compose local stack, k3d, native dev, Helm/Helmfile production deployment, with port and hostname-resolution details, scoring 2.
Information architecture is excellent: README has a table of contents, sections, collapsible details, and a repository layout, scoring 3. Install notes are thorough: prerequisites, credentials, ports, a six-step quick start, key-generation commands, and verification steps, scoring 3. Naming stability is mixed: the project was rebranded from agent-barn while the Kubernetes namespace remains agent-farm, and image tags must be manually kept in sync with VERSION files, scoring 2. Examples and FAQ are thin: only a template list and external recipe links, with no runnable in-repo examples or FAQ, scoring 1. Known limitations are recorded: OpenClaw approval fixed to AUTO, some skills not auto-attached, immutable LiteLLM key, memory gateway needing Hindsight, scoring 2. License is complete: full Apache-2.0 text with a copyright line, scoring 3. Versioning/changelog is weak: SECURITY.md mentions vX.Y.Z tags and a short pre-1.0 support window, but there is no in-repo CHANGELOG, scoring 1. Maintenance responsibility is fairly clear: SECURITY.md gives reporting channels, response timeframes, and operator responsibilities, though the publisher identity is unverified, scoring 2.
Output usability is reasonable: UI, API, audit logs, cost attribution, and event trails, but no examples of output formats or integration patterns, scoring 2. Marginal value is clear: self-hosting, multi-tenancy, per-agent cost attribution, and auditing differentiate it from generic chat bots, scoring 2. Cost-benefit evidence is thin: it claims per-agent token and spend attribution but gives no resource footprint, scale limits, or comparison data, scoring 1.
Claim traceability is moderate: many README claims point to in-repo docs/ paths and specific files, but only README, LICENSE, SECURITY.md, and two workflows were supplied, so most references cannot be checked, scoring 2. Cross-source corroboration is limited: the CI workflows and conftest corroborate that tests and k3d integration exist, but functional claims cannot be corroborated, scoring 1. Fact/inference separation is fair at best: README mixes marketing phrasing with concrete technical detail and does not mark what has been verified, scoring 1.
- The OpenClaw runtime pins command approval to AUTO, so agent command execution needs no human confirmation; confirm this default matches your risk tolerance before production use.
- The README states create_agent silently skips minting a LiteLLM key when LITELLM_BASE_URL is empty, leaving an agent that looks created but can never answer; set this variable explicitly and verify.
- Changing LITELLM_MASTER_KEY invalidates existing virtual keys and is effectively irreversible; treat it as a migration rather than routine rotation.
- No dependency scanning, SBOM, or vulnerability response process is visible in the repository, and there is no CHANGELOG; the publisher identity is unverified, so assess upgrade and security-response paths yourself.
- Model traffic leaves your network via LiteLLM to OpenRouter, and optional PostHog analytics may be enabled; follow SECURITY.md guidance to scope the key and confirm the analytics toggle.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
What's Changed * fix(k8s): grant the Hindsight key hook read access to its hashes Secret by @kalibetre in https://github.com/aai-labs/agent-barn/pull/311 Full Changelog: https://github.com/aai-labs/agent-barn/compare/v0.19.1...v0.19.2View on GitHub ↗ -
Release notes excerpt
What's Changed * fix(teams): keep one Teams app per bot across re-created Connections by @kalibetre in https://github.com/aai-labs/agent-barn/pull/310 Full Changelog: https://github.com/aai-labs/agent-barn/compare/v0.19.0...v0.19.1View on GitHub ↗ -
Release notes excerpt
What's Changed * Bump Hermes and OpenClaw base versions by @kalibetre in https://github.com/aai-labs/agent-barn/pull/246 * onboard third domain and wire it by @dominykas-aai-labs in https://github.com/aai-labs/agent-barn/pull/248 * Promot staging to prod with changes on onboard third domain for cloud by @kalibetre in https://github.com/aai-labs/agent-barn/pull/249 * Allow organization owners and admins to rename organizations by @tadas-subonis in https://github.com/aai-labs/agent-barn/pull/254 …View on GitHub ↗