Skip to main content
Demonstrates team response performance with memory enabled.
The source creates a streaming Team.arun() async generator and returns without consuming it. The team never runs, so the memory-growth result is invalid. Update the saved file before running.
team_response_with_memory_simple.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run PgVector

5

Consume the team stream

Replace the _ = team.arun(...) block with async for _ in team.arun(...): pass. Preserve the existing arguments and indent pass inside the loop.
6

Run the example

Save the code above as team_response_with_memory_simple.py, then run:
Full source: cookbook/09_evals/performance/team_response_with_memory_simple.py