Examples / MVP

Overview

Three swarms to copy and run with one API key, then five larger ones shaped after long-horizon benchmarks.

View .md

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.

ExampleShapeWhat you getWhat it teaches
writer_critictwo agents in a loopa short piece of writing, approved by a critictopics, watches and writes, typed output, done_when
research_teamparallel researchers, a writer, an editora sourced briefing in report.mdfor_each, inputs as the dependency graph, tools, a numeric done_when
code_teama planner, two coders, a reviewera tested Python package in ./workspacecount, 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):

Shell
export ANTHROPIC_API_KEY=sk-ant-...   # or: export OPENAI_API_KEY=sk-...
convoyd

Then, in another terminal:

Shell
cd examples/writer_critic
convoy run
convoy watch writer_critic    # the swarm's name is the label of its swarm block

Run 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:

HCL
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

FolderBenchmarkShapedone_when
01_paperbench_replicationPaperBenchfan-out, fan-in, then a judge loopthe judge approves
02_commit0_libraryCommit0task board with a worker pool95% of the real test suite passes
02_commit0_library/soloCommit0one agent, same budget95% of the real test suite passes
03_vending_benchVending-Bench 2self-sustaining daily loopday 365 or bankrupt
04_swe_lancer_bountySWE-Lancercompetition, pick, implement, testthe end-to-end tests pass
05_tau2_pass_k_loopτ²-benchimprovement loop, then a held-out gateheld-out pass^4 gain of 10 points

Which features each one leans on

FeatureWhere it appears
for_each over a mapPaperBench builders, τ²-bench runners
for_each over toset()Commit0 implementers
Typed, nested outputevery folder
values(agent.x)[*].outputPaperBench experimenter
depends_onPaperBench judge, SWE-Lancer QA
inputs diamondSWE-Lancer manager
can_spawn and create_agentCommit0 implementers; switched off in the solo arm
Three SDKs in one swarmVending-Bench, SWE-Lancer
Multi-file configurationVending-Bench
vars as experiment knobsτ²-bench

Conventions shared by every benchmark folder

  • Every swarm block declares its overseer = { provider, model } and a max_cost_usd. The overseer’s spend counts toward the cap. There is no max_agents; convoyd --max-processes limits concurrency.
  • api_key names an environment variable that convoyd reads from its own environment. Keys never travel in the bundle.
  • Only agents with can_spawn = true may call create_agent (Commit0’s implementers). The overseer may spawn unless its block sets can_spawn = false.
  • Agents call report_progress(summary) after each meaningful step. The overseer and convoy status read 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_agents shows. The rest becomes the YOUR JOB section of the agent’s system prompt.
  • {{name}} in a prompt is replaced from the agent’s vars. Everything else in the prompt is literal.
  • Paths the agents share (a checkout, a workspace, a runs folder) come in through env("...") inside vars. convoy run reads 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 calls finish or reaches max_turns; most of them finish in their first turn.
  • Every topic has at least one declared writer and one declared watcher, so convoy validate is clean of the unused-topic warnings.
  • Every human topic has a watcher, so convoy 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 expected TS051 warning.
  • 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 sets max_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

Shell
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.

Last updated 2026-11-05
esc
    ↑↓ to move · ↵ to open
    Menu
    Get started
    IntroductionInstallQuickstartYour first swarm
    Concepts
    Swarms and runsAgents and turnsTopics and the boardThe overseerSpawning agentsBudgets and limits
    DSL
    Language rulesswarmprovidertopicagentReferences and functionsValidation rules
    Providers
    Provider typesUsing a provider typeWriting a provider type
    CLI
    Overviewconvoy goalconvoy validateconvoy runconvoy statusconvoy watchconvoy sayconvoy stopconvoy uiconvoy provider
    Runtime
    convoydControllerMessage boardRunnerSwarm tools (MCP)Web UIDurability
    Architecture
    OverviewRepository layoutSeams and contractsHTTP API
    Examples
    OverviewWriter and criticResearch teamCode teamPaperBench replicationCommit0 libraryVending-BenchSWE-Lancer bountyτ²-bench loop
    Inspiration
    What we borrowedThe harness landscape