JsonFileAgentStorage class.
Usage
storage.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
JsonFileAgentStorage class.
from phi.agent import Agent
from phi.tools.duckduckgo import DuckDuckGo
from phi.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?")
| Parameter | Type | Default | Description |
|---|---|---|---|
dir_path | str | - | Path to the folder to be used to store the JSON files. |
Was this page helpful?