Subagents
Complex investigations can spawn subagents that work on focused tasks in parallel.
When an investigation requires exploring multiple paths simultaneously, the assistant can spawn subagents. Each subagent focuses on a specific aspect of the investigation and reports back with findings.
What are subagents?
Subagents are child investigations that run inline within your conversation. They have:
- Same tools as the parent: Subagents can query logs, run code, and use other tools just like the main assistant
- Scoped context: Each subagent focuses on a specific task or question
- Results returned to parent: Findings are summarized and incorporated into the main conversation
Subagents let the assistant break down complex problems without losing track of the broader investigation context.
When subagents are used
The assistant spawns subagents for:
- Complex multi-part questions: "Why is our API slow and are there any related database issues?" might spawn separate subagents for API performance and database investigation
- Parallel investigation paths: When multiple hypotheses need to be explored simultaneously
- Deep dives into specific areas: Detailed investigation of a subtopic while keeping the main thread focused on the overall question
How it works
Parent identifies need for delegation
The main assistant determines that a focused sub-investigation would be helpful. This might happen when your question has multiple independent parts or when a deep dive is needed.
Spawns subagent with specific task
A subagent is created with a clear objective. For example: "Investigate database connection pool exhaustion in the last 2 hours."
Subagent investigates independently
The subagent runs its own investigation, using tools to gather data and analyze findings. This appears as a nested tool call in your conversation.
Results summarized back to parent
The subagent's findings are returned to the main assistant, which incorporates them into its overall analysis and response to you.
Viewing subagent results
Subagent work appears in your conversation as a special type of tool call:
- Nested display: Subagent investigations are nested within the tool call that spawned them
- Expandable trajectory: Click to see the full sequence of tool calls the subagent made
- Summary at top: A brief summary of what the subagent found is shown before the detailed trajectory
You can expand subagent results to see every tool call and piece of reasoning, just like the main conversation. This full transparency helps you verify findings.
Depth limits
To prevent infinite loops and maintain performance, subagent delegation has limits:
- Maximum 2 levels of nesting: The structure can go root assistant to subagent to nested subagent, but no deeper
- Resource limits: Each subagent has constraints on execution time and tool calls
- Automatic summarization: Deep investigations are summarized to stay within context limits
| Level | Role |
|---|---|
| Root | Main assistant responding to you |
| Level 1 | First subagent, spawned by root |
| Level 2 | Nested subagent, spawned by level 1 (maximum depth) |
Subagent capabilities
Subagents have access to most investigation tools:
Can do:
- Query logs from all connected backends
- Run code in the sandbox
- Search the web for documentation
- Create artifacts (charts, tables)
- Spawn their own subagents (up to depth limit)
Cannot do:
- Trigger alerts or incidents
- Modify project or organization settings
- Access tools requiring elevated permissions
Subagents inherit the investigation context but cannot take actions that would have side effects outside the conversation. This keeps subagent work safe and reversible.