> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Save Session State • AI Agent SDK

> save_session_state: Persist team session state for deterministic resume (Issue #3635).

# save\_session\_state

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AgentTeam**](../classes/AgentTeam) class in the [**agents**](../modules/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

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def save_session_state(session_id: str, include_memory: bool) -> bool
```

## Parameters

<ParamField query="session_id" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="include_memory" type="bool" required={false} default="True">
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  The result of the operation.
</ResponseField>

## Uses

* `update_session_metadata`
* `get_default_session_store`
* `logger.warning`
* `store_short_term`
* `logger.debug`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agents/agents.py#L2742">
  `praisonaiagents/agents/agents.py` at line 2742
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Session Management" icon="clock" href="/docs/docs/concepts/session-management" />

  <Card title="Sessions Feature" icon="folder" href="/docs/docs/features/sessions" />

  <Card title="Session Persistence" icon="database" href="/docs/docs/features/session-persistence" />
</CardGroup>
