You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Agent can **delegate** to other Agents via the `handoffs` property. A common pattern is to
82
-
use a _triage agent_ that routes the conversation to a more specialised sub‑agent.
82
+
There are many ways to compose agents together. Two patterns we regularly see in
83
+
production apps are:
83
84
84
-
<Codelang="typescript"code={agentWithHandoffs}title="Agent with handoffs" />
85
+
1.**Manager (agents as tools)** – a central agent owns the conversation and invokes specialized agents that are exposed as tools.
86
+
2.**Handoffs** – the initial agent delegates the entire conversation to a specialist once it has identified the user's request.
87
+
88
+
These approaches are complementary. Managers give you a single place to enforce guardrails or rate limits, while handoffs let each agent focus on a single task without retaining control of the conversation.
89
+
90
+
### Manager (agents as tools)
91
+
92
+
In this pattern the manager never hands over control—the LLM uses the tools and the manager summarizes the final answer. Read more in the [tools guide](/openai-agents-js/guides/tools#agents-as-tools).
85
93
86
-
You can read more about this pattern in the [handoffs guide](/openai-agents-js/guides/handoffs).
94
+
<Codelang="typescript"code={agentsAsTools}title="Agents as tools" />
95
+
96
+
### Handoffs
97
+
98
+
With handoffs the triage agent routes requests, but once a handoff occurs the specialist agent owns the conversation until it produces a final output. This keeps prompts short and lets you reason about each agent independently. Learn more in the [handoffs guide](/openai-agents-js/guides/handoffs).
99
+
100
+
<Codelang="typescript"code={agentWithHandoffs}title="Agent with handoffs" />
0 commit comments