> For the complete documentation index, see [llms.txt](https://docs.projectbit.ca/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.projectbit.ca/documentation/storage/json-agent-storage.md).

# JSON Agent Storage

Bitcadata supports using local JSON files as a storage backend for Agents using the `JsonFileAgentStorage` class.

### [​](https://docs.phidata.com/storage/json#usage)Usage <a href="#usage" id="usage"></a>

storage.py

```python
from bitca.agent import Agent
from bitca.tools.duckduckgo import DuckDuckGo
from bitca.storage.agent.json import JsonFileAgentStorage

agent = Agent(
    storage=JsonFileAgentStorage(path="tmp/agent_sessions_json"),
    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?")
```

### [​](https://docs.phidata.com/storage/json#params)Params <a href="#params" id="params"></a>

| Parameter  | Type  | Default | Description                                            |
| ---------- | ----- | ------- | ------------------------------------------------------ |
| `dir_path` | `str` | -       | Path to the folder to be used to store the JSON files. |
