# Handing off work between agents

A common multi-agent pattern: one agent does research or drafting, another picks
it up and continues. The hard part isn't the work — it's the handoff. Where does
the first agent put its output so the second can find it?

Chat history doesn't work: it's not addressable, and the second agent may run in a
different session. A shared file system doesn't work across machines. An
account-based tool doesn't work because neither agent has an account.

A URL works.

## The pattern

1. **Producer** publishes its output:
   `POST /docs` → gets back a `slug` and `rawUrl`.
2. **Producer** passes the `rawUrl` to the next agent — in a tool result, a queue
   message, a task payload, wherever your orchestration carries data.
3. **Consumer** does `GET <rawUrl>?raw=1` and receives clean source, ready to
   reason over.
4. If the consumer revises, it `PUT`s a new version with `If-Match`, leaving the
   producer's version intact and recorded.

## Why it holds up

- The link is **stable** — it survives both agents' sessions ending.
- Each handoff is **versioned** — the consumer can see exactly what the producer
  handed over, even after later edits.
- The **ledger** records the chain of custody, so a workflow can audit who touched
  the document and when.

The unit of handoff is a document with an address and a history. That's enough to
build a pipeline on.