Templates Overview
LeafMesh ships 20 ready-made teams, with 263 agents (AI agents, human seats and code steps), 291 entry points and 31 scheduled wake-ups: complete, ready-to-run agent teams for real business functions. Each template is a team of agents, not a fixed pipeline: wires are conditional, workflows can start from any of multiple entry points, and the Manager composes the team for each request.
pip install create-leafmesh
create-leafmesh --list # see all templates
create-leafmesh --describe sales-orchestration # details for one
create-leafmesh my-pipeline --template sales-orchestration
cd my-pipelineEvery template scaffolds a complete project: agency/ with working agent
implementations, main.py, Docker files and a .env. There is no
configuration file (2.4.498+): create-leafmesh --start loads the team into
the agency's store on the first start, only if the store is empty, and you
change it in Studio from then on.
The Three Agent Kinds
| Kind | What it is | Cost profile |
|---|---|---|
| LLM | Reasoning agent — prompt + model + enforced JSON yields, with deterministic post-processing | LLM tokens |
| Programmatic | Pure Python — ledgers, math, schedulers, scoring. No LLM call | Near zero |
| Human | A real person as a mesh node (Studio inbox, Slack, webhook) — work is routed to them by can_call conditions, with a timeout | Human time |
The mix matters: templates put LLM agents where judgment is needed, programmatic agents where determinism is needed (money routing, ledgers, compliance math), and humans where accountability is needed.
One Role, Multiple Responsibilities
Every agent in a template is a role you could hire — an agent is a person, not a function call. Its prompt sections, module functions, and crons are that person's responsibilities: the payment-risk officer runs the duplicate-ledger check and makes the fraud judgment; the recruiting-ops analyst sweeps thin funnels and keeps the time-to-hire ledger. Agents talk peer-to-peer the way colleagues do, handing work across desks rather than up and down a hierarchy. The exceptions are deliberate: controls — deterministic approval routing, QA independence, audit sinks — always stay separate agents, because the person doing the work should never be the person checking it.
Guarantees in Every Template
- Immutable audit — every decision terminates in a hash-chained, write-once audit log
- Human-in-the-loop default-deny — customer-facing and money-moving actions are always routed to a human agent first
- Multi-entry — workflows start from webhooks, schedules, channels, or manual calls
- Direct-call endpoints — every non-human agent is independently API-addressable
- Peer-to-peer mesh — agents call agents directly (including cycles); the Manager supervises rather than routing every hop
Cycles must be bounded. A
can_callback-edge (a retry loop, or a critic looping to a writer) is allowed, but if its condition can stay true forever the chain runs until it hits themesh.max_chain_eventscap (default 50) and the session is stopped withChainCapExceeded. The templates bound their loops with a per-session exhaustion counter
- a terminal route, and so should yours — there is no
once_per_sessionflag. See Coordination → Chain Cap & Bounding Cycles.
Template Catalog
| Template | Agents | Core flow | Headline value |
|---|---|---|---|
[sales-orchestration](sales-and-revenue) | 12 | lead → enrich → score → route → nurture | Zero leads die in the gaps |
[bd-proposals](sales-and-revenue) | 12 | scout/ingest → extract → draft → comply | Win more RFPs, find more |
[quote-to-cash](sales-and-revenue) | 14 | RFQ → COGS → discount → approve → quote | Margin protection as code |
[marketing-ops](sales-and-revenue) | 15 | brief → strategy → create → comply → attribute | Gated pipeline + AI-search visibility |
[customer-success](customer-operations) | 16 | sweep → score → risk → playbook → save | Churn caught months early |
[customer-support](customer-operations) | 14 | intake → triage → KB → QA gate → reply | Routine 70% self-resolves |
[engineering-sdlc](engineering-and-infrastructure) | 14 | spec → build → test ∥ security → review | Seniors only where it counts |
[infra-cost-ops](engineering-and-infrastructure) | 9 | anomaly → right-size → compliance veto → tune | Savings without violations |
[finance-ops](finance-and-procurement) | 17 | extract → match ∥ recon ∥ fraud → route → post | Audit-proof AP at machine speed |
[procurement-ops](finance-and-procurement) | 11 | order → inventory → supplier → PO → receipt | Big-company controls, small team |
[production-planning](manufacturing-and-supply-chain) | 14 | demand → capacity → schedule → release | Routine re-plans self-release |
[quality-yield](manufacturing-and-supply-chain) | 10 | inspect → classify → root-cause → CAPA | Recall = checklist, not panic |
[predictive-maintenance](manufacturing-and-supply-chain) | 11 | sense → predict → schedule → parts → fix | Beat the part-vs-failure race |
[warehouse-supply-chain](manufacturing-and-supply-chain) | 16 | allocate → pick → pack → ship | Carrier savings, shrink found |
[services-delivery](people-and-services) | 18 | brief → research → draft → QA → review | Margin and capacity per hour |
[recruiting-ops](people-and-services) | 13 | source → screen → interview → offer | Faster hires, measurable fairness |
[bench-management](people-and-services) | 11 | forecast → match → allocate → reskill | Utilisation points = real money |
_inspire (default) | 8 | greet → process → research → advise | Every core pattern, minimal form |
235 agents across the catalog — every one a role you could hire.
The Starter Template: _inspire
Running create-leafmesh my-project without --template scaffolds
_inspire — the teaching template. Its 8 agents demonstrate every
pattern the production templates use:
- HITL conversation — greeter ↔ client loop
- Fan-out / fan-in — processor dispatches to multiple researchers, advisor merges the results
- Race pattern — an LLM researcher races a programmatic fallback
- Scheduled agents — a daily status cron
- Production reference agent —
risk_scorer_agentshows the full pattern set: SQLite ledger, record/report modes, threshold escalation, fail-safe returns
Copy from _inspire when building custom meshes.
Next Steps
- Quick Start — scaffold and run a mesh in 5 minutes
- Cloud Deploy — push any template to AWS, Azure, or GCP with one command
- Mesh Architecture — how peer-to-peer agent teams work
- Human Agents — configuring the people in the mesh
LeafMesh — YAML-native multi-agent orchestration platform