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

# YAML Agent Storage

Phidata supports using local YAML files as a storage backend for Agents using the `YamlFileAgentStorage` class.

## Usage

```python storage.py theme={null}
from phi.agent import Agent
from phi.tools.duckduckgo import DuckDuckGo
from phi.storage.agent.yaml import YamlFileAgentStorage

agent = Agent(
    storage=YamlFileAgentStorage(path="tmp/agent_sessions_yaml"),
    tools=[DuckDuckGo()],
    add_history_to_messages=True,
)

agent.print_response("How many people live in Canada?")
agent.print_response("What is their national anthem called?")
```

## Params

<Snippet file="storage-yaml-params.mdx" />
