Agent Barn

Run a fleet of AI coworkers in Slack, Teams, Telegram, and Discord on your own Kubernetes.

Stars
★ 110
Last updated
3d ago
License
Apache-2.0
Primary language
Python

At a glance

How it runs
Self-hosted serviceWeb appChat bot
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
Docker with Compose v2kubectlOpenSSLcurlOpenRouter API keyPostgreSQLRedisk3d (local, provided via helper container)Shell / CLINetwork accessLocal filesystem
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

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.

  1. 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.
  2. 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.
  3. Engineering or finance leads who need per-agent and per-organisation token and spend attribution rather than a single monthly bill.
  4. 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.
  5. 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.
  6. 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 .env

Generate 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.sh

Deploying 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.sh

How 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-farm

Agents 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.json

The 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?

Pros
  • 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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
55/ 100 5-point scale 2.8 / 5
This review covers the source as of Oct 14, 2026. The project has shipped 2 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 13/29
Reliability 8/14
Adaptability 10/18
Convention 13/18
Effectiveness 7/13
Verifiability 4/8
Why each dimension lost points
Trust13 / 29 · 2.2/5

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.

Reliability8 / 14 · 2.9/5

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.

Adaptability10 / 18 · 2.8/5

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.

Convention13 / 18 · 3.6/5

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.

Effectiveness7 / 13 · 2.7/5

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.

Verifiability4 / 8 · 2.5/5

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.

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Oct 14, 2026 Reviewed revision 9ffaf06ddff8 New commits since this review; the score may not cover them
See the full review method →

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v0.19.2
    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.2
    View on GitHub ↗
  2. v0.19.1
    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.1
    View on GitHub ↗
  3. v0.19.0
    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 ↗

FAQ

Is the product itself paid, and where do the costs come from?
The repository is Apache-2.0, so installing and self-hosting it is free. You must supply your own OpenRouter API key and pay per model call; each agent gets its own LiteLLM virtual key, which makes token and spend attribution possible per agent and per organisation. The infrastructure bill — Kubernetes, PostgreSQL, Redis, storage — is yours as well. Note that the LiteLLM master key must never change, because LiteLLM encrypts stored virtual keys with it and rotating it breaks every agent created under the old value.
What data leaves my cluster?
Outbound traffic goes to OpenRouter through the LiteLLM proxy you operate, to whichever tool APIs you connect, and, while ANALYTICS_ENABLED is true (the default), to Agent Barn's PostHog EU project. Analytics events cover things like agent creation, start and deletion, organisation changes, members joining, sign-ins and invites, plus an hourly message count per agent. They carry random user, organisation and agent IDs and an install name defaulting to your web app host, and never agent or organisation names, prompts, message content, conversations, credentials, changed values, email addresses or full names. Set ANALYTICS_ENABLED=false in .env.deploy and redeploy to opt out.
An agent starts but never answers. What should I check first?
Check AGENT_LITELLM_BASE_URL. It is handed to the pod as LITELLM_PROXY_TARGET and must use http://host.docker.internal:<litellm port>, because a loopback address resolves to the pod itself. If activity is also empty, verify the ingest hop on port 8001, where each pod authenticates with its own INGEST_API_KEY, using the documented curl check from inside the cluster. In the native path, set LITELLM_BASE_URL=http://127.0.0.1:7070 — when it is blank, create_agent silently skips minting a LiteLLM key and the agent looks fine but can never reply.
Can we remix the shipped templates and skills for our own processes?
Yes. Templates are content rather than code: a settings.yaml plus Markdown artifacts, seeded once to bootstrap the platform lineages, after which new versions are authored through the platform admin flow and organisations fork or override them per agent. Agents pin the skill version they run. Skills are gated on the credential their provider needs, so only credentialed skills are auto-attached; Excel, Google Drive, HubSpot, OpenPanel and PostHog are attachable but not auto-attached, and Excel needs no credential because it works on local files.
Which chat platforms can agents live in, and can one agent cover several?
Slack, Microsoft Teams, Telegram and Discord, plus Web Chat and Email via the communications gateway on port 8002 and a Cloudflare Email Worker. An agent may own several connections, including more than one on the same platform. Slack apps are created by hand from a generated manifest, Teams connections export an installable app package, and inbound email requires a manual Cloudflare routing rule pointing agent@<AGENT_EMAIL_DOMAIN> at the deployed Worker with subaddressing turned on.
View on GitHub ↗ Install ↓

Related agents