Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol
Back to Writing

Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol

Michael BrenndoerferNovember 10, 202514 min read2,248 wordsInteractive

Learn how multiple AI agents collaborate through specialization, parallel processing, and coordination. Explore cooperation patterns including sequential handoff, iterative refinement, and consensus building, plus real frameworks like Google's A2A Protocol.

AI Agent Handbook Cover
Part of AI Agent Handbook

This article is part of the free-to-read AI Agent Handbook

View full handbook

Agents Working Together

Throughout this handbook, you've built a capable personal assistant that can reason, use tools, remember information, maintain state, interact with its environment, and even make plans. But what if instead of one agent doing everything, you had multiple agents working together, each specializing in what it does best?

Think about how humans collaborate. When you're planning a vacation, you might ask a travel expert for destination recommendations, a financial advisor about budgeting, and a local guide for insider tips. Each person brings specialized knowledge, and together they help you plan better than any single person could alone. AI agents can work the same way.

In this chapter, we'll explore what it means for multiple AI agents to cooperate. You'll see how agents can divide work, share information, and coordinate their actions to solve problems more effectively than a single agent working alone. We'll start with the fundamental concept of cooperation, then look at practical ways agents can work together, and finally examine real frameworks that make multi-agent collaboration possible.

Why Multiple Agents?

Before diving into how agents cooperate, let's understand why you'd want multiple agents in the first place. Our personal assistant has grown quite capable, but there are scenarios where a team of specialized agents makes more sense than one generalist.

Specialization Creates Expertise

Imagine you ask your assistant: "Research the best laptop for video editing under $2000, check if it's in stock locally, and schedule a time for me to visit the store."

This single request involves three distinct capabilities:

  1. Research Agent: Needs deep knowledge of hardware specs, performance benchmarks, and current market prices
  2. Inventory Agent: Must check real-time stock across multiple stores and compare availability
  3. Scheduling Agent: Requires access to your calendar and the store's hours

You could build one agent that does all three, but each capability requires different tools, different knowledge, and different reasoning approaches. A research agent benefits from access to product reviews and technical specifications. An inventory agent needs real-time connections to retail systems. A scheduling agent works best with calendar APIs and time-zone handling.

By splitting these into separate agents, each can be optimized for its specific task. The research agent can use specialized prompts that encourage detailed technical analysis. The inventory agent can handle API rate limits and retries without affecting the others. The scheduling agent can manage complex calendar logic independently.

Parallel Processing

When agents work together, they can tackle multiple tasks simultaneously. While one agent researches laptops, another could be checking your calendar availability, and a third could be looking up store locations. This parallelism makes the overall task complete faster than if a single agent had to do everything sequentially.

Robustness Through Redundancy

Multiple agents can also provide checks and balances. One agent might generate a recommendation, while another reviews it for accuracy or potential issues. This is similar to how software teams have code reviewers, or how important decisions often involve multiple people.

Let's see a simple example of how this might work in practice.

A Simple Collaboration Scenario

Let's extend our personal assistant with a basic multi-agent setup. We'll create two specialized agents:

  • User Interface Agent: Handles all interaction with you, understanding your requests and presenting results
  • Task Execution Agent: Works in the background on complex tasks that might take time

Here's how they might collaborate on a research request:

1## Using Claude Sonnet 4.5 for its superior agent reasoning and coordination
2import anthropic
3import json
4
5client = anthropic.Anthropic(api_key="ANTHROPIC_API_KEY")
6
7## User Interface Agent - handles conversation
8def ui_agent(user_message, task_status=None):
9    """
10    The UI agent talks to the user and coordinates with the task agent.
11    """
12    system_prompt = """You are a friendly assistant that helps users with their requests.
13    When a user asks for something that requires research or complex work, 
14    you should acknowledge it and let them know the task agent is working on it.
15    When you receive results from the task agent, present them clearly to the user."""
16    
17    messages = [{"role": "user", "content": user_message}]
18    
19    if task_status:
20        # Include status update from task agent
21        messages.append({
22            "role": "assistant", 
23            "content": f"Task update: {task_status}"
24        })
25    
26    response = client.messages.create(
27        model="claude-sonnet-4.5",
28        max_tokens=1024,
29        system=system_prompt,
30        messages=messages
31    )
32    
33    return response.content[0].text
34
35## Task Execution Agent - does the heavy lifting
36def task_agent(task_description):
37    """
38    The task agent focuses on executing complex tasks without worrying about user interaction.
39    """
40    system_prompt = """You are a task execution specialist. 
41    You receive task descriptions and work through them methodically.
42    Focus on accuracy and thoroughness. Return structured results."""
43    
44    response = client.messages.create(
45        model="claude-sonnet-4.5",
46        max_tokens=2048,
47        system=system_prompt,
48        messages=[{"role": "user", "content": task_description}]
49    )
50    
51    return response.content[0].text
52
53## Coordination function
54def handle_user_request(user_input):
55    """
56    Coordinates between UI and task agents.
57    """
58    # Step 1: UI agent receives and acknowledges request
59    ui_response = ui_agent(user_input)
60    print(f"UI Agent: {ui_response}")
61    
62    # Step 2: Determine if we need the task agent
63    if "research" in user_input.lower() or "analyze" in user_input.lower():
64        print("\n[System: Delegating to task agent...]\n")
65        
66        # Step 3: Task agent works on it
67        task_result = task_agent(user_input)
68        print(f"Task Agent: {task_result}")
69        
70        # Step 4: UI agent presents results
71        final_response = ui_agent(
72            "Present these results to the user in a friendly way",
73            task_status=task_result
74        )
75        print(f"\nUI Agent: {final_response}")
76    
77    return ui_response
78
79## Example usage
80handle_user_request("Research the top 3 programming languages for data science and explain why")

Let's unpack what's happening here. When you make a request, the UI agent receives it first. This agent is optimized for conversation. It knows how to interpret your intent and communicate clearly. If the request requires deep work (research, analysis, complex calculations), the UI agent delegates to the task agent.

The task agent doesn't worry about being conversational. It focuses purely on executing the task accurately and thoroughly. Once it completes the work, it returns structured results to the UI agent, which then presents them to you in a friendly, understandable way.

This division of labor has several benefits:

  • The UI agent stays responsive: It can immediately acknowledge your request rather than going silent while processing
  • The task agent can take its time: It can use longer reasoning chains or multiple tool calls without worrying about keeping you engaged
  • Each agent has a clear purpose: The UI agent optimizes for communication; the task agent optimizes for accuracy

Patterns of Cooperation

Now that you've seen a basic example, let's explore different ways agents can work together. These patterns emerge repeatedly in multi-agent systems.

Sequential Handoff

The simplest pattern is a relay race: Agent A completes its part, then hands off to Agent B, which does its part, then hands off to Agent C.

1User Request → Agent A (Planning) → Agent B (Execution) → Agent C (Verification) → Result

Our example above used this pattern. The UI agent received the request, handed it to the task agent, then received the results back to present to you.

This pattern works well when tasks have clear stages that must happen in order. For instance:

  1. Planning Agent: Breaks down "plan my weekend" into specific tasks
  2. Booking Agent: Handles reservations and purchases
  3. Confirmation Agent: Verifies everything is set and sends you a summary

Each agent specializes in one stage of the pipeline.

Parallel Execution

When tasks are independent, agents can work simultaneously:

1┌─ Agent A (Research) ─┐
2User Request ─────┤                        ├─→ Combine Results → Final Answer
3                    └─ Agent B (Calculate) ─┘

Imagine you ask: "What's the best time to launch our product based on market trends and our budget constraints?"

  • Market Research Agent: Analyzes industry trends, competitor launches, seasonal patterns
  • Financial Agent: Calculates budget implications, revenue projections, cost analysis

Both agents can work simultaneously because they're analyzing different aspects. Once both complete, a coordinator agent combines their insights into a single recommendation.

Iterative Refinement

Sometimes agents work in cycles, each improving on the previous agent's output:

1Draft Agent → Review Agent → Draft Agent → Review Agent → Final Output

This is like having a writer and an editor collaborate. The draft agent generates content, the review agent suggests improvements, the draft agent incorporates feedback, and the cycle continues until the output meets quality standards.

Here's a simple example:

1## Using Claude Sonnet 4.5 for iterative refinement between agents
2def draft_agent(topic, previous_feedback=None):
3    """
4    Generates content drafts, incorporating feedback if provided.
5    """
6    system_prompt = """You are a content writer. Create clear, engaging content.
7    If you receive feedback, revise your work to address the concerns."""
8    
9    if previous_feedback:
10        prompt = f"Topic: {topic}\n\nPrevious feedback: {previous_feedback}\n\nRevise your draft based on this feedback."
11    else:
12        prompt = f"Write a brief explanation of: {topic}"
13    
14    response = client.messages.create(
15        model="claude-sonnet-4.5",
16        max_tokens=1024,
17        system=system_prompt,
18        messages=[{"role": "user", "content": prompt}]
19    )
20    
21    return response.content[0].text
22
23def review_agent(draft):
24    """
25    Reviews content and provides constructive feedback.
26    """
27    system_prompt = """You are a content reviewer. Evaluate drafts for:
28    - Clarity and accuracy
29    - Completeness
30    - Tone and readability
31    
32    Provide specific, actionable feedback. If the draft is excellent, say so."""
33    
34    response = client.messages.create(
35        model="claude-sonnet-4.5",
36        max_tokens=512,
37        system=system_prompt,
38        messages=[{"role": "user", "content": f"Review this draft:\n\n{draft}"}]
39    )
40    
41    return response.content[0].text
42
43def collaborative_writing(topic, max_iterations=2):
44    """
45    Draft and review agents collaborate to create polished content.
46    """
47    draft = draft_agent(topic)
48    print(f"Initial Draft:\n{draft}\n")
49    
50    for i in range(max_iterations):
51        feedback = review_agent(draft)
52        print(f"Review {i+1}:\n{feedback}\n")
53        
54        if "excellent" in feedback.lower():
55            print("Draft approved!")
56            break
57            
58        draft = draft_agent(topic, feedback)
59        print(f"Revised Draft {i+1}:\n{draft}\n")
60    
61    return draft
62
63## Example
64final_content = collaborative_writing("How do neural networks learn?")

This pattern is powerful for tasks where quality matters more than speed. The review agent can catch errors, suggest improvements, or ensure the output meets specific criteria, while the draft agent focuses on generation.

Consensus Building

When you need a reliable answer, multiple agents can independently solve the same problem, then vote or discuss to reach consensus:

1┌─ Agent A ─┐
2                    ├─ Agent B ─┤
3Problem ───────┤            ├─→ Compare & Decide → Final Answer
4                    ├─ Agent C ─┤
5                    └─ Agent D ─┘

This is particularly useful for critical decisions or when you want to reduce the chance of errors. If three out of four agents agree on an answer, you can be more confident it's correct.

Real-World Multi-Agent Frameworks

The patterns we've discussed are useful concepts, but implementing multi-agent systems from scratch can be complex. Fortunately, several frameworks have emerged to make this easier. Let's look at some of the most important ones.

The Agent-to-Agent (A2A) Protocol

One of the most significant developments in multi-agent systems is the Agent-to-Agent (A2A) Protocol, developed by Google as an open standard. Think of A2A as a common language that allows different AI agents to discover each other, understand what each can do, and work together, even if they were built by different teams using different technologies.

The key innovation of A2A is the concept of Agent Cards. Just as a business card tells you what someone does and how to contact them, an Agent Card describes an agent's capabilities, what inputs it accepts, what outputs it produces, and how other agents can communicate with it.

Here's what an Agent Card might look like conceptually:

1{
2  "agent_name": "Research Assistant",
3  "capabilities": [
4    "web_search",
5    "document_analysis",
6    "fact_checking"
7  ],
8  "input_format": {
9    "type": "text",
10    "max_length": 2000
11  },
12  "output_format": {
13    "type": "structured_report",
14    "includes": ["sources", "summary", "confidence_score"]
15  },
16  "endpoint": "https://api.example.com/research-agent",
17  "authentication": "bearer_token"
18}

With A2A, when your personal assistant needs research help, it can:

  1. Discover available research agents by querying an agent registry
  2. Understand what each agent can do by reading their Agent Cards
  3. Communicate with the chosen agent using the standardized protocol
  4. Receive results in a predictable format

This standardization is crucial because it means agents from different organizations, built with different frameworks, can still work together. Your assistant built with Anthropic's Claude could seamlessly collaborate with a specialized research agent built with OpenAI's GPT-5 or a data analysis agent built with Google's Gemini.

The A2A protocol also handles important practical concerns:

  • Security: Supports standard authentication and encrypted communication
  • Task Management: Provides structures for defining, tracking, and completing collaborative tasks
  • Modality Support: Works with text, audio, video, and other data types

Other Collaboration Frameworks

While A2A focuses on agent-to-agent communication, other frameworks address different aspects of multi-agent systems:

Model Context Protocol (MCP): Developed by Anthropic, MCP focuses on connecting agents with tools and data sources. While A2A helps agents talk to each other, MCP helps agents access the resources they need. In practice, you might use both: MCP to give your agents access to databases and APIs, and A2A to let those agents coordinate with each other.

Agent Development Kit (ADK): Google's ADK is a toolkit for building agents. Think of it this way: ADK helps you build individual agents, while A2A helps those agents communicate. They're complementary. ADK is the construction tool, A2A is the communication protocol.

LangGraph: A framework for building stateful, multi-agent applications with explicit control flow. LangGraph excels at defining complex workflows where agents need to maintain state and follow specific patterns of interaction.

Bringing It Together: A Multi-Agent Example

Let's build a more sophisticated example that demonstrates several cooperation patterns working together. We'll create a small team of agents that helps you plan a dinner party:

1## Using Claude Sonnet 4.5 for multi-agent coordination
2import anthropic
3from datetime import datetime
4
5client = anthropic.Anthropic(api_key="ANTHROPIC_API_KEY")
6
7class DinnerPlanningTeam:
8    """
9    A team of specialized agents that collaborate to plan dinner parties.
10    """
11    
12    def __init__(self):
13        self.model = "claude-sonnet-4.5"
14    
15    def coordinator_agent(self, user_request):
16        """
17        Coordinates the overall planning process and delegates to specialists.
18        """
19        system_prompt = """You are a dinner party planning coordinator.
20        Break down the user's request into specific tasks for specialist agents:
21        - Guest management (invitations, dietary restrictions)
22        - Menu planning (recipes, ingredients)
23        - Shopping (what to buy, where to buy it)
24        
25        Return a JSON list of tasks with agent assignments."""
26        
27        response = client.messages.create(
28            model=self.model,
29            max_tokens=1024,
30            system=system_prompt,
31            messages=[{"role": "user", "content": user_request}]
32        )
33        
34        return response.content[0].text
35    
36    def guest_agent(self, task_description):
37        """
38        Handles guest-related tasks.
39        """
40        system_prompt = """You are a guest management specialist.
41        Handle invitations, track RSVPs, note dietary restrictions and preferences.
42        Be organized and detail-oriented."""
43        
44        response = client.messages.create(
45            model=self.model,
46            max_tokens=512,
47            system=system_prompt,
48            messages=[{"role": "user", "content": task_description}]
49        )
50        
51        return response.content[0].text
52    
53    def menu_agent(self, task_description, guest_info=None):
54        """
55        Plans the menu based on guests and preferences.
56        """
57        system_prompt = """You are a menu planning specialist.
58        Create balanced, delicious menus that accommodate dietary restrictions.
59        Consider preparation time and skill level."""
60        
61        context = task_description
62        if guest_info:
63            context += f"\n\nGuest information: {guest_info}"
64        
65        response = client.messages.create(
66            model=self.model,
67            max_tokens=1024,
68            system=system_prompt,
69            messages=[{"role": "user", "content": context}]
70        )
71        
72        return response.content[0].text
73    
74    def shopping_agent(self, menu_details):
75        """
76        Creates shopping lists from menu plans.
77        """
78        system_prompt = """You are a shopping specialist.
79        Convert menu plans into organized shopping lists.
80        Group items by store section and estimate quantities."""
81        
82        response = client.messages.create(
83            model=self.model,
84            max_tokens=1024,
85            system=system_prompt,
86            messages=[{"role": "user", "content": f"Create a shopping list for: {menu_details}"}]
87        )
88        
89        return response.content[0].text
90    
91    def plan_dinner_party(self, user_request):
92        """
93        Orchestrates the full dinner planning process.
94        """
95        print("=== Dinner Party Planning Team ===\n")
96        
97        # Step 1: Coordinator breaks down the request
98        print("Coordinator: Analyzing your request...")
99        tasks = self.coordinator_agent(user_request)
100        print(f"Plan: {tasks}\n")
101        
102        # Step 2: Guest agent works on guest list
103        print("Guest Agent: Managing guest details...")
104        guest_info = self.guest_agent("Compile guest information and dietary needs")
105        print(f"Guest Info: {guest_info}\n")
106        
107        # Step 3: Menu agent creates menu (depends on guest info)
108        print("Menu Agent: Planning the menu...")
109        menu = self.menu_agent("Plan a dinner party menu", guest_info)
110        print(f"Menu: {menu}\n")
111        
112        # Step 4: Shopping agent creates list (depends on menu)
113        print("Shopping Agent: Creating shopping list...")
114        shopping_list = self.shopping_agent(menu)
115        print(f"Shopping List: {shopping_list}\n")
116        
117        # Step 5: Coordinator summarizes everything
118        print("Coordinator: Finalizing your dinner party plan...")
119        summary = self.coordinator_agent(
120            f"Summarize this dinner party plan:\nGuests: {guest_info}\nMenu: {menu}\nShopping: {shopping_list}"
121        )
122        print(f"Final Plan: {summary}")
123        
124        return {
125            "guests": guest_info,
126            "menu": menu,
127            "shopping": shopping_list,
128            "summary": summary
129        }
130
131## Example usage
132team = DinnerPlanningTeam()
133result = team.plan_dinner_party(
134    "I want to host a dinner party for 6 people next Saturday. "
135    "Two guests are vegetarian and one is gluten-free. "
136    "I'm a decent cook but nothing too complicated."
137)

This example demonstrates several key concepts:

Specialization: Each agent has a specific role and expertise. The guest agent knows about dietary restrictions, the menu agent understands recipes and cooking, the shopping agent organizes grocery lists.

Sequential Dependencies: The menu agent needs information from the guest agent (dietary restrictions) before it can plan effectively. The shopping agent needs the menu before it can create a list. This is a natural workflow where each step builds on the previous one.

Coordination: The coordinator agent orchestrates the entire process, breaking down the complex request into manageable tasks and ensuring information flows between specialists.

Information Sharing: Agents pass relevant information to each other. The guest agent's output becomes input for the menu agent, whose output feeds the shopping agent.

When to Use Multiple Agents

Multi-agent systems are powerful, but they're not always the right choice. Here's how to decide:

Use multiple agents when:

  • Tasks have distinct, separable concerns (research vs. writing vs. editing)
  • Different parts need different tools or knowledge bases
  • You want parallel processing for speed
  • You need checks and balances (one agent generates, another reviews)
  • You're building a system that will grow and need new capabilities over time

Stick with a single agent when:

  • The task is straightforward and doesn't benefit from specialization
  • Coordination overhead would outweigh the benefits
  • You need the simplest possible solution
  • The task requires maintaining context that would be hard to share between agents

Think of it like deciding whether to work alone or form a team. For writing a quick email, you work alone. For producing a documentary, you need a team with different skills.

Looking Ahead

You now understand the fundamental concept of agents working together: multiple specialized agents can collaborate through various patterns (sequential, parallel, iterative, consensus) to solve problems more effectively than a single agent.

In the next chapter, we'll dive deeper into how agents communicate with each other. You'll learn about message formats, protocols, and techniques for ensuring agents understand each other correctly. Then we'll explore the benefits and challenges of multi-agent systems in more detail, including how to handle coordination failures and optimize team performance.

The key takeaway is this: just as human teams accomplish more than individuals working alone, AI agent teams can tackle more complex problems by dividing work according to each agent's strengths. The art is in designing the right team structure and communication patterns for your specific needs.

Glossary

Agent Card: A standardized description of an agent's capabilities, inputs, outputs, and communication methods, similar to a business card for AI agents. Used in protocols like A2A to enable agent discovery and interoperability.

Agent-to-Agent (A2A) Protocol: An open standard developed by Google that enables AI agents from different platforms and frameworks to discover each other, understand capabilities, and collaborate through standardized communication.

Consensus Building: A cooperation pattern where multiple agents independently solve the same problem and then compare results to reach agreement, improving reliability and reducing errors.

Coordinator Agent: An agent responsible for orchestrating multi-agent workflows by breaking down complex requests, delegating tasks to specialist agents, and combining results.

Iterative Refinement: A cooperation pattern where agents work in cycles, with one agent generating output and another reviewing and providing feedback, repeating until quality standards are met.

Model Context Protocol (MCP): A framework developed by Anthropic for connecting agents with tools and data sources, complementary to agent-to-agent communication protocols.

Multi-Agent System: A system where multiple AI agents work together, each with specialized capabilities, to accomplish tasks that would be difficult or impossible for a single agent.

Parallel Execution: A cooperation pattern where multiple agents work simultaneously on independent tasks, then combine their results, enabling faster completion of complex requests.

Sequential Handoff: A cooperation pattern where agents work in sequence, with each agent completing its specialized task before passing results to the next agent in the workflow.

Specialization: The practice of designing agents with focused expertise in specific domains or tasks, rather than trying to make one agent handle everything.

Quiz

Ready to test your understanding? Take this quick quiz to reinforce what you've learned about multi-agent systems and how AI agents work together.

Loading component...

Reference

BIBTEXAcademic
@misc{agentsworkingtogethermultiagentsystemscollaborationpatternsa2aprotocol, author = {Michael Brenndoerfer}, title = {Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol}, year = {2025}, url = {https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration}, organization = {mbrenndoerfer.com}, note = {Accessed: 2025-11-10} }
APAAcademic
Michael Brenndoerfer (2025). Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol. Retrieved from https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration
MLAAcademic
Michael Brenndoerfer. "Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol." 2025. Web. 11/10/2025. <https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration>.
CHICAGOAcademic
Michael Brenndoerfer. "Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol." Accessed 11/10/2025. https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration.
HARVARDAcademic
Michael Brenndoerfer (2025) 'Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol'. Available at: https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration (Accessed: 11/10/2025).
SimpleBasic
Michael Brenndoerfer (2025). Agents Working Together: Multi-Agent Systems, Collaboration Patterns & A2A Protocol. https://mbrenndoerfer.com/writing/agents-working-together-multi-agent-systems-collaboration
Michael Brenndoerfer

About the author: Michael Brenndoerfer

All opinions expressed here are my own and do not reflect the views of my employer.

Michael currently works as an Associate Director of Data Science at EQT Partners in Singapore, where he drives AI and data initiatives across private capital investments.

With over a decade of experience spanning private equity, management consulting, and software engineering, he specializes in building and scaling analytics capabilities from the ground up. He has published research in leading AI conferences and holds expertise in machine learning, natural language processing, and value creation through data.

Stay updated

Get notified when I publish new articles on data and AI, private equity, technology, and more.