Agent swarms are infrastructure.
Declare them.

Convoy is a language, a runtime and an orchestrator in one. Describe a team of agents in HCL: who they are, how they talk, what they depend on, who may spawn, what it may cost. convoyd runs it for hours or days, until the goal is met or a limit is hit.

From Terraform
HCL, a CLI, and references that form a graph
From Kubernetes
A server whose API is the only way to change state, and a control loop
main.cvy excerpt
swarm "edge_chips" {
  goal         = "Ship a sourced 10-page market report"
  done_when    = agent.critic.output.approved == true
  max_runtime  = "4h"
  max_cost_usd = 60
}

agent "researcher" {
  for_each = toset(["nvidia", "groq", "cerebras", "tenstorrent"])
  model    = "claude-sonnet-5"
  writes   = [topic.findings]
}

agent "writer" {
  depends_on = [agent.researcher]
  writes     = [topic.drafts]
  watches    = [topic.review]
}
$ convoy run swarm "edge_chips" accepted: run 1, 7 agents pending
01The problem

Today's harnesses are built for one person in one session.

Need more than one agent? You either type "launch a sub-agent" into a chat and hope, or you hand-write Python against an agent SDK, and your script becomes the orchestrator. Add Temporal for durability and you now run two systems that know nothing about each other. Coordination, budgets and oversight are still yours to build.

Type “launch a sub-agent” and hope.

claude · one terminal
> Research the four edge-chip vendors in parallel,
  then write a 10-page report and have a critic
  review it until it's good.

⏺ I'll launch 4 sub-agents to research each vendor.
  Task(research nvidia)       ⎿ done · 41k tokens
  Task(research groq)         ⎿ done · 38k tokens
  Task(research cerebras)     ⎿ running…
  Task(research tenstorrent)  ⎿ running…

  ⚠ Context 91% full · auto-compacting
  ⚠ Session ends when this terminal closes
  • The plan is English in a chat box, not a spec you can review, diff or rerun.
  • Sub-agents live inside one context window and die with the session.
  • No budget, no runtime limit, no way for agents to talk to each other.

The harness and the orchestrator should not be separate things. Long-horizon swarms need one runtime with native primitives for topics, messages and spawning, and a declarative form you can read, review and rerun.

Language

HCL with four blocks: swarm, provider, topic, agent. A solo agent and a twelve-agent team are the same kind of file.

Runtime

convoyd holds every swarm, agent, topic and message. One runner process per agent; idle agents cost nothing.

Orchestrator

A controller enforces what can be computed. An overseer judges what can't. Both act through the same API.

02See it run

One file in, a working team out.

This is the market-report swarm from the docs, simulated. Four researchers fan out, the writer waits on their outputs, and the writer and critic loop through the board until done_when is true. Hover a block to see what it becomes. Switch scenarios to watch the overseer step in, or the budget stop everything.

Scenario
main.cvy hover a block
swarm "edge_chips" {
  goal         = "Ship a sourced 10-page market report"
  done_when    = agent.critic.output.approved == true
  max_runtime  = "4h"
  max_cost_usd = 60
  overseer     = { provider = provider.anthropic, model = "claude-sonnet-5" }
}
topic "findings" { description = "One sourced fact per message" }
topic "drafts"   { description = "Report drafts, newest wins" }
topic "review"   { description = "Critic feedback on drafts" }
agent "researcher" {
  for_each  = toset(["nvidia", "groq", "cerebras", "tenstorrent"])
  provider  = provider.anthropic
  model     = "claude-sonnet-5"
  prompt    = file("prompts/research.md")
  vars      = { vendor = each.key }
  tools     = ["web_search", "bash"]
  writes    = [topic.findings]
}
agent "writer" {
  provider = provider.openai
  model    = "gpt-6.1-sol"
  prompt   = file("prompts/writer.md")
  inputs   = { findings = values(agent.researcher)[*].output }
  writes   = [topic.drafts]
  watches  = [topic.review]
}
agent "critic" {
  provider = provider.anthropic
  model    = "claude-opus-5"
  prompt   = file("prompts/critic.md")
  watches  = [topic.drafts]
  writes   = [topic.review]
  output   = { approved = bool, score = number }
}
graph edge = inputs topic = writes / watches inputs #findings 0 #drafts 0 #review 0 researcher[nvidia] pending researcher[groq] pending researcher[cerebras] pending researcher[tenstorrent] pending writer pending critic pending overseer pending researcher_patents pending built in · reads the board spawned by overseer
Elapsed00:00 / 4h
Spend$0.00 / $60
done_whenfalse
RUN 1 · PENDING
$ convoy watch edge_chips
    Pending Running · in a turn Idle · waiting, costs nothing Stuck · silent 20m Done Message on the board
    03Primitives

    The swarm is in the language, not in the prompt.

    Everything a multi-agent system needs to coordinate is a declared, validated, server-enforced construct.

    01

    Topics & messages

    A shared board. Agents declare what they write and what wakes them. Cursors per agent per topic.

    writes  = [topic.drafts]
    watches = [topic.review]
    02

    An overseer, declared

    A built-in agent judges progress, redirects stuck agents and adds new ones. Its model, and whether it may spawn, are in the file.

    overseer = {
      provider  = provider.anthropic
      model     = "claude-opus-5"
      can_spawn = true
    }
    03

    Dependency graph

    An agent starts when the agents it reads from finish. Cycles are a validate error.

    inputs = { plan = agent.lead.output }
    04

    Typed outputs

    finish() is checked against a declared shape. done_when is code over that output.

    output    = { approved = bool, score = number }
    done_when = agent.critic.output.approved
    05

    Spawning, declared

    Who may grow the team is in the file. A child can only use what its parent has.

    can_spawn = true   # default false
    06

    Budgets & limits

    A dollar cap across every agent and the overseer. Runtime, turn and process limits.

    max_cost_usd = 60
    max_runtime  = "4h"
    max_turns    = 40
    07

    An overseer

    A built-in agent that judges progress, redirects stuck agents and fills missing roles.

    overseer = {
      provider = provider.anthropic
      model    = "claude-sonnet-5"
    }
    08

    Any provider

    Claude Agent SDK, OpenAI Agents SDK, or any OpenAI-compatible endpoint. Same swarm tools via MCP.

    source   = "openai_compatible"
    base_url = "http://localhost:11434/v1"
    04Orchestration

    Two loops: one computes, one judges.

    Like a Kubernetes controller, convoyd keeps what is running matching what was declared. Decisions that need judgment go to the overseer, an agent with limited, logged powers.

    OVERSEER · LLM · EVERY 5 MIN + ON EVENTS · READ BOARD → JUDGE → INSTRUCT · SPAWN CONTROLLER · CODE · EVERY 5 S · OBSERVE → COMPARE → ACT main.cvy declared spec
    An event happens. Who handles it?
    05Compared

    Why a new harness, not another wrapper.

    Honest about where Convoy stands today: durability across crashes is designed in but ships after the MVP.

    One sessionClaude Code, CodexSDK + Pythonyour scriptSDK + Temporalworkflow engineConvoydeclared swarm
    Declarative spec you can diff, review and rerun a chat prompt code code .cvy files
    Multi-agent as a primitive in-session sub-agents hand-built hand-built agents and a dependency graph
    Agents message each other hand-built queues activities are opaque topics, cursors, addressing
    Spawning new agents asked for in English your code your code can_spawn, bounded by parent
    Dollar budget across the team hand-built hand-built max_cost_usd, enforced
    Keeps running when you close the laptop if you deploy it yes convoyd holds state
    Survives process crashes yes post-MVP: session resume
    Mix providers in one team one vendor per SDK per SDK 3 SDKs, one MCP surface
    Someone watching progress you you you stuck detection + overseer

    built in partial or hand-built not available

    06The CLI

    Goal to running swarm in four commands.

    The convoy CLI never holds state. It works on the files in your folder or calls the convoyd API, so a swarm keeps running after the terminal closes.

    ~/reports/edge_chips
    $ convoy goal --provider anthropic --model claude-opus-5 \ "Write a sourced 10-page market report on edge inference chips" wrote ./main.cvy (7 agents, 4 topics) wrote ./prompts/*.md validate: ok agents researcher[nvidia, groq, cerebras, tenstorrent] -> writer <-> critic topics findings, drafts, review, human
    07Examples

    Three swarms to run now. Five more shaped after benchmarks.

    Each is a complete convoy run target. The first three need one API key, Anthropic or OpenAI, and nothing else.

    Write the file.
    Run the swarm.

    # start convoyd with one API key, then
    $ cd examples/writer_critic
    $ convoy run
    $ convoy watch writer_critic
    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