JsonDb stores Agent, Team, and Workflow sessions, memories, knowledge, evaluations, and traces in local JSON files.
Usage
Install theopenai package:
json_for_agent.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Persist Agno sessions and other data in local JSON files.
JsonDb stores Agent, Team, and Workflow sessions, memories, knowledge, evaluations, and traces in local JSON files.
JsonDb reads and rewrites local files without concurrency controls. Use it for demos and tests.openai package:
uv pip install openai
from agno.agent import Agent
from agno.db.json import JsonDb
db = JsonDb(db_path="tmp/json_db")
agent = Agent(db=db)
| Parameter | Type | Default | Description |
|---|---|---|---|
id | Optional[str] | - | The ID of the database instance. UUID by default. |
db_path | Optional[str] | - | Path to the directory where JSON files will be stored. |
session_table | Optional[str] | - | Name of the JSON file to store sessions (without .json extension). |
memory_table | Optional[str] | - | Name of the JSON file to store memories. |
metrics_table | Optional[str] | - | Name of the JSON file to store metrics. |
eval_table | Optional[str] | - | Name of the JSON file to store evaluation runs. |
knowledge_table | Optional[str] | - | Name of the JSON file to store knowledge content. |
culture_table | Optional[str] | - | Name of the JSON file to store cultural knowledge. |
traces_table | Optional[str] | - | Name of the JSON file to store traces. |
spans_table | Optional[str] | - | Name of the JSON file to store spans. |
Was this page helpful?