Complete step-by-step guide · 2026
The 2026 stack is not Custom GPTs, Swarm, or Agent Builder. Those are deprecated or shutting down. Production work now sits on three paths: Workspace Agents, the OpenAI Agents SDK, and native GPT-5.6 Multi-agent.
Updated September 2026. OpenAI’s rule: start with one agent. Split into a team only when a single prompt and tool list starts failing.
| Path | Who it is for | What to use |
| No-code / team workflows | Ops, support, PMs | Workspace Agents in ChatGPT |
| Code / products | Engineers | OpenAI Agents SDK (Python or JS) |
| Native parallel subagents | Research, reviews, exploration | Responses API Multi-agent (gpt-5.6, beta) |
Contents
- What changed in 2026
- Do you need multiple agents?
- Pick a pattern
- Path A: Workspace Agents
- Path B: Agents SDK
- Path C: GPT-5.6 Multi-agent
- TypeScript
- A system you can ship
- Mistakes that kill systems
- Framework choice
- Build order
- Official starting points
1. What actually changed in 2026
- Swarm is dead. Use the Agents SDK.
- Agent Builder + Evals were deprecated June 3, 2026 and shut down November 30, 2026. Move visual canvas workflows to the Agents SDK (code) or Workspace Agents (no-code).
- Custom GPTs are being phased out in favor of Workspace Agents.
- Agents SDK (April 2026) added sandboxes, MCP, skills, AGENTS.md, shell + apply-patch tools, and long-horizon file work.
- GPT-5.6 Multi-agent lets one model spawn a tree of parallel subagents inside a single Responses API call.
Skip 2025 tutorials that still say “Assistants API” or “Agent Builder.”
2. Decide if you even need multiple agents
OpenAI’s practical guide is explicit: a single well-tooled agent is usually better. Go multi-agent only when at least one of these is true:
- The prompt is a pile of if/then branches you can’t maintain.
- Tools overlap and the model keeps picking the wrong one (common around 10 overlapping tools).
- You need separate evals (research vs draft vs QA).
- You need parallelism (review a PR for correctness, security, and tests at once).
- Specialists should own the reply (support triage to refunds vs sales vs outages).
If the job is “answer questions with a knowledge base + 3 APIs,” keep it as one agent.
3. Pick a pattern before you write code
Two patterns cover almost every ChatGPT multi-agent system.
A. Manager (agents as tools)
A manager stays in control. Specialists are called like functions. The manager owns the final answer.
Use when: you must combine several specialists, keep one voice, or put guardrails in one place.
User -> Manager -> [Researcher, Writer, Reviewer as tools] -> Manager answers
B. Handoffs (decentralized)
A triage agent routes. The specialist takes over the turn and talks to the user.
Use when: routing is the workflow (support, tutoring, domain specialists).
User -> Triage -> History Tutor (now owns the conversation)
You can mix them: triage hands off to Support, Support calls a Refund agent as a tool.
There is a third option: orchestrate in code (chain, loop, asyncio.gather). Use that when the graph should be deterministic, not “the LLM decides.”
4. Path A — No-code: Workspace Agents in ChatGPT
For team workflows that should not become an engineering project.
- In ChatGPT (Business / Enterprise), open the agent builder chat.
- Describe in plain language: the job, what “done” looks like, and constraints.
- Attach approved connectors (Gmail, Slack, Drive, etc.).
- Set a trigger: on-demand, or scheduled.
- Add action constraints (“only email @yourcompany.com”).
- Publish to the workspace.
Good for: daily escalation summaries, CRM cleanup, research briefs, recurring reports.
Not good for: custom products, private APIs, strict evals, or anything that must live in your codebase.
5. Path B — Code: Agents SDK (the real 2026 path)
Python 3.10+ or Node 22+. This is the path OpenAI recommends for anything that should survive Agent Builder’s shutdown.
Step 1 — Install
Python
source .venv/bin/activate
pip install openai-agents
export OPENAI_API_KEY=sk-...
TypeScript
Step 2 — One agent first
from agents import Agent, Runner
agent = Agent(
name="History Tutor",
instructions="You answer history questions clearly and concisely.",
)
async def main():
result = await Runner.run(agent, "When did the Roman Empire fall?")
print(result.final_output)
asyncio.run(main())
Confirm this works before you add teammates. Most “multi-agent” bugs are actually “the first agent was never good.”
Step 3 — Give it tools
Three kinds of tools:
- Data — search, DB, files, RAG
- Action — send email, update CRM, refund
- Orchestration — other agents, exposed as tools
import datetime
@function_tool
def save_results(output: str) -> str:
"""Persist a research snippet."""
return f"Saved at {datetime.datetime.now().isoformat()}"
search_agent = Agent(
name="Search agent",
instructions="Search the internet and save results when asked.",
tools=[WebSearchTool(), save_results],
)
Hosted tools (WebSearchTool, file search, computer use, MCP servers) attach the same way. MCP is the 2026 default for “connect anything.”
Step 4 — Split specialists
Each agent gets one job, a short instruction, and only the tools it needs.
researcher = Agent(
name="Researcher",
instructions="Gather facts. Cite sources. Do not write the final article. Return bullet findings only.",
tools=[WebSearchTool()],
)
writer = Agent(
name="Writer",
instructions="Turn research bullets into a clear article. Do not invent facts that were not in the research.",
)
reviewer = Agent(
name="Reviewer",
instructions="Check accuracy, structure, and unsupported claims. Return either APPROVE or a numbered list of required fixes.",
)
Step 5 — Manager pattern (agents as tools)
manager = Agent(
name="Editor in Chief",
instructions="You produce a finished article. 1) Call research for facts. 2) Call write_draft with those facts. 3) Call review_draft. 4) If review is not APPROVE, send fixes back to write_draft. You own the final answer to the user.",
tools=[
researcher.as_tool(tool_name="research", tool_description="Collect sourced facts for a topic"),
writer.as_tool(tool_name="write_draft", tool_description="Draft an article from research bullets"),
reviewer.as_tool(tool_name="review_draft", tool_description="Approve or request fixes"),
],
)
result = await Runner.run(manager, "Write a 600-word explainer on MCP.")
print(result.final_output)
This is the pattern you want for content pipelines, research reports, and anything where one voice should come back.
Step 6 — Handoff pattern (specialist takes over)
history_tutor = Agent(
name="History Tutor",
handoff_description="Specialist for historical questions",
instructions="Answer history questions clearly and concisely.",
)
math_tutor = Agent(
name="Math Tutor",
handoff_description="Specialist for math questions",
instructions="Explain math step by step with worked examples.",
)
triage = Agent(
name="Triage Agent",
instructions="Route each homework question to the right specialist.",
handoffs=[history_tutor, math_tutor],
)
result = await Runner.run(triage, "Who was the first US president?")
print(result.final_output)
print("Answered by:", result.last_agent.name)
Same idea for support: Technical / Sales / Orders.
Step 7 — Orchestrate in code when the graph is known
Don’t make the LLM re-decide a pipeline you already know.
draft = await Runner.run(writer, research.final_output)
for _ in range(3):
critique = await Runner.run(reviewer, draft.final_output)
if "APPROVE" in critique.final_output:
break
draft = await Runner.run(writer, f"{draft.final_output}\n\nFixes:\n{critique.final_output}")
Independent work in parallel:
Runner.run(correctness_agent, diff),
Runner.run(security_agent, diff),
Runner.run(tests_agent, diff),
)
Step 8 — Guardrails (non-optional in production)
Input/output guardrails run in parallel with the agent and fail fast.
from agents import Agent, Runner, input_guardrail, Guardrail, GuardrailFunctionOutput
class ChurnDetectionOutput(BaseModel):
is_churn_risk: bool
reasoning: str
detector = Agent(
name="Churn Detection",
instructions="Is this user about to churn?",
output_type=ChurnDetectionOutput,
)
@input_guardrail
async def churn_tripwire(ctx, agent, input):
result = await Runner.run(detector, input, context=ctx.context)
return GuardrailFunctionOutput(
output_info=result.final_output,
tripwire_triggered=result.final_output.is_churn_risk,
)
support = Agent(
name="Customer Support",
instructions="Help the customer.",
input_guardrails=[Guardrail(guardrail_function=churn_tripwire)],
)
- PII filters
- topic / jailbreak classifiers
- tool risk ratings (high-risk tools pause for a human)
- output brand/policy checks
High-risk actions (refunds, emails, deletes) should pause for approval, not auto-fire.
Step 9 — Memory and sessions
- SDK Session — SDK keeps history
- conversation_id / previous_response_id — server-side OpenAI state
- result.to_input_list() — you own the history
Share memory by a conversation id when a manager calls specialists, so they don’t each start blank.
Step 10 — Sandbox agents (files, code, long jobs)
April 2026 SDK: give an agent a real workspace when it needs to read files, run commands, or edit code. Use SandboxAgent plus a sandbox client (UnixLocalSandboxClient, Modal, E2B, etc.). Regular Agent is for chat/tools. Sandbox is for Codex-style work.
Step 11 — Trace, eval, then shrink models
- Prototype on the strongest model you have.
- Watch traces in the OpenAI traces dashboard — every tool call, handoff, and guardrail.
- Write evals per specialist (research citations, draft faithfulness, review catch-rate).
- Once quality holds, drop specialists to cheaper/faster models. Keep the manager on a stronger one.
6. Path C — Native Multi-agent on GPT-5.6
When the task fans out (review a PR three ways, research 8 sources, explore a repo), you don’t have to hand-define specialists.
model="gpt-5.6-sol",
input="Review this diff with three agents: correctness, security, missing tests.",
multi_agent={"enabled": True, "max_concurrent_subagents": 3},
betas=["responses_multi_agent=v1"],
)
The root agent (/root) spawns /root/researcher, /root/reviewer, etc. They share the model and tools, keep separate context, and the API handles spawn / message / wait / interrupt.
Use this when work is independent and parallel. Use the Agents SDK when you need named specialists, different tools, guardrails, or a deterministic graph.
7. TypeScript equivalent
const math = new Agent({
name: "Math Tutor",
handoffDescription: "Math questions",
instructions: "Explain math step by step.",
});
const triage = new Agent({
name: "Triage",
instructions: "Route homework to the right specialist.",
handoffs: [math],
});
const result = await run(triage, "What is 17 * 19?");
console.log(result.finalOutput);
Same primitives: Agent, tools, handoffs, asTool(), guardrails, sessions.
8. A complete system you can actually ship
Example: customer support — the canonical 2026 multi-agent app.
- Triage agent (handoffs) — classifies intent.
- Technical support — knowledge-base search.
- Sales — catalog + quote tools.
- Orders — tracking + refunds (refunds require human approval).
- Input guardrails — jailbreak, PII, churn escalation.
- Session — conversation history across turns.
- Tracing + evals — routing accuracy, CSAT proxy, refund false-positives.
That is a real architecture. A “crew of 8 agents that debate” is usually a demo.
9. Mistakes that still kill these systems in 2026
- Too many agents too soon. One agent + tools until it fails.
- Overlapping tools/roles. If two agents can both “search” and “write,” they thrash.
- Handoffs when you needed a manager. User sees the specialist’s raw voice; the manager never synthesizes.
- No stop condition. Critique loops without APPROVE or a max-iteration cap.
- No human gate on irreversible actions.
- Shared mutable state across parallel subagents. Native multi-agent is the wrong fit there.
- Building on Agent Builder / Assistants API in late 2026.
10. Framework choice if you’re not all-in on OpenAI
If the models must be mix-and-match, or you need a durable state machine:
| Need | Reach for |
| OpenAI-native, fastest to a working team | Agents SDK |
| Explicit graph, checkpoints, HITL, audit | LangGraph |
| Role-based “crew” prototype | CrewAI |
| Azure / .NET | Microsoft Agent Framework |
| Claude-only harness | Claude Agent SDK |
For “multi-agent with ChatGPT,” the Agents SDK is the default. LangGraph wins when the workflow is a state machine you must control.
11. Build order (do this, in this order)
- Write the job as a single agent. Measure it.
- List tools: data, action, none extra.
- Split only the roles that actually conflict.
- Choose manager vs handoff vs code chain.
- Add guardrails on the user-facing agent first.
- Turn on tracing. Write 20 golden tasks.
- Add HITL for high-risk tools.
- Only then: sessions, sandboxes, MCP, parallelism.
Comments
Post a Comment