Save Session State • AI Agent SDK
save_session_state: Persist team session state for deterministic resume (Issue #3635).
save_session_state
Method
</div>
This is a method of the AgentTeam class in the agents module.
Persist team session state for deterministic resume (Issue #3635).
Writes the shared team `_state (plus run bookkeeping) to the durable, project-scoped SessionStore — the same store single Agent resume uses — keyed deterministically by session_id. This gives multi-agent runs the same locked, atomic, memory-independent continuity as a single agent: it works even with memory=False`.
`shared_memory` is kept as an optional enrichment (not a gate) so legacy semantic-recall lookups still find the state when memory is on.
Returns `True when the durable write succeeded, False` otherwise, so callers can tell whether a resumable state actually reached disk.
Signature
def save_session_state(session_id: str, include_memory: bool) -> boolParameters
strNo description available.
boolNo description available.
Returns
boolThe result of the operation.
Uses
update_session_metadataget_default_session_storelogger.warningstore_short_termlogger.debug
Source
View on GitHubpraisonaiagents/agents/agents.py at line 3358