For delegating to your own named agents defined in
.praisonai/agents/*.md — by name, mid-run, with no Python — see Named Agent Delegation.For agent-to-agent routing inside a conversation, prefer Handoffs. Use the subagent tool or delegator when you need programmatic spawn control, background jobs, or parallel fan-out.
Quick Start
1
Subagent Tool on an Agent
Attach
create_subagent_tool so the parent can spawn workers:2
Programmatic Delegator
For direct async control, use
SubagentDelegator:How It Works
Named Delegation from the CLI (--subagents)
A running agent can delegate sub-tasks to your own named agents in .praisonai/agents/*.md — by name, mid-run, with no Python. Each delegated agent runs the sub-task under its own model, tools, and permissions.
1
Create two named agents
Add a
description: in each file’s frontmatter so the model knows what the agent is for. .praisonai/agents/researcher.md:.praisonai/agents/writer.md:2
Allow-list them at run time
spawn_subagent(agent_name="researcher", ...) and the resolver runs your researcher agent under its own definition.Two ways to expose a named agent
- Allow-list flag (--subagents)
- Frontmatter marker (mode: subagent)
Opt any discovered agent in from the CLI without editing it:The allow-list takes precedence over the frontmatter marker.
How resolution works
When the target name is unknown, the resolver returns nothing and the tool falls through to the existing generic-spawn behaviour — so a typo never breaks the run.--subagents vs mode: subagent
Backward compatible. With no
--subagents allow-list and no mode: subagent marker, no named resolver is wired and delegation behaves exactly as before — identical generic-spawn behaviour (agent_resolver=None).--subagents applies when running a custom agent (for example praisonai run "<task>" --agent path/to/agent.md). Named agents are discovered from ~/.praisonai/agents/ and every .praisonai/agents/ up to the repo root.Built-in Agent Profiles
Parallel Delegation
Configuration Options
Model and Permission Modes
See Subagent Tool for
create_subagent_tool parameters and background mode.
Task Management
Convenience Function
Best Practices
Match agent profiles to the task
Match agent profiles to the task
Use
explorer for read-only scans, coder for implementation, and reviewer for quality checks.Set timeouts on long tasks
Set timeouts on long tasks
Prevent runaway subagents with
default_timeout_seconds or per-call overrides.Limit concurrency
Limit concurrency
Keep
max_concurrent_subagents low to avoid overwhelming APIs or local resources.Prefer plan mode for exploration
Prefer plan mode for exploration
Use
permission_mode="plan" when subagents should not modify files.Delegating to Your Named Agents
Beyond the built-in profiles, a running agent can delegate to your own named agents in.praisonai/agents/*.md — picked by name, each running under its own model, tools, and permissions. Mark an agent with mode: subagent or opt agents in per run with praisonai run --subagents a,b,c.
Related
Named Subagents
Delegate to your own named agents by name — one Markdown file each
Subagent Tool
Spawn subagents from a parent agent’s tool list
Spawn & Announce
Non-blocking parallel sub-agent orchestration
Agent Profiles
Built-in profile definitions
Handoffs
Conversation-based agent routing

