Storage
driver and Pinaxai handles the rest. You can use Sqlite, Postgres, Mongo or any other database you want.
Here’s a simple example that demostrates persistence across execution cycles:
Run Postgres
Create an Agent with Storage
agent_with_storage.py
with the following contentsRun the agent
bye
to exit, start the app again and ask:Start a new run
agent_with_storage.py
file with the --new
flag to start a new run.AgentStorage
, the SQL-based storage classes have fixed schemas. As new Pinaxai features are released, the schemas might need to be updated.
Upgrades can either be done manually or automatically.
auto_upgrade_schema
parameter is set to True
in the storage class constructor.
You only need to set this once for an agent run and the schema would be upgraded.
upgrade_schema
method on the storage class.
Parameter | Type | Default | Description |
---|---|---|---|
storage | Optional[AgentStorage] | None | Storage mechanism for the agent. |