Skip to content
AgenticAIWiki
  1. Learn
  2. Part 7
  3. 38. Agent interoperability and A2A
  4. 38.1

Lesson 38.1 · 1 of 7 · 4 min read · Reviewed 24 Nov 2026

Why agents need to talk to agents

By the end, you can

  • Explain why agents built by different teams need a common way to talk.
  • Give examples of agent-to-agent work.

AgentsAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. are multiplying. One team builds a support agent, another a billing agent, a vendor ships a travel agent. They use different frameworks, models and clouds.

The problem

Agents need to delegate: the support agent asks the billing agent to process a refund; a travel agent asks a hotel’s agent to book a room. Without a standard, every pair needs custom integration, the same M times N problem MCPModel Context Protocol (MCP): An open protocol that standardises how AI applications connect to tools, data and prompts through servers. solved for tools (35.1).

What an agent protocol adds

  • Discovery: how do I find an agent and learn what it can do?
  • Tasks: how do I hand over work that may take minutes or days?
  • Updates: how do I hear about progress, or answer its questions?
  • Trust: how do we authenticate each other?

Opaque by design

A key idea is that the other agent stays a black box. You don’t see its prompts, tools or memory, just its stated skillsSkill: A folder of instructions, scripts and resources that an agent loads when relevant to a task. and its results. That’s what lets companies work together without exposing their internals.

The best-known open standard for this is A2AAgent-to-agent protocol (A2A): An open protocol for agents built by different vendors to discover each other and exchange tasks. (Agent2Agent), now governed by the Linux Foundation. The rest of this chapter uses it.

Key points

  • Organisations end up with many agents built on different frameworks and by different vendors.
  • Without a shared protocol, each pair of agents needs custom glue.
  • Agent-to-agent protocols let one agent hand a task to another without knowing how it's built.
Hands-on labRuns in the Playground

Delegate to agents you cannot see inside

Build a delegator that hands tasks to other agents using only their published skills, never their internals.

You will have: A delegator that routes three requests to the right opaque agent and reports when no agent fits.

Steps

  1. Read the three remote agents: each exposes a public profile (name, skills) and a private handler you must not call directly.
  2. Write pick_agent(request) that scores each agent by overlap between request words and its skill keywords.
  3. Send the task through a single send_task(agent, text) interface, the only way in.
  4. Return a clear 'no suitable agent' result when the best score is zero.
  5. Print which agent took each request and what came back.

Done when

  • The refund request goes to the finance agent and the parcel request to the shipping agent.
  • The weather request gets 'no suitable agent'.
  • No code outside send_task touches an agent's private handler.

Open in the Playground No API key needed.

Starter code (Python)
class RemoteAgent:
    def __init__(self, name, skills, handler):
        self.profile = {"name": name, "skills": skills}   # public
        self._handler = handler                          # private: opaque to callers

def send_task(agent, text):
    """The only interface: a standard 'send a task' call."""
    return agent._handler(text)

agents = [
    RemoteAgent("finance", ["refund", "invoice", "payment"], lambda t: "Refund R-77 issued"),
    RemoteAgent("shipping", ["parcel", "delivery", "courier"], lambda t: "Parcel rebooked for Friday"),
    RemoteAgent("hr", ["holiday", "payroll", "leave"], lambda t: "Leave request logged"),
]

def pick_agent(request):
    # TODO: score agents by how many of their skills appear in the request; return None if nothing matches
    return agents[0]

for req in ["Please refund order 1042", "My parcel delivery is late", "Will it rain tomorrow?"]:
    a = pick_agent(req)
    print(req, "->", a.profile["name"] if a else "no suitable agent")
Show a solution
class RemoteAgent:
    def __init__(self, name, skills, handler):
        self.profile = {"name": name, "skills": skills}   # public
        self._handler = handler                          # private: opaque to callers

def send_task(agent, text):
    """The only interface: a standard 'send a task' call."""
    return agent._handler(text)

agents = [
    RemoteAgent("finance", ["refund", "invoice", "payment"], lambda t: "Refund R-77 issued"),
    RemoteAgent("shipping", ["parcel", "delivery", "courier"], lambda t: "Parcel rebooked for Friday"),
    RemoteAgent("hr", ["holiday", "payroll", "leave"], lambda t: "Leave request logged"),
]

def pick_agent(request):
    words = set(request.lower().replace("?", "").split())
    scored = [(len(words & set(a.profile["skills"])), a) for a in agents]
    score, best = max(scored, key=lambda s: s[0])
    return best if score > 0 else None

for req in ["Please refund order 1042", "My parcel delivery is late", "Will it rain tomorrow?"]:
    a = pick_agent(req)
    if a:
        print(f"{req!r} -> {a.profile['name']}: {send_task(a, req)}")
    else:
        print(f"{req!r} -> no suitable agent")
Quick checkA travel agent built in one framework needs to book through a hotel chain's agent built by another company. What helps most?
How sure are you?
Pick an answer and how sure you are