Add Sub-Agents to an Agent
When to use sub-agents
Use sub-agents when a task benefits from specialization or delegation—e.g., an HR Agent delegating ticket creation to a “Helpdesk Agent,” a Research Agent delegating web search to a “Browser Agent,” or a Planner delegating execution to domain experts. This mirrors multi-agent patterns where each agent has a tight role, tools, and knowledge.
Benefits:
- Encapsulates domain expertise and tools behind clear boundaries
- Lets a “supervisor” agent plan and delegate work to specialists
- Keeps your system modular and reusable across projects
How it works (runtime model)
- The parent agent runs the normal think → act → observe loop.
- When needed, it delegates to a sub-agent, passing a single, self-contained message.
- The sub-agent executes (using its own LLM, tools, KBs), returns results only to the parent, and the parent interprets and communicates back to the user.
- Sub-agents do not talk to the end user directly.
Add sub-agents in the UI
- Open your agent.
- In the Sub-Agents card, click Add.
- In the Add sub-agents drawer:
- Use the Search bar to find agents.
- Choose My Agents to select other published agents in this project.
- Choose A2A to select any A2A agents you’ve connected.
- Click the + icon to attach a sub-agent.
- Need a new one? Click Create New, publish it, then return and attach.
- To remove a sub-agent, click the red minus icon next to it in the Sub-Agents list.
- Preview to test delegation flows, then Publish your updated agent.
Delegation is stateless (important!)
Sub-agents only receive the single message you send. They don’t see earlier chat turns.
Therefore, when delegating:
- Parent agent must include every required parameter and all necessary context—no assumptions.
- If the user references something created earlier (Agent / Tool / KB), parent agent must include its IDs and any exact values the sub-agent needs.
- After the call returns, the parent should summarize/extract the key outcome and reply to the user.
Prompting guidance (after you add sub-agents)
Add a short section in the parent agent’s Base instruction so it delegates reliably. For example:
Sub-Agent Delegation Rules
- Use Helpdesk Agent for ticket operations; include
ticket_id,user_email,priority, and the exact request text. - Use Browser Agent for web research; include the full query, domain constraints, and max results.
- Always package inputs as a fresh, self-contained message. Include relevant IDs if referenced in previous inputs or results for this sub-agent.
- Sub-agents return results to you. You must interpret outputs and reply to the user.
User-prompt patterns that work well:
Explicit delegate + payload