# What we borrowed

> The ideas Convoy takes from Terraform, Kubernetes, and Exo, what it deliberately left behind, and how it relates to durable-execution engines.

Convoy is a new combination of old ideas. This page lists each source, the specific idea taken, and what was not taken. Where the proposal says an idea is future work, this page says so.

## Terraform

**What was taken.** The shape of the language and the tool around it.

- **HCL.** Swarms are written in HCL, parsed with hashicorp/hcl/v2, in files with the `.cvy` extension. Every `*.cvy` file in a folder is read and merged into one configuration. There are four block types: `swarm`, `provider`, `topic`, and `agent`. See [language rules](/docs/dsl/).
- **References form a graph.** A reference between blocks, such as `inputs = { plan = agent.reader.output }`, is a dependency edge. The graph decides what starts when, and cycles are rejected. The board is separate: loops between agents go through topics, not through references. See [references and functions](/docs/dsl/expressions/).
- **`count` and `for_each`.** One `agent` block can create several agents: `count = 4` makes identical workers named `worker[0]` to `worker[3]`, and `for_each` over a set or map makes one per element, named by key, such as `researcher[nvidia]`. References follow Terraform: a `count` agent is a list (`agent.worker[*].output`), and a `for_each` agent is an object keyed by instance (`values(agent.researcher)[*].output`). The language rules follow Terraform where Terraform has a rule and add agent-specific ones where it does not. See [`agent`](/docs/dsl/agent/).
- **A CLI with a validate step.** `convoy validate` checks a folder offline against every rule before anything is sent, the way `terraform validate` does. See [validation rules](/docs/dsl/validation/) and [`convoy validate`](/docs/cli/validate/).
- **Plugin-shaped extension points.** The future sandbox backends are described as separate binaries downloaded like Terraform providers. This is post-MVP.

**What was not taken.**

- **State files.** The HCL files only start a swarm. After `convoy run`, the server holds the state, and agents created at runtime exist only there. There is no state file to share or lock.
- **Plan and apply.** There is no `convoy plan`. Showing how a new run's spec differs from the last one, and writing the live swarm back out as `.cvy` files, is a future idea. Today a running swarm's spec never changes: running an active swarm again is refused, and a finished swarm starts a new run.
- **Modules and a registry.** Reusable swarm modules and a shared registry are a future idea.
- **A different meaning of `provider`.** In Convoy a `provider` block names a model SDK and a key variable, not an infrastructure plugin.

## Kubernetes

**What was taken.** The runtime model.

- **One API is the only way to change anything.** `convoyd` is a long-running server. The CLI only talks to it; agents reach it through the same API and the same MCP tools. Nothing mutates state around it. See [`convoyd`](/docs/runtime/) and the [HTTP API](/docs/architecture/api/).
- **A control loop.** The controller compares what is running with what is declared, every few seconds and on every event, then starts or stops agents and enforces limits and the budget. See [the controller](/docs/runtime/controller/).
- **Declared versus observed.** The spec says which agents exist and what they wait for. The controller observes their status (Pending, Running, Idle, Stuck, Done, Stopped, Failed) and moves them toward the declared goal. See [agents and turns](/docs/concepts/agents/).

**What was not taken.**

- **Live updates.** Kubernetes reconciles a changed spec continuously. Convoy does not: applying a changed spec to an active run is a future idea.
- **A cluster.** The MVP is one `convoyd` on one machine with SQLite behind a small store interface. Pluggable storage is a future idea.
- **Containers and pods.** Every agent is a local process behind a backend interface. Docker and remote sandbox backends are future work.
- **Kubernetes-style resources for everything.** There are four block types, and the agent count has no limit in the language; `convoyd --max-processes` protects the machine.

## Exo and Alex Krentsel's talk

Exo, and Alex Krentsel's talk about it, inspired the design but are not part of it.

The idea taken: an agent's prompt, tools, and loop are just code and text, so an agent can read and rewrite them. That only works when the core state the agent depends on, its history, checkpoints, and secrets, sits outside its reach. In Convoy that core is `convoyd`.

Exo defines agents as files, markdown with YAML front matter. Convoy does the same in HCL, which suits many agents wired together. The talk also warns that self-rewriting pays off only on repetitive work, which is why agents rewriting their own prompt, tools, and loop sits in the proposal's future ideas, waiting for a swarm that runs the same shape many times.

- Self-Improving AI Agents: Exo and the Bitter Lesson, Alex Krentsel (YouTube talk)
- [exoharness/exo](https://github.com/exoharness/exo) on GitHub

The [harness landscape](/docs/inspiration/landscape/) page summarizes how Exo compares with the other products in the field.

## Durable execution

Durability means a failure at any point leaves the run able to continue from where it was. Convoy treats it as table stakes, not the differentiator, and it is . The MVP marks the agent or the run Failed on a crash, but it stores everything recovery will need from day one: each agent's SDK session id, its read cursor on every topic, its turn count, its spend per turn, its process handle and status, and each run's spec, spend, and event log. See [durability](/docs/runtime/durability/).

The same stance shows in the landscape research. pi-durable and Exo are the strongest durable engines among the thirteen products studied, and the research found that durability by itself does not give a team a language: the clearest open gap was declaring a team in a file and having a controller converge on it.

Durable-execution engines, Temporal among them, solve the problem of resuming code after a failure. A common way to build a long-running multi-agent system today is to write the orchestration in Python against an agent SDK and then run that Python on such an engine. That works, but the harness and the orchestrator are now two systems: the engine knows workflows and activities, not agents, turns, topics or budgets, and the agents still cannot see each other. Convoy's position is that for agent swarms these should be one runtime. The differences follow from that:

- The unit Convoy declares is a team of agents with goals, topics, and budgets, not a function whose steps are replayed. Its controller and board are built around turns, wakes, and a `done_when` check against a goal.
- The recovery it plans is session resume: a new runner resumes the same SDK session by its stored id, with the work folder as it was, and the interrupted turn is retried from its input.
- Durability and the language are separate claims. The MVP claims the language and the team result first, and the durability release has its own acceptance tests (kill a runner mid-turn, kill `convoyd` mid-run, hit the budget mid-turn).

## What the docs borrow

The documentation takes its tone from three places: the superlogical Rex docs, minimal.dev, and the Stripe docs. From them it takes plain, direct sentences, one definition per term, status stated up front, and pages that stand on their own. Code sits beside the prose it explains, as in the Stripe-style steps on the [quickstart](/docs/quickstart/).
