Skip to main content
HttpChannel keeps the conversation on a server and reaches it with GET, POST and DELETE on one URL. Agents in different processes, or on different machines, that point at the same URL share one conversation. Reference: HttpChannel, including the server contract.

1. Start a server

Save this as channel_server.py and run it in its own terminal. It keeps each conversation in memory, keyed by the URL path.

2. Two agents in two processes

Run the Researcher in one terminal:
Then the Writer in another. It reads the task and the Researcher’s answer from the server before it runs:
Both agents run the same task, so the server holds it once. Read the conversation from anywhere:

A HierarchicalSwarm on a shared server

A director plans, workers report, and every step lands on the server, where a dashboard or another team’s agents can read it.
The server receives the task under User, the director’s plan and orders, and each worker’s report under its name.

SwarmRouter: switch architectures, keep the URL

SwarmRouter forwards the channel to the structure it builds, so changing swarm_type does not change where the conversation lives.

Authenticate

Pass headers to send with every call:
A non-2xx reply raises httpx.HTTPStatusError, so a bad token fails the first read instead of running the agent without context.

Start over

Next steps