Multi-Agent Systems

No AI Agent is an Island: How We Get Our AI Agents to Cooperate

A practical look at the A2A protocol and how it lets diverse AI agents collaborate across frameworks to solve real-world problems.

By Innovate Solutions • Sat Oct 12 2024

At Innovate Solutions, we build a lot of AI agents. We have agents that manage customer orders, agents that analyze sales data, and agents that schedule logistics. For a long time, they worked in isolation. But we quickly realized that a single agent, no matter how smart, hits a wall when faced with a complex, real-world task. The real magic happens when they work together.

The problem was getting them to talk to each other. Agents built with different frameworks—like Google's ADK, LangGraph, or CrewAI—don't naturally speak the same language. This is where the Agent-to-Agent (A2A) protocol comes in. It’s not a fancy, abstract concept; it’s a practical set of rules that acts as a universal translator, letting our diverse family of agents collaborate effectively. This post breaks down what A2A is, how it works, and how we use it to build smarter systems.

What is A2A, Really? A No-Nonsense Explanation

Think of A2A as a common language for AI. It's an open standard, meaning it's not owned by one company. Big names like Google, Microsoft, Salesforce, and others are all on board, which gives us confidence that we're not betting on a niche technology.

At its core, A2A is an HTTP-based protocol that allows one agent (the client) to find another agent (the server), understand what it can do, and ask it to perform a task. It ensures that an agent we build with Google's ADK can seamlessly delegate a job to another agent built with LangChain, without either needing to know the messy internal details of the other.

How It Works: The Core Pieces

To make this collaboration happen, A2A relies on a few straightforward concepts. We had to get comfortable with these to really make our multi-agent systems click.

The Agent's Business Card: The AgentCard

Before one agent can talk to another, it needs to know who it is and what it does. This is handled by the Agent Card, which is basically a JSON file that acts as an agent's public profile or business card.

It contains the essential info:

  • Name and Description: What the agent is called and what it does (e.g., "WeatherBot," "Provides accurate weather forecasts").
  • URL: The endpoint where other agents can reach it.
  • Skills: A clear list of tasks it can perform, like get_current_weather or get_forecast. Each skill includes examples of how to ask for it, which is incredibly helpful for discovery.
  • Capabilities: Technical details, like whether it supports real-time streaming updates.

This card is the foundation for discovery and communication. Here's a simplified look at the AgentCard for our internal "Calendar Agent":

{
  "name": "Calendar Agent",
  "description": "An agent that can manage a user's calendar",
  "url": "http://our-internal-url:8000/",
  "version": "1.0.0",
  "capabilities": {
    "streaming": true
  },
  "skills": [
    {
      "id": "check_availability",
      "name": "Check Availability",
      "description": "Checks a user's availability using their Google Calendar",
      "examples": ["Am I free from 10am to 11am tomorrow?"]
    }
  ]
}

The Conversation: Communication and Tasks

Communication in A2A is all about tasks. A client agent sends a task to a server agent, and that task moves through states like submitted, working, and completed. This asynchronous design is great because it doesn't lock up the client agent while it waits for a long-running job to finish.

A2A offers a few different ways for agents to talk, and we use them all depending on the situation:

  • Synchronous Request/Response: The simplest form. "What's the exchange rate for USD to EUR?" The client sends the request and waits for a single, complete answer. Perfect for quick, simple queries.
  • Asynchronous Polling: For longer tasks. The client says, "Generate a sales report for Q3." The server immediately responds, "Got it, I'm working on it. Here's your task ID: task-123." The client can then check back periodically using that ID until the report is ready.
  • Streaming (Server-Sent Events - SSE): This is for real-time updates. Imagine asking an agent to monitor a server's health. Instead of constantly asking "Is it okay now?", the server agent keeps an open connection and pushes updates whenever the status changes. We use the sendTaskSubscribe method for this.

Putting A2A to Work: Real-World Scenarios at Innovate Solutions

Theory is great, but here’s how we actually use A2A to solve real business problems.

Scenario 1: Complex Workflow Orchestration

A customer types into our main support chat: "I need to reorder my last purchase, but can you make sure it's delivered this Friday afternoon when I'm home?"

A single "do-it-all" agent would be a nightmare to build and maintain. Instead, we use a team of specialized agents orchestrated by A2A.

  • Orchestrator Agent (The Client): Our main chat agent receives the request. It doesn't know how to do everything, but it knows who to ask.
  • Delegation #1: The Order Agent. The Orchestrator uses A2A to send a simple, synchronous request to our Order Agent: "Find the last order for customer XYZ."
  • Delegation #2: The Inventory Agent. With the order details, the Orchestrator contacts the Inventory Agent: "Are items A, B, and C in stock?"
  • Delegation #3: The Calendar Agent. It then contacts our Calendar Agent, which is built using Google's ADK, to ask: "Check availability for customer XYZ on Friday afternoon."
  • Task Completion: The Calendar Agent confirms the time is free. The Orchestrator places the order and confirms the delivery schedule with the customer.

This entire workflow is seamless to the customer, but behind the scenes, it's a coordinated effort between multiple, independent agents. We can update or replace the Inventory Agent without touching the Calendar Agent. That's the power of this modular approach.

Scenario 2: Smarter Delegation for Cost Optimization

Not all questions are created equal. Some are simple, while others require serious brainpower. Using a powerful—and expensive—large language model for every single user query is like using a sledgehammer to crack a nut. It's wasteful.

A2A allows us to implement resource-aware optimization. Here’s how:

  • The Setup: We have a primary Triage Agent that first receives all user queries. Behind it, we run two different "thinking" agents:
    • Flash Agent: A lightweight agent running on a fast, cost-effective model like Gemini Flash. It’s trained to handle simple, high-volume questions like "What is my order status?" or "What's your return policy?".
    • Pro Agent: A heavyweight agent powered by a more capable model like Gemini Pro. This agent handles complex, multi-step reasoning, like "Analyze my purchase history and suggest products for my upcoming hiking trip based on weather forecasts for the region."
  • The Workflow: When a query comes in, the Triage Agent performs a quick assessment of its complexity. Based on keywords and intent, it decides which specialist to call.
    • For simple questions, it uses A2A to delegate the task to the Flash Agent. The user gets a fast, cheap answer.
    • For complex inquiries, it forwards the task to the Pro Agent. It costs more per query, but it delivers the high-quality, nuanced response required.

This A2A-driven routing system saves us a significant amount on operational costs and ensures that our computational resources are used efficiently, all without the user ever knowing about the complex delegation happening in the background.

The Bottom Line

For us, A2A isn't just another protocol. It's the glue that holds our advanced AI systems together. It lets us:

  • Build modularly: We create small, specialized agents that are easy to manage, test, and update.
  • Use the best tool for the job: Our teams can build agents using different frameworks without worrying about compatibility.
  • Optimize for cost and performance: We can intelligently route tasks to the most appropriate agent, whether that's based on skill set or the underlying model's power.
  • Scale effectively: We can run our agents as independent services, scaling them up or down as needed.

By enabling our agents to collaborate, A2A allows us to move beyond simple, single-purpose bots and build sophisticated systems that can tackle complex, multi-step problems in the real world.