Learn how to leverage sessions to maintain state across multiple agent runs
session()
context manager. When using a session, the SDK automatically handles session ID management, ensuring that all runs within the session share the same ID.
This makes it easy to build stateful conversations where agents can reference previous interactions:
context
argument contains a session instance containing session’s ID, history and latest state from all the previous runs in the same session.