# Repository Briefing: aai-labs/agent-barn
> Source: https://repoforai.com/repo/aai-labs/agent-barn (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/aai-labs/agent-barn
- **Official Docs / Website**: https://agentbarn.dev
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A (84/100 · Maintenance 35/35 · Adoption 9/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.27.0 (2026-12-03) — https://github.com/aai-labs/agent-barn/releases
- **Review Snapshot**: 2026-12-03 (Note: v0.27.0 on 2026-12-03 shipped after this review; verify latest release notes)
- **Deployment / Stack Signals**: Docker, Self-Hosted
- **Momentum**: 116 ★ total (+0 24h / +4 7d) · 7 forks
- **Topics**: `agent`, `agent-skills`, `agentic-ai`, `helm`, `helm-charts`, `kubernetes`, `python`, `cli`, `cli-tool`
- **When to Use**: Best for: Teams already operating Kubernetes that want to run multiple chat-connected OpenClaw or Hermes agents with scoped tool credentials, shared audit records, and per-agent spend reporting. Skip if: You only need one agent, want a production deployment without Kubernetes, or require fully offline inference without an external model API.

## Overview
```text
### Architecture & Core Mechanics
Agent Barn is a Python-based control plane that manages OpenClaw and Hermes without replacing either runtime. The codebase separates the API, UI, and workers. In the Kubernetes deployment, the control plane, PostgreSQL, and LiteLLM run in the operator’s namespace, with one pod per running agent. Operators select the runtime per agent; the platform manages its Kubernetes resources, configuration, Skills, and lifecycle. The local stack also includes Redis and Garage S3-compatible storage.

Slack, Microsoft Teams, Telegram, and Discord connect through per-agent communication connections. These are separate from tool access, which uses Skills and attached credentials. Model calls go through the operator’s LiteLLM proxy to OpenRouter using a virtual key assigned to the agent. An ingest service receives runtime telemetry; conversation history, tool-call logs, and domain events give operators several ways to review what happened.

### Key Capabilities & Differentiators
Administrators can start, stop, and monitor agents, select models within organization policy, and set agent-specific channel allowlists and DM rules. Organization roles and per-agent access roles are isolated at the data layer. An agent can have several chat connections, including multiple connections on one platform. Slack apps must be created from a generated manifest, while Teams connections export an installable app package.

Organizations can fork versioned templates and Skills seeded at startup, apply per-agent overrides, and pin Skill versions. Workflows can publish private artifacts using per-agent storage, with short-lived app download links and permission-gated deletion. LiteLLM virtual keys support token and spend attribution by agent and organization, but recent calls may not appear until the next cost sync. Templates such as Jira Task Helper provide workflow starting points, not preconfigured access to external systems.

### Trade-offs & Limitations
Compared with running OpenClaw or Hermes directly, Agent Barn is most useful when several teams need shared lifecycle management, permissions, audit records, and cost attribution. For a single agent with one owner, the cluster, database, proxy, and gateway services add operational work. The control plane does not unify command approvals across runtimes, so teams should validate tool permissions and approval behavior on the runtime they intend to use.

Compared with a hosted service, self-hosting puts the control plane and encrypted PostgreSQL credentials under your administration, but also makes you responsible for cluster operations and integrations. It does not make the deployment offline: the standard model path goes to OpenRouter, connected tools receive API traffic, and enabled product analytics adds another outbound path. Size the deployment by measuring control-plane and storage overhead, then test at the expected number of active agent pods and level of tool activity. The Apache-2.0 license covers Agent Barn, not the terms of external services.

### Hardware & Deployment Guide
For local evaluation, copy `.env.spec` to `.env`, configure PostgreSQL, admin credentials, and signing and encryption keys, then run `./run.sh`. The Docker Compose development stack requires Compose v2.24 or later, plus Git, Bash, `kubectl`, OpenSSL, curl, and `uv`; `uv` supplies Python 3.14 for the host-side Garage bootstrap. The script brings up k3d and LiteLLM, builds and loads both runtime base images, starts PostgreSQL and Redis, and applies migrations. The initial build takes longer than subsequent starts. Verify the API at `/api/v1/health`, check the `agent-farm` namespace, and create an organization before creating an agent.

Use the charts in `helm/` and `helmfile.yaml.gotmpl` for production Kubernetes, not the hot-reloading `compose.yml`. Preserve `LITELLM_SALT_KEY` across upgrades and restores: changing it makes stored provider keys unreadable. The memory gateway requires Hindsight; the optional `local-hindsight` profile supplies it locally. The standard inference path needs an OpenRouter key, not local GPU inference. Release v0.26.0 adds Custom Slack support for Hermes agents on a client’s self-hosted Slack.
```

## Key Capabilities
```text
- Runtime isolation: Each running agent gets its own Kubernetes pod and uses either OpenClaw or Hermes.
- Model accounting: A LiteLLM virtual key per agent attributes tokens and spend to agents and organizations; imported cost records can lag.
- Access controls: Organization and per-agent roles are enforced in the data layer, with agent-specific channel allowlists and DM policies.
- Skill versioning: Organizations can fork seeded templates and Skills, and agents can use overrides and pin Skill versions.
- Operational records: Conversation history, tool-call logs, and domain events support review; private artifacts use short-lived download links.
- Chat integration: Agents can hold multiple connections, including on the same platform; Slack uses generated manifests and Teams exports an installable app package.
```

## Quick Start / Clone
```bash
curl -s localhost:8000/api/v1/health
# {"status":"ok","db":"connected"}
```
