> ## 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.

# Restore State • AI Agent SDK

> restore_state: Restore session state from memory.

# restore\_state

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

> This is a method of the [**Session**](../classes/Session) class in the [**session**](../modules/session) module.

Restore session state from memory.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def restore_state() -> Dict[str, Any]
```

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  Dictionary of restored state data
</ResponseField>

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    If this is a remote session
  </Accordion>
</AccordionGroup>

## Uses

* `ValueError`
* `search_short_term`

## Used By

* [`Session.get_state`](../functions/Session-get_state)
* [`Session.set_state`](../functions/Session-set_state)

## Source

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