interaction_id; the next turn references it via previous_interaction_id so only the new user message is sent on the wire. The server already has the prior research and its citations.
Persisting the interaction ID requires a database. The assistant message stores it under provider_data, and the next turn reads it back.
Code
deep_research_multi_turn.py
Usage
1
Set up your virtual environment
2
Set your API key
3
Install dependencies
4
Run Agent
Save the code above as
deep_research_multi_turn.py, then run: