Pattern | Description | Best For |
---|---|---|
DefaultPattern | Relies solely on explicitly defined agent handoffs | Fine-grained control over workflow transitions |
AutoPattern | Uses LLM to select next speaker based on message content | Dynamic conversations where next speaker depends on context |
RoundRobinPattern | Agents speak in a predetermined sequential order | Workflows where each agent should contribute in turn |
RandomPattern | Randomly selects the next agent (excluding current speaker) | Generating diverse perspectives or brainstorming |
ManualPattern | Prompts the user to select the next speaker | Educational scenarios or debugging complex workflows |
DefaultPattern
gives you complete control over the conversation flow through explicitly defined handoffs. With this pattern, you must define precisely where control should transfer next, or the conversation will terminate after the initial agent response.
triage_agent
explicitly defines the handoffs to either the tech_agent
or general_agent
based on the user query. And after the tech_agent
and general_agent
respond, they revert control back to the user. This pattern is ideal for scenarios where you need precise control over the conversation flow and want to ensure that each agent only speaks when necessary.
triage_agent
, general_agent
, and tech_agent
. This means the triage_agent
will always speak first, followed by the general_agent
, and then the tech_agent
.
Even though the triage_agent
’s system message explicitly instructs it to route technical queries to the tech_agent
, the control flow still follows the defined order. As a result, the tech_agent
hands off to the general_agent
, who then decides when to pass the query back to the tech_agent
for technical responses.
DefaultPattern
example, that will take precedence over the RoundRobinPattern
. For example, you can specify the below handoffs in code and it will override the order of the RoundRobinPattern
: