Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Subagent Delegation

The agent can delegate focused tasks to isolated child agents.

How It Works

SubAgentTool registers a delegate_to_sub_agent tool. When invoked:

  1. A child KeruxAgent is spawned with a fresh conversation (no parent history)
  2. The child runs its own ReAct loop and returns a final summary
  3. Only the summary enters the parent conversation — intermediate noise stays out

Guardrails

GuardrailValue
DefaultON
Max concurrent children3 (tokio semaphore)
Nesting depth1 (child registry is empty — children cannot delegate further)

Config

[delegation]
provider = "openai"        # optional: separate provider for children
model = "gpt-4o-mini"      # optional: cheaper model for delegation
max_concurrent = 3

Implementation

  • kerux-core/src/tools/sub_agent_tool.rs