Skip to content

Agent Quickstart

What you’ll learn: How to go from zero to a running multi-agent org in 3 commands — templates, ORG.md structure, MCP tool usage, error recovery, and the boot sequence protocol.

You are an AI agent that needs to coordinate other agents. OpenSpawn gives you an org chart, task routing, escalation protocols, and a credit system — defined in a single markdown file called ORG.md.

The core idea: One file defines your entire agent organization. Everything else — the CLI, the coordinator, the dashboard — exists to execute what’s in the ORG.md.

Terminal window
openspawn init my-org --template=saas-onboarding --yes
cd my-org
openspawn start

That’s it. The Python API boots with SQLite, seeds agents from your ORG.md, and spawns Claude Code CLI subprocesses for each agent. You now have an Onboarding Lead, Data Migration Specialist, Integration Engineer, and Success Agent — coordinated and visible in the dashboard.

Q: Do I need API keys?

  • No. Demo/simulation mode works out of the box with zero configuration.

Q: What just happened?

  • init scaffolded ORG.md (your org definition), agent workspaces, and config
  • start booted the FastAPI server, seeded agents into SQLite, and started the asyncio scheduler for background jobs (SLA monitoring, escalation, status sync)

Q: What prerequisites do I need?

  • Node.js 18+, Python 3.12+, and uv (Python package manager)
  • No Docker needed for local development

Seven industry templates ship with OpenSpawn. Each produces a complete ORG.md you can use immediately or customize.

Terminal window
# SaaS customer onboarding pipeline
openspawn init my-org --template=saas-onboarding
# DevOps incident response team
openspawn init my-org --template=incident-response
# Legal contract review pipeline
openspawn init my-org --template=contract-review
# Fintech compliance monitoring
openspawn init my-org --template=compliance-monitoring
# Gaming live operations team
openspawn init my-org --template=game-live-ops
# E-commerce catalog management
openspawn init my-org --template=catalog-management
# Healthcare clinical trial processing
openspawn init my-org --template=clinical-trials

Q: Which template should I use?

What's your domain?
├── Customer success / onboarding → saas-onboarding
├── Infrastructure / reliability → incident-response
├── Legal / compliance → contract-review or compliance-monitoring
├── Gaming / live service → game-live-ops
├── E-commerce / retail → catalog-management
└── Healthcare / life sciences → clinical-trials

Q: Can I combine templates?

  • Yes. Pick one as a starting point, then add agents from other templates into the Structure section of your ORG.md.

Q: Can I create agents not in any template?

  • Absolutely. Templates are starting points. Add any agent to the ## Structure section with a name, level, domain, and reporting line.

Your entire org lives in one file. Five sections, all optional except Structure:

# SaaS Onboarding Org
## Identity
Mission, industry context, pain solved.
Becomes ambient context for every agent.
## Culture
preset: agency
Communication norms, escalation speed, progress frequency.
## Structure
### Onboarding Lead — Customer Onboarding Manager
The quarterback. Owns customer relationships from contract to go-live.
- **Level:** 7
- **Department:** Customer Success
- **Reports to:** Human Principal
#### Data Migration Specialist — Senior Data Engineer
Ingests and validates customer data from source systems.
- **Level:** 5
- **Department:** Engineering
- **Reports to:** Onboarding Lead
## Policies
Budget limits, permission guardrails, human approval thresholds.
## Playbooks
Step-by-step procedures for standard scenarios and escalations.

Q: What’s the minimum viable ORG.md?

# My Org
## Structure
### Boss — Leader
- **Level:** 10
- **Reports to:** Human Principal

Q: What do levels mean?

  • L1-L5: Workers. Execute tasks.
  • L6: Can review and approve work.
  • L7-L9: Can create tasks and spawn agents. Department leads.
  • L10: Executive. Top of the hierarchy.

Q: What’s “Reports to”?

  • Defines the escalation chain. When an agent is blocked, it escalates to whoever it reports to. Never skip the chain.

ORG.md is validated automatically when openspawn start boots the API. The seeder parses your org definition, checks hierarchy consistency, and reports errors before spawning agents.

Common validation errors:

ErrorFix
Missing Structure sectionAdd ## Structure with at least one agent
Agent reports to unknown agentCheck Reports to matches an existing agent name
No top-level agentOne agent must have Reports to: Human Principal

Instead of configuring every communication parameter, use a preset:

## Culture
preset: agency
PresetBest forEscalationProgress updates
startupSmall fast teamsImmediateFrequent
enterpriseLarge orgs with processBatched (hourly)On phase change
agencyClient work with deadlinesImmediateEvery tick
researchExploration, long tasksDelayedOn request
militaryZero-ambiguity operationsImmediateEvery tick
remote-asyncDistributed, async teamsDelayedOn request

Q: Can I override specific settings in a preset?

  • Yes. Add overrides after the preset line:
## Culture
preset: agency
- **Escalation:** batched
- **Ack required:** no

Agents communicate with OpenSpawn through MCP tools at POST /mcp:

Terminal window
# List all agents
agent_list
# Create a task (e.g., onboard a new customer)
task_create { title: "Onboard Acme Corp", priority: "high", assigneeId: "onboarding-lead" }
# Check your balance
credits_balance
# Escalate a blocker
escalation_create { taskId: "task-123", reason: "migration blocked", targetAgentId: "onboarding-lead" }
# Send a structured message
message_send { channelId: "chan-1", body: "Migration complete for Acme Corp. 1.2M rows verified.", type: "handoff" }

Q: How do I authenticate?

  • HMAC authentication. Set AGENT_ID and AGENT_SECRET environment variables. The MCP client handles the rest.

Q: What’s the full tool list?

  • See docs/llms.txt for every tool with all parameters.

The coordination tools give agents a shared task board backed by SQLite. Here’s the core workflow:

tool: task_create { title: "Migrate Acme Corp database", priority: "high", assign_to: "data-migration-specialist" }
tool: task_claim { task_id: "abc123", agent_id: "data-migration-specialist" }

Q: Can two agents claim the same task? No. task_claim is atomic — only one agent wins, the other gets an error. This prevents duplicate work.

tool: task_complete { task_id: "abc123", result: "1.2M rows migrated, checksum verified", artifacts: ["migration-report.md"] }
tool: task_list { status: "open", priority: "high" }
tool: escalation_create { issue: "source database connection refused", severity: "high", to_agent: "onboarding-lead" }
tool: org_status

Returns a full overview: all agents, task counts, budget status.

Q: How do agents coordinate work? Via coordination tools. task_create assigns work, task_claim prevents duplicate effort, task_complete records results. message_send handles structured communication (TASK/RESULT/ESCALATION/DECISION types).

Q: Where’s the full tool reference? See docs/llms.txt — the “Coordination Tools” section lists all 14 tools with parameters.


1. task_create { title: "...", assigneeId: "specialist-id" }
2. Specialist receives task → auto-ACKs (👍)
3. Specialist logs progress to task activity
4. Specialist completes → task_transition { id: "...", status: "done" }
5. You get a completion notification
1. escalation_list → see pending escalations
2. Read the reason and task details
3. Either: resolve it, reassign the task, or escalate further
4. escalation_resolve { escalationId: "...", resolution: "Engaged engineering support, ETA 2 hours" }
1. consensus_request { taskId: "...", question: "Proceed with live migration?", voterIds: ["agent-a", "agent-b"] }
2. Each voter: consensus_vote { consensusId: "...", vote: "approve" }
3. consensus_status { consensusId: "..." } → see result

You seeFix
Cannot read ORG.mdCheck the file exists in the current directory and is valid markdown
Port 8787 already in uselsof -i :8787 then kill the process, or use --port 9000
Unknown template: fooValid templates: saas-onboarding, incident-response, contract-review, compliance-monitoring, game-live-ops, catalog-management, clinical-trials
Agent reports to unknown agentCheck the Reports to field matches an existing agent name exactly
HMAC authentication failedVerify AGENT_ID and AGENT_SECRET env vars match the API config
uv not foundInstall uv: curl -LsSf https://astral.sh/uv/install.sh | sh

When openspawn start boots your org, the API seeds agents from ORG.md into SQLite, then spawns Claude Code CLI subprocesses (with a configurable concurrency cap). The lead agent follows a planning-first boot sequence:

1. Read ORG.md → understand mission, team, constraints
2. Read PLAN.md → check if resuming a previous run
3. Write PLAN.md → break mission into phased tasks with assignments
4. Create tasks → task_create via MCP for current-phase items
5. Monitor → org_status every 5 minutes
6. Adapt → update PLAN.md when things change
7. Complete → escalate "mission complete" when done

Example for a SaaS onboarding org: The Onboarding Lead reads the ORG.md, sees the 48-hour track playbook, writes PLAN.md with phases (Migration, Integration, Config, Go-Live), creates tasks for each specialist, and monitors via org_status until the customer completes their first workflow.

Q: Why planning first? Plans are cheaper than confusion. A 30-second PLAN.md prevents hours of rework, wasted tokens, and “what did you mean?” messages.

Q: What goes in PLAN.md?

  • Mission statement (from ORG.md)
  • Phase breakdown (what order to build)
  • Task table with assignments, priorities, dependencies, and status
  • Success criteria and definition of done

Q: How do workers know what to do? Workers read PLAN.md on startup, then claim their assigned tasks via task_claim. They don’t wait for chat messages — the plan IS the assignment.

Q: What if the plan needs to change? The lead updates PLAN.md first, then updates MCP tasks to match. PLAN.md is always the source of truth.

See templates/boot-sequence.md for the full protocol, templates/SOUL-lead.md for the lead agent template, and templates/SOUL-worker.md for the worker template.