ag2-subagent-delegation
Installation
SKILL.md
Subagent delegation
When to use
- "Coordinator + specialists" — a parent agent should hand parts of a task to a research agent, math agent, etc.
- "Fan out then collect" — multi-part questions where each part is independent and parallel execution saves wall time.
- "Self-delegation" — one agent breaks complex work into focused sub-tasks for itself.
Two patterns
| Pattern | Reach for it when | API |
|---|---|---|
Auto-injected run_subtask / run_subtasks |
Lightweight self-delegation, dynamic fan-out, parallel sub-questions | tasks=TaskConfig(...) on the parent |
Agent.as_tool() |
Distinct named delegates the LLM should reason about ("call the researcher", "call the writer") | Wrap a child Agent as a tool on the parent |
The two compose — a coordinator can have both.