Data Machine has grown into two layers that are increasingly useful to separate:
- A generic WordPress agent runtime substrate: agents, conversations, tools, memory, guidelines, message envelopes, run state, and agent calls.
- 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.
- Identify the generic runtime primitives already in Data Machine.
- Rename/refactor them away from Data Machine vocabulary where appropriate.
- Split pure contracts and value objects first.
- Split runtime services second.
- Leave Data Machine adapters behind so
AIStep, jobs, flows, and handlers consume Agents API.
- 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.
Data Machine has grown into two layers that are increasingly useful to separate:
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:
abilities-apiagents-apiwp_abilities_api_initwp_agents_api_initwp_register_ability()wp_register_agent()WP_Abilities_RegistryWP_Agents_RegistryWP_AbilityWP_Agentwp-abilities/v1wp-agents/v1Avoid making
WP_Agents_APIthe 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_callprimitive.Likely Data Machine scope
Keep Data Machine as the automation engine and product surface built on top of Agents API.
wp datamachine flow,pipeline,jobs,retention,post, etc.Boundary test
For every class/function, ask:
If yes, it is a candidate for Agents API.
Ask the inverse:
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.
AIStep, jobs, flows, and handlers consume Agents API.Risks
Agent, notAI Agent.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-apicandidate.data-machinestays.