Async Subagent Server
A self-hosted Agent Protocol server that exposes a Deep Agents researcher as an async subagent. Use this as a starting point for hosting your own agent on any infrastructure and connecting it to a Deep Agents supervisor.
The example includes both sides of the pattern:
server.py— the FastAPI server your subagent runs onsupervisor.py— an interactive REPL showing how to connect to it
Prerequisites
ANTHROPIC_API_KEY— requiredTAVILY_API_KEY— optional; stub search is used if not set
Quickstart
1. Install dependencies:
bash
cd examples/async-subagent-server
uv sync2. Set up your environment:
bash
cp .env.example .env
# fill in ANTHROPIC_API_KEY (and optionally TAVILY_API_KEY)3. Start the server:
bash
uv run uvicorn server:app --port 20244. In another terminal, start the supervisor:
bash
cd examples/async-subagent-server
ANTHROPIC_API_KEY=... uv run python supervisor.pyTry these prompts:
> research the latest developments in quantum computing