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]
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.
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]
} 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.
> 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 async def main():
findings = await asyncio.gather(*[
research(v) for v in ["nvidia", "groq", "cerebras", "tenstorrent"]
])
draft = await write(findings)
while True: # who bounds this loop?
review = await critique(draft)
if review.approved:
break
draft = await write(findings, review)
# retries? budget? a crash at hour 3?
# how does the critic message the writer mid-turn? @workflow.defn
class MarketReport:
@workflow.run
async def run(self) -> str:
findings = await asyncio.gather(*[
workflow.execute_activity(
research, v, start_to_close_timeout=timedelta(hours=1))
for v in VENDORS])
draft = await workflow.execute_activity(write, findings, ...)
# agents are opaque activities: they can't see each other,
# spawn helpers, or read a shared board. 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, model, prompt …
watches = [topic.drafts]
writes = [topic.review]
output = { approved = bool, score = number }
} 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.
HCL with four blocks: swarm, provider, topic, agent. A solo agent and a twelve-agent team are the same kind of file.
convoyd holds every swarm, agent, topic and message. One runner process per agent; idle agents cost nothing.
A controller enforces what can be computed. An overseer judges what can't. Both act through the same API.
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.
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" }
}swarm "edge_chips" {
goal = "Ship a sourced 10-page market report"
done_when = agent.critic.output.approved == true
max_runtime = "4h"
max_cost_usd = 18 # ← tight budget
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 }
} Everything a multi-agent system needs to coordinate is a declared, validated, server-enforced construct.
A shared board. Agents declare what they write and what wakes them. Cursors per agent per topic.
writes = [topic.drafts]
watches = [topic.review] 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
} An agent starts when the agents it reads from finish. Cycles are a validate error.
inputs = { plan = agent.lead.output } 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 Who may grow the team is in the file. A child can only use what its parent has.
can_spawn = true # default false A dollar cap across every agent and the overseer. Runtime, turn and process limits.
max_cost_usd = 60
max_runtime = "4h"
max_turns = 40 A built-in agent that judges progress, redirects stuck agents and fills missing roles.
overseer = {
provider = provider.anthropic
model = "claude-sonnet-5"
} 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" 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.
Honest about where Convoy stands today: durability across crashes is designed in but ships after the MVP.
| One sessionClaude Code, Codex | SDK + Pythonyour script | SDK + Temporalworkflow engine | Convoydeclared 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
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.
Each is a complete convoy run target. The first three need one API key, Anthropic or OpenAI, and nothing else.
done_when the critic approves Research team parallel web research → writer ⇄ editor done_when the editor scores 8 of 10 Code team planner → two coders ⇄ a reviewer running tests done_when the test suite passes done_when the judge approves Commit0 task board + worker pool, vs. one agent done_when 95% of the real test suite Vending-Bench 2 self-sustaining daily loop, three SDKs done_when day 365 or bankrupt SWE-Lancer competition → pick → implement → test done_when end-to-end tests pass τ²-bench improvement loop, then held-out gate done_when pass^4 gain of 10 points # start convoyd with one API key, then $ cd examples/writer_critic $ convoy run $ convoy watch writer_critic