Architecture / MVP

Overview

The components of Convoy, what each owns, what talks to what, and the path a convoy run takes from your terminal to a running agent.

View .md

Convoy has three programs and one language. The convoy CLI validates files and calls the server. The convoyd server holds all state and runs the control loop. A Python runner process, one per agent, wraps an agent SDK. The DSL package, dsl, is shared by the CLI and the server, so a file that validates on your laptop validates on the server with the same code.

Trace a flow
convoyd · Go runner processes · Python · one per agent REST + SSE spawn · kill MCP · wake convoy CLI goal · validate · run · watch · say API server REST · SSE · MCP Message board topics · cursors · wake Controller reconcile · budget State store SQLite · event log proc.Backend Create · Exec · Destroy researcher ×4 claude_agent_sdk writer openai_agents critic claude_agent_sdk overseer built in · 1 per swarm
Pick a flowEvery change goes through the API. The CLI, the runners and the overseer all use the same endpoints.
Fig. 1 The CLI talks only to convoyd. Every runner, the overseer included, calls back into convoyd through the same MCP tools and the same long-poll endpoint.

The parts

PartWhat it doesMVP choice
convoy CLIGenerates swarm files from a goal, validates them, sends them, shows statusGo, single binary
API serverHolds every swarm, agent, topic and message. The only way anything changesGo, REST plus SSE, plus an MCP endpoint for agents
State storeAgent specs and status, an append-only event log, the messagesSQLite
ControllerEvery few seconds and on every event, compares what is running with what is declared, then starts or stops agents and enforces limits and the budgetGo
Message boardTopics as append-only logs, one read cursor per agent per topic, messages optionally addressed to one agentTables in the state store, streamed to convoy watch over SSE
RunnerOne process per agent. Runs the SDK session, waits on the server between turns, reports each turn’s token usagePython, one driver per SDK
OverseerA built-in agent that reads the board, judges progress against the goal, and creates, stops or instructs agentsA runner with a fixed prompt, started by convoyd
DSLParsing, decoding, for_each expansion, references, validation, the dependency graph, provider type manifests and the three built-in types, the bundle formatGo packages, HCL via hcl/v2

What talks to what

FromToHow
CLIconvoydHTTP under /v1, JSON bodies, SSE for watch. Types and client in the public api package
convoydrunnerStarts a process through the process backend; writes start.json into its work folder; sends stop through the wake response, then SIGTERM
runnerconvoydREST for wake, GET /agents, GET /topics
model (inside the SDK)convoydMCP over Streamable HTTP at /v1/swarms/{name}/mcp
controllerboardPublishes to system; signals stop to a blocked wake
controller, handlersstoreTransactions that write state and events together
overseerconvoydThe same MCP tools as any agent, plus note_progress

Two rules follow. The CLI and the runners never talk to each other. And no component reaches into another’s internals: every meeting point is a public Go package or a versioned wire contract, listed on Seams and contracts.

A convoy run, end to end

The CLI validates and bundles

convoy run loads the folder with the dsl package and validates it. It then builds a bundle: every .cvy file, every file named by file(), and the non-secret env() values. API keys are never read or sent.

JSON
{
  "format_version": 1,
  "files": {"main.cvy": "...", "prompts/writer.md": "..."},
  "env": {}
}

PUT /v1/swarms/{name}

The CLI sends the bundle. The server checks the format version, loads the bundle with the same dsl code, and runs its own checks: the name matches, no run of this swarm is active (swarm_active), an overseer is declared or defaulted (overseer_missing), every provider key variable is set in convoyd’s environment (missing_env), and every model has a price when a budget is set (unpriced_model). Provider types that are not built in are resolved first, from convoyd’s store or their git repository, and a driver plugin is started once in check mode (provider_check_failed); the run records the version and digest of each.

HTTP
PUT /v1/swarms/edge_chips HTTP/1.1
Authorization: Bearer <token>

One transaction creates the run

The server inserts a run with the next number and status pending, one agents row per instance (also pending), the declared topics plus progress and system, and the overseer’s row. It emits run.created and answers 201 with the run number and the agent list.

JSON
{"name": "edge_chips", "run": 1, "status": "pending", "agents": ["..."]}

The controller starts the run

On its next pass the controller sets the run running, emits run.started, and posts swarm started to system. It starts the overseer first, then every agent whose inputs and depends_on are satisfied, as long as fewer than --max-processes runners are alive. For each: mint a token, build start.json, create the work folder, exec the runner.

Text
.convoy/work/edge_chips/1/researcher__nvidia__/start.json

Runners turn, wake, and call tools

Each runner reads start.json, builds its system prompt, and runs the first turn. The model calls swarm tools over MCP: publish, read_topic, report_progress, finish. When the turn ends the runner calls wake with the turn’s usage. The server prices the turn, adds it to the run’s spend, and holds the call until the board has news, a stop, or 30 seconds pass.

HTTP
POST /v1/swarms/edge_chips/agents/writer/wake

The run ends

After every event the controller checks the budget, max_runtime and done_when. When one fires, it stops every agent through the stop sequence, keeps all outputs, and emits run.ended. The CLI, which exited long ago, can read the result with convoy status.

Terminal
$ convoy status edge_chips

Meanwhile convoy watch holds one SSE connection to GET /v1/swarms/{name}/watch. It receives the same ordered event log the controller reads, so the terminal view needs no polling.

Repository and processes

One repository and one Go module hold everything, laid out so each component can later move out. See Repository layout. For the server’s internals, see convoyd.

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