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

Function

> This function is defined in the [**paths**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/paths.md) 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

**Returns** `Path`

Path to state directory

## Used By

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

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/paths.py#L211)
>
> `praisonaiagents/paths.py` at line 211


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.