Summary
Define a first-class taxonomy of agents (core, research, communication, automation, planner/orchestrator, etc.) that all build on the existing Agent / AgentBuilder types in src/openhuman/agent/agent/types.rs. Planning, orchestration, and system-prompt construction for these agents should live alongside that type under src/openhuman/agent/agent/ (with clear submodules), instead of spreading orchestration-only logic across unrelated trees.
User-visible outcome: predictable agent roles, easier testing, and a single place for contributors to see how each agent is built and which prompts it uses.
Problem
Today the runtime Agent struct is well-factored (types, builder, turn, runtime per agent/mod.rs), but multi-agent behavior (archetypes, orchestrator DAG, sub-agent runs) largely lives under src/openhuman/agent/harness/, while prompt assembly is split across prompt.rs (e.g. SystemPromptBuilder, archetype sections) and markdown under agent/prompts/.
That split makes it hard to answer:
- “What agents exist, and how do they differ?”
- “Where is the orchestrator’s plan defined relative to the main
Agent?”
- “How do we create prompts per agent kind in one coherent pipeline?”
New roles (e.g. planner-only, evaluator, handoff targets) risk ad hoc wiring instead of extending the same Agent/AgentBuilder foundation.
Solution (optional)
-
Agent kinds / registry — Introduce an enum or registry (e.g. AgentKind) that maps each product role to:
AgentBuilder defaults (tools subset, temperature caps, iteration limits where applicable)
- Prompt recipe (which
SystemPromptBuilder sections / archetype markdown files)
- Optional orchestration profile (participant in DAG vs single-turn primary)
-
Colocate under agent/agent/ — Add focused modules, for example:
agent/agent/plan.rs — planning steps / structured plan output types consumed by orchestration
agent/agent/orchestrator.rs — topology and handoff rules (migrate or thin-wrap today’s harness/executor + config)
agent/agent/prompts.rs (or prompt_factory.rs) — factory that builds SystemPromptBuilder (or equivalent) per AgentKind, reusing existing prompt.rs primitives
Keep types.rs as the single structural definition of Agent / AgentBuilder; behavior stays in sibling files per existing pattern.
-
Inheritance / composition — Prefer composition: specialized agents are Agent instances built via shared AgentBuilder helpers, not parallel structs, unless a trait boundary is needed for testing (e.g. trait RunnableAgent implemented only by Agent).
-
Migration — Incrementally move orchestrator entrypoints and archetype resolution so openhuman::agent::agent is the public conceptual home; harness can become a thin compatibility layer or be merged.
-
Docs — Update agent/mod.rs file-layout table and docs/ or AGENTS.md to describe agent kinds and prompt wiring.
Acceptance criteria
Related
Summary
Define a first-class taxonomy of agents (core, research, communication, automation, planner/orchestrator, etc.) that all build on the existing
Agent/AgentBuildertypes insrc/openhuman/agent/agent/types.rs. Planning, orchestration, and system-prompt construction for these agents should live alongside that type undersrc/openhuman/agent/agent/(with clear submodules), instead of spreading orchestration-only logic across unrelated trees.User-visible outcome: predictable agent roles, easier testing, and a single place for contributors to see how each agent is built and which prompts it uses.
Problem
Today the runtime
Agentstruct is well-factored (types,builder,turn,runtimeperagent/mod.rs), but multi-agent behavior (archetypes, orchestrator DAG, sub-agent runs) largely lives undersrc/openhuman/agent/harness/, while prompt assembly is split acrossprompt.rs(e.g.SystemPromptBuilder, archetype sections) and markdown underagent/prompts/.That split makes it hard to answer:
Agent?”New roles (e.g. planner-only, evaluator, handoff targets) risk ad hoc wiring instead of extending the same
Agent/AgentBuilderfoundation.Solution (optional)
Agent kinds / registry — Introduce an enum or registry (e.g.
AgentKind) that maps each product role to:AgentBuilderdefaults (tools subset, temperature caps, iteration limits where applicable)SystemPromptBuildersections / archetype markdown files)Colocate under
agent/agent/— Add focused modules, for example:agent/agent/plan.rs— planning steps / structured plan output types consumed by orchestrationagent/agent/orchestrator.rs— topology and handoff rules (migrate or thin-wrap today’sharness/executor+ config)agent/agent/prompts.rs(orprompt_factory.rs) — factory that buildsSystemPromptBuilder(or equivalent) perAgentKind, reusing existingprompt.rsprimitivesKeep
types.rsas the single structural definition ofAgent/AgentBuilder; behavior stays in sibling files per existing pattern.Inheritance / composition — Prefer composition: specialized agents are
Agentinstances built via sharedAgentBuilderhelpers, not parallel structs, unless a trait boundary is needed for testing (e.g.trait RunnableAgentimplemented only byAgent).Migration — Incrementally move orchestrator entrypoints and archetype resolution so
openhuman::agent::agentis the public conceptual home;harnesscan become a thin compatibility layer or be merged.Docs — Update
agent/mod.rsfile-layout table anddocs/orAGENTS.mdto describe agent kinds and prompt wiring.Acceptance criteria
Agent/AgentBuilderdefined intypes.rs; no duplicate “second agent struct” without justification.src/openhuman/agent/agent/with module-level docs explaining call graph fromturn/ RPC entrypoints.Related
src/openhuman/agent/agent/types.rs—Agent,AgentBuildersrc/openhuman/agent/agent/mod.rs— module layoutsrc/openhuman/agent/harness/— current orchestrator / archetypes / subagent runnersrc/openhuman/agent/prompts/,SystemPromptBuilderinprompt.rs