Most teams I talk to want "agents" before they have a clear job for one. The OpenAI Agents SDK is a good place to learn what a second agent is actually for, because it has very few moving parts.
It is a Python library, MIT licensed, built on four ideas: agents, handoffs or agents as tools, guardrails, and tracing. Its stated aim is enough features to be worth using, but few enough primitives to make it quick to learn (OpenAI, 2026).
1. The pieces you need to know
| Piece | What it does | Use it for |
|---|---|---|
| Agent | A model with instructions and tools | One clear job each |
| Handoff | Passes the conversation to a specialist | Triage: billing, refunds, support |
| Agent as tool | Calls a specialist and keeps control | A manager that combines answers |
| Guardrail | Checks input and output | Blocking off-topic or unsafe requests |
| Session | Keeps history across runs | Multi-turn chats |
2. A small demo: triage with two specialists
Install with pip install openai-agents and set OPENAI_API_KEY.
import asyncio
from agents import Agent, Runner
history = Agent(name="History Tutor",
handoff_description="Specialist agent for historical questions",
instructions="You answer history questions clearly and concisely.")
maths = Agent(name="Math Tutor",
handoff_description="Specialist agent for math questions",
instructions="You explain math step by step.")
triage = Agent(name="Triage Agent",
instructions="Route each question to the right specialist.",
handoffs=[history, maths])
result = asyncio.run(Runner.run(triage, "Who was the first president of the United States?"))
print(result.final_output, result.last_agent.name)
The triage agent reads the question and hands it to the right tutor. Swap the tutors for your own billing and refund agents and you have the skeleton of a support desk. For single-call samples, see our OpenAI code recipe.
3. Where it fits, and where it doesn't
The docs are honest about the trade-off. Letting the model route is great when the task is open-ended; orchestrating in code is more deterministic and predictable in speed, cost and performance (OpenAI, 2026). My rule: if you can draw the flowchart, write it in code and use agents only for the steps you cannot.
Two things to check before production. Tracing is on by default, so decide what leaves your servers. And tracing is unavailable under a Zero Data Retention policy (OpenAI, 2026), which matters to Indian banks and insurers that negotiated one.
Is a multi-agent setup right for you?
Score each 0 (no), 1 (partly) or 2 (yes):
- Distinct jobs: each agent has a job you can name in one line.
- Routing is fuzzy: you cannot write the routing as simple rules.
- Guardrails: input and output checks are defined.
- Data rules: you have decided what tracing may send.
- Test set: twenty real questions with expected routes.
| Score | Next move |
|---|---|
| 8–10 | Build the pilot with handoffs. |
| 5–7 | Start with one agent and code routing. |
| 0–4 | A single prompt is probably enough. |
Your next step
Run the demo this week, then replace the tutors with two real queues from your support inbox and test it on twenty past tickets.
Sources
- OpenAI (2026). OpenAI Agents SDK documentation. Overview, quickstart, handoffs and multi-agent pages, read 20 November 2026.
- OpenAI (2026). Tracing. Read 20 November 2026.
- PyPI (2026). openai-agents 0.25.0. 18 November 2026.