Skip to content

Explore splitting Agents API out of Data Machine #1561

@chubes4

Description

@chubes4

Data Machine has grown into two layers that are increasingly useful to separate:

  1. A generic WordPress agent runtime substrate: agents, conversations, tools, memory, guidelines, message envelopes, run state, and agent calls.
  2. Data Machine's automation/product layer: flows, pipelines, handlers, jobs, queues, scheduled automation, retention, content operations, and admin UI.

Prompted by a suggestion from Miguel Lezama (@lezama / migueluy), Chris wants to explore whether the generic layer should become a separate plugin called Agents API, with Data Machine becoming the first major consumer built on top of it.

Naming direction

Mirror the existing WordPress Abilities API precedent:

Surface Abilities API Proposed Agents API
Public name Abilities API Agents API
Plugin/repo slug abilities-api agents-api
Init hook wp_abilities_api_init wp_agents_api_init
Register function wp_register_ability() wp_register_agent()
Registry class WP_Abilities_Registry WP_Agents_Registry
Domain class WP_Ability WP_Agent
REST namespace wp-abilities/v1 wp-agents/v1

Avoid making WP_Agents_API the main conceptual class. Core precedent favors domain objects and registries, not a monolithic API class.

Candidate Agents API scope

Move only primitives that could plausibly be useful to Intelligence, Dolly-like agents, Data Machine, Data Machine Code, or another future plugin without inheriting Data Machine's pipeline model.

  • Agent identity and registry primitives.
  • Agent ownership / acting context / permission ceiling contracts.
  • Canonical message envelopes.
  • Conversation runner contracts.
  • Conversation store contracts.
  • Run-state vocabulary.
  • Loop event sink contract.
  • Ability-native tool declarations and validation.
  • Tool source providers.
  • Tool execution result envelopes.
  • agent_call primitive.
  • Agent memory store interface.
  • Guideline-backed memory store primitives.
  • Memory/guideline change events.
  • Generic prompt/guideline/memory composition.
  • Portable agent bundle base primitives if they stay independent of flows/pipelines.

Likely Data Machine scope

Keep Data Machine as the automation engine and product surface built on top of Agents API.

  • Flows.
  • Pipelines.
  • Step types: fetch, AI, publish, upsert, system task, webhook gate, agent ping.
  • Handlers: fetch handlers, publish handlers, content handlers, MCP handlers.
  • Queue semantics: flow queue modes, config patch queues, batch scheduling.
  • Jobs and parent/child orchestration.
  • Undo/effect envelopes.
  • Retention tasks.
  • Admin UI.
  • CLI product surface such as wp datamachine flow, pipeline, jobs, retention, post, etc.
  • Content operations: alt text, meta descriptions, image/link/indexnow helpers, post/taxonomy/block abilities.

Boundary test

For every class/function, ask:

Could a plugin use this without knowing about Data Machine flows, pipeline steps, handlers, or jobs?

If yes, it is a candidate for Agents API.

Ask the inverse:

Does this know about flow step config, handler slugs, queue modes, jobs, scheduled automation, retention, or DM's content workflow product?

If yes, it should stay in Data Machine.

Suggested migration shape

Do not start by ripping files around. Start by making the seams obvious in-place.

  1. Identify the generic runtime primitives already in Data Machine.
  2. Rename/refactor them away from Data Machine vocabulary where appropriate.
  3. Split pure contracts and value objects first.
  4. Split runtime services second.
  5. Leave Data Machine adapters behind so AIStep, jobs, flows, and handlers consume Agents API.
  6. Let Intelligence and Data Machine Code adopt the generic plugin directly after the substrate stabilizes.

Risks

  • Extracting too early into a vague framework that still carries Data Machine concepts under generic names.
  • Creating a plugin that looks core-friendly but exposes flow/pipeline assumptions.
  • Over-indexing on AI terminology. The better core-shaped term is Agent, not AI Agent.
  • Splitting before the contracts are boring enough to survive core review.

Outcome for this issue

This is exploratory. The first useful output is probably a concrete extraction map from current Data Machine classes into three buckets:

  • agents-api candidate.
  • data-machine stays.
  • Needs seam/rename before deciding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions