Core Concepts¶
Overview¶
The library provides two ways to add subagent delegation:
- SubAgentCapability (recommended) — plug-and-play capability with auto-wired tools and instructions
- Toolset API — lower-level control via
create_subagent_toolset()
Both use the same underlying components: subagent configs, execution modes, and message bus.
How It Works¶
Text Only
┌──────────────────────────────────────────────────────────┐
│ Parent Agent │
│ ┌────────────────────────────────────────────────────┐ │
│ │ SubAgentCapability (recommended) │ │
│ │ tools + dynamic instructions — auto-configured │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Subagent Toolset │ │
│ │ task() │ check_task() │ answer_subagent() │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┼───────────────┐ │
│ ▼ ▼ ▼ │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
│ │ researcher │ │ writer │ │ coder │ │
│ │ (sync) │ │ (async) │ │ (auto) │ │
│ └────────────┘ └────────────┘ └────────────┘ │
│ │
│ Message Bus (pluggable) │
└──────────────────────────────────────────────────────────┘
- You define SubAgentConfigs with name, description, and instructions
- SubAgentCapability (or the toolset factory) creates tools for delegation
- Your parent agent uses tools like
task()to delegate work - Subagents execute the work and return results
- The message bus handles communication (questions, answers, status)
In This Section¶
- Capability - Recommended integration (plug-and-play)
- Subagents - Configuring specialized agents
- Toolset - Lower-level delegation toolset
- Types - Data structures and enums