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

# Get State Dir • AI Agent SDK

> get_state_dir: Get PraisonAI state directory (machine-local: MRU model, logs, spill).

# get\_state\_dir

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**paths**](../modules/paths) module.

Get PraisonAI state directory (machine-local: MRU model, logs, spill).

Precedence:

1. `PRAISONAI_HOME` / existing legacy home (single root, back-compat)
2. `$XDG_STATE_HOME/praisonai` (else `~/.local/state/praisonai`)

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def get_state_dir() -> Path
```

### Returns

<ResponseField name="Returns" type="Path">
  Path to state directory
</ResponseField>

## Used By

* [`get_session_spill_dir`](../functions/get_session_spill_dir)
* [`get_all_paths`](../functions/get_all_paths)

## Source

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