Skip to main content

Session storage

WednesdayAI persists conversation history in a session store. Plugins can read session data using the plugin SDK’s session access helpers. The storage backend (file, SQLite, Postgres) and optional Redis cache are configured by the administrator — plugins do not register or replace the backend.

Reading sessions from a plugin

The plugin SDK exports loadSessionStore to read the current agent’s session store:
loadSessionStore() returns Promise<Record<string, SessionEntry>>. Each key is a session key (e.g. agent:<id>:telegram:dm:<userId>); each value is a SessionEntry.

SessionEntry shape

SessionEntry is exported from openclaw/plugin-sdk. Key fields:

Guarding against storage errors

Use StorageReadAccessError to handle permission-denied cases cleanly:

Querying conversation history

getConversationReadQuery builds a query object for filtered reads:

Session storage backends (admin config)

Backend selection and caching are administrator configuration, not plugin configuration. From openclaw.json:
Restart the gateway after changing storage config: systemctl --user restart openclaw-gateway.
Migrating between backends does not automatically copy existing session data. Test on a non-production instance before switching in production.