Home / AI Hub / Connecting Multiple AI Agents Together
AI Hub · Go Further

One agent hits a ceiling fast. Here's what two look like.

This picks up after you've already built one working agent, the Customer Question Triage assistant from Step 5, or the email triage build in the advanced example. If it's working well, you'll notice it starts hitting the same wall: it does one narrow job well, and then hands you a pile of things it wasn't confident enough to finish.

The Moment You Need a Second Agent

A single-purpose agent is supposed to stay narrow, that's what makes it trustworthy. But narrow means it has a ceiling. For the triage assistant, that ceiling shows up as a growing stack of "not confident, escalating to a human" items, questions it could categorize but couldn't actually answer from the knowledge base it has.

The instinct is to make the one agent smarter, give it more instructions, more tools, more judgment calls. Don't. A single agent trying to do triage and deep research and drafting and tone-matching becomes harder to trust, not easier. The better move is a second, equally narrow agent that picks up exactly where the first one stops.

The Pattern: A Handoff, Not a Hive Mind

You don't need an orchestration framework to connect two agents. You need one thing: a handoff contract, a fixed, structured format that the first agent always outputs, and that the second agent always expects. If Agent 1 always hands off the same shape of information, Agent 2 doesn't need to guess what it's looking at.

Producer
Does the first pass. Narrow job, clear output. For triage, that's: categorize, answer if confident, otherwise package what it knows and doesn't.
The handoff contract
A fixed format, the same labeled fields every time, so the second agent can parse it without interpretation. This is the part people skip, and it's the part that actually makes two agents reliable together.
Specialist
Picks up only what the producer couldn't finish. Its job is narrower than "help with everything the first agent missed," it's one specific kind of follow-up work.
Where it lands
Almost always: back to a human. Two agents chained together doesn't mean no one reviews the result, it means the result a human reviews is more finished.
Worked Example: Triage Hands Off to Research

Take the Customer Question Triage assistant from Step 5. Right now, anything under 90% confidence just gets flagged for a human. Instead, hand it to a second agent whose only job is to go dig deeper before a human sees it.

The Handoff Contract
HANDOFF: TRIAGE → RESEARCH

original_question: [the customer's exact question]
category: [Billing | How-to | Bug | Feature Request | Other]
what_triage_found: [any partial answer or relevant doc triage located]
what_triage_could_not_confirm: [the specific gap, not just "not sure"]
urgency: [normal | time-sensitive]
do_not_answer_without_verifying: [true if it involves price, date, policy, or status]

Triage's instructions get one line added: "If confidence is below 90%, output the handoff above instead of a final answer." Then the Research assistant's system prompt is built to expect exactly that shape:

Research Assistant — System Prompt
RESEARCH ASSISTANT — SYSTEM PROMPT

ROLE
You receive escalations from the Triage assistant in a fixed handoff
format. Your only job is to close the specific gap it identified, not
to redo triage's work or re-categorize the question.

INPUT
You will always receive: original_question, category, what_triage_found,
what_triage_could_not_confirm, urgency, and a verification flag.

YOUR JOB
1. Search the full knowledge base and docs, not just the quick-reference
   set triage uses, for the specific gap named in what_triage_could_not_confirm.
2. Draft a complete answer to original_question using what you find.
3. If do_not_answer_without_verifying is true, you must link the official
   source page and cannot state the fact as settled without it.
4. If you still can't close the gap, say exactly what's missing, don't
   pad the answer to sound more complete than it is.

OUTPUT, FOR A HUMAN TO REVIEW
Draft answer: [your answer]
Sources checked: [list]
Confidence: [High/Med/Low]
Still unresolved: [anything you couldn't confirm, or "none"]

Never send this directly to the customer. This is a draft for a human
to review and send.

Notice what didn't change: neither prompt got longer or vaguer. Triage still only does triage. Research only does research, and only on the specific gap it was handed. The handoff contract is what lets them work together without either one needing to understand the other's whole job.

Start With Two, Not Five

It's tempting to design a whole pipeline, triage, research, drafting, tone-matching, approval, once you see the pattern. Don't. Every additional agent is another place for a small error to compound into a confidently wrong final answer. Get two agents working reliably, by hand, for a couple of weeks before you add a third.

Where This Actually Runs

At first, the handoff can just be you: copy Triage's output, paste it into Research, review what comes back. That's a perfectly good way to test whether the contract actually works before automating anything.

Once you trust it, this becomes the same shift covered in AI Agents, and How to Build Your First One: instead of you pasting the handoff by hand, a small piece of code or a scheduled trigger passes Agent 1's output straight into Agent 2. The routing pattern itself is the same one taught in Your First Agent, One Example All the Way Through, you're just chaining a second classification step after the first.

AI Hub · Step 5
Build Your First AI Assistant →
AI Hub · Step 7
AI Agents, and How to Build Your First One →
AI Hub · Advanced
Your First Agent, One Example All the Way Through →