title | sidebarTitle | description |
---|---|---|
Squads |
Introduction |
Use Squads to handle complex workflows and tasks. |
Sometimes, complex workflows are easier to manage with multiple assistants. You can think of each assistant in a Squad as a leg of a conversation tree. For example, you might have one assistant for lead qualification, which transfers to another for booking an appointment if they’re qualified.
Prior to Squads you would put all functionality in one assistant, but Squads were added to break up the complexity of larger prompts into smaller specialized assistants with specific tools and fewer goals. Squads enable calls to transfer assistants mid-conversation, while maintaining full conversation context.
To use Squads, you can create a squad
when starting a call and specify members
as a list of assistants and destinations.
The first member is the assistant that will start the call, and assistants can be either persistent or transient.
Each assistant should be assigned the relevant assistant transfer destinations. Transfers are specified by assistant name and are used when the model recognizes a specific trigger.
{
"squad": {
"members": [
{
"assistantId": "information-gathering-assistant-id",
"assistantDestinations": [{
"type": "assistant",
"assistantName": "Appointment Booking",
"message": "Please hold on while I transfer you to our appointment booking assistant.",
"description": "Transfer the user to the appointment booking assistant after they say their name."
}],
},
{
"assistant": {
"name": "Appointment Booking",
...
},
}
]
}
}
The following are some best practices for using Squads to reduce errors:
- Group assistants by closely related tasks
- Create as few assistants as possible to reduce complexity
- Make sure descriptions for transfers are clear and concise