Skip to content

Consider a WordPress-native default conversation session store #235

@chubes4

Description

@chubes4

Problem

Agents API already defines the generic conversation session surface through WP_Agent_Conversation_Store, WP_Agent_Principal_Conversation_Store, the wp_agent_conversation_store filter, and the generic conversation session abilities. However, when no host plugin registers a store, the abilities fail with:

No WP_Agent_Conversation_Store is registered. Provide one with the wp_agent_conversation_store filter.

That is a clean substrate boundary, but it leaves default installs without durable sessions unless a consumer plugin makes a storage decision up front.

Why this is worth reconsidering

Data Machine deliberately uses custom database tables for chat/session storage. That is still the right choice for a product that owns rich chat UX, listing, read-state, metrics, retention, and operational reporting.

Agents API likely should not ship custom tables. But there may be a middle ground: ship a lightweight WordPress-native default session store, probably CPT/postmeta-backed, so the substrate works out of the box on normal WordPress and WordPress.com-style environments.

A default store would make Agents API friendlier for small consumers and experiments that need session continuity but do not want to own persistence infrastructure on day one.

Proposed shape

  • Add a default WP_Agent_Conversation_Store implementation backed by WordPress primitives, likely a private custom post type plus post meta.
  • Keep the existing wp_agent_conversation_store seam as the override point.
  • Let Data Machine and other products opt out by returning their own custom store from that filter.
  • Keep the default narrow: transcript/session persistence only, matching the existing contract. Do not add product chat UI, read-state dashboards, retention policy UI, analytics, or workflow history.
  • Support the principal-owned contract if feasible, so non-user owners do not immediately require a custom backend.

Open questions

  • Should this live in canonical agents-api, or should the prior Spin out agents-api-default-stores companion plugin (guideline + markdown + CPT session) #78 decision still stand and this belong in a companion/reference plugin?
  • If it lives in canonical, should it be enabled by default on activation or lazily registered only when no host store is provided?
  • Should the post type be public=false/private, and should individual sessions be addressable as posts at all?
  • How should retention/cleanup be handled without turning Agents API into a product runtime?
  • What is the minimum schema needed to support efficient list/get/update/delete and retry dedupe without creating a table?

Related context

cc @lezama

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions