Skip to content

Supervisor Agent

Supervisor Agent coordinates a team of agents. It receives the request, decides which specialised agent should handle it, passes it on and, when that agent finishes, decides whether another one is needed or whether it can give the final answer. Each agent on the team can have its own instructions and tools.

Use it when a single request may need different kinds of knowledge (sales, technical support, billing…) and you prefer an expert agent for each area rather than one that does everything.

When to use it

  • A company assistant that distributes requests among a sales agent, a support agent and a billing agent.
  • A process in which one agent does the research and another writes up the result.
  • Requests that mix several topics and need help from more than one specialist.
  • Organising a team of agents you have already built with Agent.

Configuration

ConnectionWhat to connect
Model (required)The AI model the supervisor uses to decide who to delegate to.
Worker AgentsThe specialised agents on the team. Connect the Agent output of each one here. The supervisor tells them apart by their name and description, so fill in Agent Name and Agent Description carefully on each one.
ToolsTools the supervisor itself can use, in addition to delegating.
FieldWhat it does
Agent NameThe supervisor’s name. Default: SupervisorAgent.
Agent DescriptionWhat the supervisor does. It is used when the supervisor is itself a tool or a team member of another supervisor.
InputThe initial message, usually from Chat Input.
System PromptThe supervisor’s instructions: how it should distribute the work and what it should deliver. Default: You are a helpful assistant.
User PromptThe template of the message the supervisor receives. Default: {input}. Each variable in curly braces becomes a field with that name.
Output ModeWhat the supervisor receives from each team agent: last_message (default) only its final answer; full_history, its whole working conversation.

Advanced options

FieldWhat it does
Use as RouterThe supervisor only chooses which agent answers and does not write an answer of its own: the answer is the chosen agent’s. Default: off.
Add Handoff MessagesRecords in the conversation each time the supervisor passes the work to an agent. Default: off.
Add Handoff Back MessagesRecords in the conversation each time an agent hands the work back to the supervisor. Default: off.
Max IterationsThe maximum number of steps the team can take in one answer. Default: 50.
Memory top messageHow many previous messages of the conversation the supervisor receives as context. Default: -1, all of them.
Use short term memoryThe supervisor remembers the conversation between messages. Default: on.
StreamThe answer appears in the chat as it is generated.
VerboseLogs the run in more detail, useful to review how the work was distributed.
Tool SchemaThe data the supervisor receives when another agent uses it as a tool (name, type, whether it is required and a description of each item). Each item fills in the User Prompt variable with the same name, so include at least one called input if you keep the default template.

Output

  • Response: the final answer as a message. Connect it to Chat Output.
  • Agent: the configured supervisor, to use it as a team member of another supervisor.
  • Tool: the supervisor turned into a tool, for another agent’s Tools input. It needs Tool Schema.

Example

The online shop Casa Verde handles customers by chat. It creates three Agent components: “Sales” (with its catalogue as a tool), “Shipping” (with the order tracking tool) and “Returns”. It fills in the name and description of each one and connects their Agent output to the Supervisor Agent’s Worker Agents. In the supervisor’s System Prompt it writes: “You are Casa Verde’s customer service coordinator. Pass each request to the right agent and answer the customer with its information.” When a customer asks where their order is, the supervisor routes it to “Shipping” and returns its answer.

  • Agent: to build each agent on the team.
  • Router Agent: sends each message to a different branch of the flow according to its intention.
  • Deep Agent: can also delegate to subagents, designed for long tasks.