How Baton Works

A simple relay pattern for agent-to-agent communication.

The relay pattern

Baton uses a pass-and-catch model. Agent A finishes its work and passes a context package to Baton. Baton stores it behind a URL. Agent B fetches that URL to receive everything it needs to continue.

There's no direct connection between agents. They don't need to share a runtime, framework, or even the same AI model. The only contract is the HTTP API.

What gets passed

A baton contains four optional fields:

  • task — What the next agent should do.
  • output — The result from the previous agent.
  • context — Any additional metadata or history.
  • constraints — Rules or boundaries for the next agent.

Why not direct calls?

Direct agent-to-agent calls create tight coupling. If Agent B changes its interface, Agent A breaks. If they use different frameworks, integration is painful. Baton decouples them behind a stable, framework-agnostic API.