Templates Overview

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-pipeline

Every 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

KindWhat it isCost profile
LLMReasoning agent — prompt + model + enforced JSON yields, with deterministic post-processingLLM tokens
ProgrammaticPure Python — ledgers, math, schedulers, scoring. No LLM callNear zero
HumanA real person as a mesh node (Studio inbox, Slack, webhook) — work is routed to them by can_call conditions, with a timeoutHuman 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_call back-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 the mesh.max_chain_events cap (default 50) and the session is stopped with ChainCapExceeded. The templates bound their loops with a per-session exhaustion counter

Template Catalog

TemplateAgentsCore flowHeadline value
[sales-orchestration](sales-and-revenue)12lead → enrich → score → route → nurtureZero leads die in the gaps
[bd-proposals](sales-and-revenue)12scout/ingest → extract → draft → complyWin more RFPs, find more
[quote-to-cash](sales-and-revenue)14RFQ → COGS → discount → approve → quoteMargin protection as code
[marketing-ops](sales-and-revenue)15brief → strategy → create → comply → attributeGated pipeline + AI-search visibility
[customer-success](customer-operations)16sweep → score → risk → playbook → saveChurn caught months early
[customer-support](customer-operations)14intake → triage → KB → QA gate → replyRoutine 70% self-resolves
[engineering-sdlc](engineering-and-infrastructure)14spec → build → test ∥ security → reviewSeniors only where it counts
[infra-cost-ops](engineering-and-infrastructure)9anomaly → right-size → compliance veto → tuneSavings without violations
[finance-ops](finance-and-procurement)17extract → match ∥ recon ∥ fraud → route → postAudit-proof AP at machine speed
[procurement-ops](finance-and-procurement)11order → inventory → supplier → PO → receiptBig-company controls, small team
[production-planning](manufacturing-and-supply-chain)14demand → capacity → schedule → releaseRoutine re-plans self-release
[quality-yield](manufacturing-and-supply-chain)10inspect → classify → root-cause → CAPARecall = checklist, not panic
[predictive-maintenance](manufacturing-and-supply-chain)11sense → predict → schedule → parts → fixBeat the part-vs-failure race
[warehouse-supply-chain](manufacturing-and-supply-chain)16allocate → pick → pack → shipCarrier savings, shrink found
[services-delivery](people-and-services)18brief → research → draft → QA → reviewMargin and capacity per hour
[recruiting-ops](people-and-services)13source → screen → interview → offerFaster hires, measurable fairness
[bench-management](people-and-services)11forecast → match → allocate → reskillUtilisation points = real money
_inspire (default)8greet → process → research → adviseEvery 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_agent shows the full pattern set: SQLite ledger, record/report modes, threshold escalation, fail-safe returns

Copy from _inspire when building custom meshes.

Next Steps

  1. Quick Start — scaffold and run a mesh in 5 minutes
  2. Cloud Deploy — push any template to AWS, Azure, or GCP with one command
  3. Mesh Architecture — how peer-to-peer agent teams work
  4. Human Agents — configuring the people in the mesh

LeafMesh — YAML-native multi-agent orchestration platform

Last updated: 11/10/2026