Store sessions, memories, metrics, knowledge, evals, and traces in local JSON files.
JsonDb is a class that implements the Db interface using JSON files as the backend storage system. It provides simple, file-based storage with each table stored as a separate JSON file.
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.
Upsert multiple memories in one method call.Parameters:
memories (List[UserMemory]): List of memories to upsert
deserialize (Optional[bool]): Whether to deserialize the memories. Defaults to True
preserve_updated_at (bool): Whether to keep the memories' existing updated_at timestamps. Defaults to False
Returns:List[Union[UserMemory, Dict[str, Any]]]
In Agno v2.7.2, JsonDb.upsert_sessions() and JsonDb.upsert_memories() declare preserve_updated_at, but the JSON backend does not forward it to individual upserts. JsonDb does not preserve supplied updated_at values when this argument is True.