Open-source agent orchestration platform. Deploy a team of AI agents locally with org charts, budgets, governance, and stigmergic coordination.
Bedlam is a modified fork of Paperclip with significant architectural enhancements for production-grade local agent deployments. It gives you a full control plane for running AI agent companies — complete with org structure, budget enforcement, task governance, and agent-to-agent coordination — without sending your data or workflows to any external service.
Bedlam ships with the following enhancements on top of upstream Paperclip:
Agents communicate indirectly through shared environmental state rather than direct message passing. This allows large agent teams to self-organize around work without tight coupling or central orchestration bottlenecks. Agents leave traces; other agents respond to those traces.
Agents evaluate their own outputs before surfacing results. Reflexion loops are built into the execution pipeline: an agent produces a result, critiques it against defined quality criteria, and iterates until the output meets the bar or escalates to a human approver.
Model assignment is based on task type, not a static config. Design-heavy and architecture work routes to Opus or GPT-4-class models. Standard execution routes to Sonnet-class. Mechanical and repetitive tasks route to Haiku-class. The CTO agent can patch model assignments dynamically before waking agents via the Paperclip API.
Each agent has two definition files:
- AGENTS.md — role, responsibilities, decision authority, escalation paths, and operational rules
- SOUL.md — personality, communication style, values, and behavioral defaults
This gives agents consistent, predictable identities across long-running sessions and multi-agent collaborations.
Agents emit structured heartbeat signals during execution. These signals carry task state, confidence levels, and dependency flags. Other agents and the control plane use heartbeats to coordinate sequencing, detect stalls, and trigger interventions without polling.
Bedlam is designed to run entirely on your own hardware. Embedded Postgres ships in the box for zero-config local runs. Docker Compose configs are included for containerized deployments. No cloud account required.
# Install dependencies
pnpm install
# Start with embedded database (no setup required)
pnpm devServer: http://localhost:3100
API health: http://localhost:3100/api/health
To reset the local dev database:
rm -rf data/pglite
pnpm devserver/ Express REST API and orchestration services
ui/ React + Vite board UI
cli/ CLI for setup, onboarding, and control-plane commands
packages/
db/ Drizzle schema, migrations, DB clients
shared/ Shared types, constants, validators, API path constants
adapters/ Agent adapter implementations (Claude, Codex, Cursor, Gemini, etc.)
plugins/ Plugin system packages
doc/ Operational and product docs
docs/ Public documentation (Mintlify)
skills/ Reusable agent skill definitions
Define your agent team in the skills/ directory. Each agent gets:
AGENTS.md — operational definition:
# CEO Agent
## Role
Sets company direction, approves major decisions, manages the executive team.
## Responsibilities
- Review and approve strategic plans
- Unblock agents with conflicting priorities
- Escalate budget overruns to human operator
## Decision Authority
- Can approve tasks up to $50 budget
- Cannot modify core architecture without human approvalSOUL.md — behavioral definition:
# CEO Soul
Direct and decisive. Communicates in short, clear sentences.
Prioritizes clarity over completeness. Pushes back on scope creep.
Values execution speed over perfection on reversible decisions.# Standard deployment
docker compose -f docker/docker-compose.yml up
# Quickstart (single command)
docker compose -f docker/docker-compose.quickstart.yml upSee doc/DOCKER.md for full deployment options.
Bedlam uses a three-tier routing model:
| Tier | Models | Use For |
|---|---|---|
| Design | Opus, GPT-4.5 | Architecture, strategy, complex reasoning |
| Execution | Sonnet | Standard task execution, code, analysis |
| Mechanical | Haiku | Formatting, classification, repetitive transforms |
Configure adapters in packages/adapters/. The dynamic routing layer selects tier based on task metadata before agent execution begins.
See CONTRIBUTING.md and AGENTS.md for contribution guidelines and repo conventions.
Bedlam is the internal agent orchestration platform used to build Ancilis — agent compliance intelligence for enterprise AI deployments. The Ancilis engineering team runs a 16-agent Bedlam deployment to develop the platform, with the enhancements in this repo developed and battle-tested in that context.
Bedlam is a fork of Paperclip, originally created by Dotta.
Upstream Paperclip is an open-source agent orchestration platform. Bedlam preserves all original Paperclip functionality and adds the enhancements described above. Bug fixes and non-breaking improvements from upstream may be merged periodically.
Apache 2.0 — see LICENSE.
Bedlam additions and enhancements are Copyright (c) 2026 Ancilis, Inc., licensed under Apache 2.0. Upstream Paperclip portions remain under the original MIT License. Both notices are included in LICENSE.