The examples folder in the repository starts with three swarms you can copy and run. Each is one folder: a main.cvy, a Markdown prompt per agent, and a README. Each needs one API key, Anthropic or OpenAI, and nothing else.
| Example | Shape | What you get | What it teaches |
|---|---|---|---|
writer_critic | two agents in a loop | a short piece of writing, approved by a critic | topics, watches and writes, typed output, done_when |
research_team | parallel researchers, a writer, an editor | a sourced briefing in report.md | for_each, inputs as the dependency graph, tools, a numeric done_when |
code_team | a planner, two coders, a reviewer | a tested Python package in ./workspace | count, addressed messages, a done_when backed by a passing test suite |
Running one
Start convoyd with a key in its environment (install covers getting it):
export ANTHROPIC_API_KEY=sk-ant-... # or: export OPENAI_API_KEY=sk-...
convoydThen, in another terminal:
cd examples/writer_critic
convoy run
convoy watch writer_critic # the swarm's name is the label of its swarm blockRun convoy from inside the example’s folder. research_team and code_team write their results there.
Anthropic or OpenAI
Every one of the three declares a single provider, and its block carries both choices:
provider "llm" {
source = "claude_agent_sdk" # "openai_agents"
model = "claude-sonnet-5-5" # "gpt-6.1-sol"
}As written they use an Anthropic key. For an OpenAI key, change those two lines to the values in the comments. The agents inherit the provider’s model, and the tools they use (web_search, bash, read_file, write_file, edit_file) have the same names on both, so nothing else in the file changes.
Benchmark swarms
examples/benchmarks holds five larger swarms and one baseline, one per long-horizon benchmark. Each is a complete convoy run target: a main.cvy (plus other .cvy files where the sample shows merging), a prompts folder, and a README that maps the swarm to its benchmark and lists what the folder assumes about the machine. They were chosen so that each shows a different shape of the language.
The five shapes
| Folder | Benchmark | Shape | done_when |
|---|---|---|---|
01_paperbench_replication | PaperBench | fan-out, fan-in, then a judge loop | the judge approves |
02_commit0_library | Commit0 | task board with a worker pool | 95% of the real test suite passes |
02_commit0_library/solo | Commit0 | one agent, same budget | 95% of the real test suite passes |
03_vending_bench | Vending-Bench 2 | self-sustaining daily loop | day 365 or bankrupt |
04_swe_lancer_bounty | SWE-Lancer | competition, pick, implement, test | the end-to-end tests pass |
05_tau2_pass_k_loop | τ²-bench | improvement loop, then a held-out gate | held-out pass^4 gain of 10 points |
Which features each one leans on
| Feature | Where it appears |
|---|---|
for_each over a map | PaperBench builders, τ²-bench runners |
for_each over toset() | Commit0 implementers |
Typed, nested output | every folder |
values(agent.x)[*].output | PaperBench experimenter |
depends_on | PaperBench judge, SWE-Lancer QA |
inputs diamond | SWE-Lancer manager |
can_spawn and create_agent | Commit0 implementers; switched off in the solo arm |
| Three SDKs in one swarm | Vending-Bench, SWE-Lancer |
| Multi-file configuration | Vending-Bench |
vars as experiment knobs | τ²-bench |
Conventions shared by every benchmark folder
- Every
swarmblock declares itsoverseer = { provider, model }and amax_cost_usd. The overseer’s spend counts toward the cap. There is nomax_agents;convoyd --max-processeslimits concurrency. api_keynames an environment variable thatconvoydreads from its own environment. Keys never travel in the bundle.- Only agents with
can_spawn = truemay callcreate_agent(Commit0’s implementers). The overseer may spawn unless its block setscan_spawn = false. - Agents call
report_progress(summary)after each meaningful step. The overseer andconvoy statusread it. - A turn starts with an unread summary of the board. Messages addressed to the agent arrive in full; everything else the agent pulls with
read_topic. - The first line of each prompt file is the role summary that
list_agentsshows. The rest becomes the YOUR JOB section of the agent’s system prompt. {{name}}in a prompt is replaced from the agent’svars. Everything else in the prompt is literal.- Paths the agents share (a checkout, a workspace, a runs folder) come in through
env("...")insidevars.convoy runreads those variables on the laptop and ships them with the bundle; a missing one fails before anything starts. - Every agent that watches a topic has an explicit
max_turns. An agent that watches nothing takes continue turns until it callsfinishor reachesmax_turns; most of them finish in their first turn. - Every topic has at least one declared writer and one declared watcher, so
convoy validateis clean of the unused-topic warnings. - Every
humantopic has a watcher, soconvoy say <swarm> human "..." --to <agent>reaches someone. The exception is the Commit0 solo arm, whose one agent watches nothing and is reached with--to solo; it gets the one expectedTS051warning. - A provider running a local model declares
price = { input = 0, output = 0 }, since the built-in price table only knows hosted models and every swarm setsmax_cost_usd. - Model names follow the proposal’s convention (
claude-opus-5,claude-sonnet-5,gpt-6.1-sol, an Ollama tag). Each is set in its agent block.
Running any of them
cd examples/benchmarks/<folder>
convoy validate # offline; checks every rule in the validation reference
convoy run # sends the folder to convoyd
convoy watch <swarm name> # the swarm name is the label of the swarm block
convoy say <swarm name> human "<text>" --to <agent>See convoy validate, convoy run, convoy watch and convoy say. Each example page lists the environment variables and tools its folder needs.