Skip to main content
Test SSE stream reconnection for team runs using background=True, stream=True. The team runs in a detached task that survives client disconnections. Events are buffered so the client can reconnect via /resume and catch up on missed events.

Prerequisites

Install uv and Docker before running the example. The companion AgentOS server registers a team with persistent Postgres storage at http://localhost:7777.

Run the Example

1

Clone Agno

2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

5

Run PgVector

6

Start AgentOS

Start the server in the current terminal:
7

Run the client

In a second terminal, activate the same virtual environment from the repository root and run:
Full source: cookbook/05_agent_os/client/11_team_sse_reconnect.py