> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON for Agent

Agno supports using local JSON files as a storage backend for Agents using the `JsonDb` class.

## Usage

Install the `openai` and `ddgs` packages:

```shell theme={null}
uv pip install openai ddgs
```

```python json_for_agent.py theme={null}
from agno.agent import Agent
from agno.db.json import JsonDb
from agno.models.openai import OpenAIChat
from agno.tools.websearch import WebSearchTools

# Setup the JSON database
db = JsonDb(db_path="tmp/json_db")

agent = Agent(
    model=OpenAIChat(id="gpt-5.2"),
    db=db,
    session_id="session_storage",
    tools=[WebSearchTools()],
    add_history_to_context=True,
    num_history_runs=3,
)
agent.print_response("How many people live in France?")
agent.print_response("What is their national anthem called?")
agent.print_response("What have we been talking about?")
```

## Params

<Snippet file="db-json-params.mdx" />
