Agent state storage can start with one database

AI agent state can be divided into three groups: temporary data for the current run, lasting data for each user or workspace, and an append-only . Redis can serve the temporary data, while PostgreSQL can hold lasting data, and each action can include the that were active when it happened.

If the agent only needs and , it only needs the lasting-data layer. There is little reason to add Redis or split data across several systems when the agent has no temporary data requiring extremely fast reads and no compliance need for a separate unchangeable audit log.

In this firsthand , Lakebase, a managed PostgreSQL service, stores conversations, messages, and in standard s. Conversations and messages use linked tables, while preferences are stored by user.

Key points

  • Separate agent state into temporary data, lasting user data, and .
  • PostgreSQL alone can be enough for and .
  • Skip Redis when the agent does not need extremely fast temporary reads.
  • Add a separate unchangeable audit log only when compliance or operational needs justify it.
  • Store the active permission details with each action so past decisions can be checked.
Read original