This guide installs Convoy and runs the smallest example, writer and critic: two agents in a loop that ends when the critic approves. You need macOS or Linux, uv, and an Anthropic or OpenAI API key.
Install
The script installs two binaries: convoy, the CLI, and convoyd, the server.
curl -fsSL https://raw.githubusercontent.com/convoyharness/convoy/main/install.sh | shTo build from source instead, or to see what else convoyd needs, read install.
Start the server
convoyd holds every swarm and starts one process per agent. It reads provider keys from its own environment; a swarm names the variable and never contains the key.
export ANTHROPIC_API_KEY=sk-ant-... # or: export OPENAI_API_KEY=sk-...
convoydThe first start takes longer, about fifteen seconds on a fast connection, while uv downloads Python and the agent SDKs. Leave it running.
Get the example
In a second terminal:
git clone https://github.com/convoyharness/convoy
cd convoy/examples/writer_criticThe folder is the swarm: main.cvy and one Markdown prompt per agent. As written it uses an Anthropic key. For an OpenAI key, change the two lines of the provider block to the values in their comments:
provider "llm" {
source = "openai_agents"
model = "gpt-6.1-sol"
}Run it
convoy run validates the folder, sends it to the server, prints the run and exits. The swarm keeps running on the server.
$ convoy run
swarm "writer_critic" run 1 accepted: 3 agents pending
AGENT STATUS PROVIDER MODEL
critic pending llm claude-sonnet-5-5
overseer pending llm claude-sonnet-5-5
writer pending llm claude-sonnet-5-5
watch with: convoy watch writer_criticWatch it
convoy watch shows the agents and the message board live, and prints the result when the run ends.
$ convoy watch writer_critic
swarm writer_critic run 1 DONE elapsed 00:00:39 / 10m spend $0.10 / $1.00
AGENT STATUS TURNS PROVIDER SPEND LAST PROGRESS
critic done 3 llm $0.04 Approved the revision at 9/10
writer stopped 2 llm $0.03 Revised the draft from the critic's note
overseer stopped 2 llm $0.03
run 1 ended: DONE
result critic
approved true
score 9
final A race condition happens when a program's result depends on ...convoy ui writer_critic opens the same run in the browser: the graph, the board, and every agent’s transcript.
If the key is wrong or its account has no credit, the run ends within seconds as FAILED, and the same two commands say why:
run 1 ended: FAILED
failed critic, writer
the provider's account has no credit ("Credit balance is too low"). Add credit
to the account ANTHROPIC_API_KEY belongs to, then run the swarm again.What just happened
- The server created three agents: the two you declared and the overseer.
- Neither the writer nor the critic has
inputs, so both started at once. The critic found nothing to review and ended its turn. - The writer published a draft to
drafts. The criticwatchesthat topic, so the message gave it a turn. - The critic published its notes to
review, which woke the writer. The loop is nothing more than those twowatches. - The critic called
finishwithapproved = true.done_whenbecame true and the run ended Done, well inside its one-dollar and ten-minute limits.