PostgresStore from lib/state.py in the storage overview:
extensions/sessions.py
Store session-scoped data
Usecontext.session for values that should persist with a session without entering prompts or model-visible history:
lib/exports.py
Session writes are scoped to the authenticated user and session. They emit payload-free OTEL audit events.
Register a domain repository
Custom storage is for business data that needs a typed repository. It is not a session store or framework checkpointer.extensions/users.py
lib/user_profiles.py
start() and close() methods. Prefer domain methods over exposing a raw connection to agent code. Sessions and checkpoints never appear in context.storage.
Register asset stores
Declare one or more named stores for session-owned media:extensions/assets.py
context.assets selects default; context.assets("generated") selects a named store. An AssetRef retains its store and optional domain label, so later reads cannot silently switch backends. See Store and retrieve media.
Configure checkpoints separately
Add active-run persistence and recovery without exposing checkpoint state to agent code.