liveBook · Manning

Chapter 10: Assembling Interoperable MAS with A2A

What you will learn in chapter 10 of Build a Multi-Agent System (from Scratch)

This introduction explains how A2A enables collaboration with remote agents across frameworks through standardized HTTP interactions and client-server roles.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains how A2A enables collaboration with remote agents across frameworks through standardized HTTP interactions and client-server roles.

Key terms: Agent2Agent protocol, A2A, HTTP, multi-agent systems, A2A client, A2A server, remote agent, MCP

10.1 How A2A works

10.1.1 Understanding subagents vs A2A agents

This section contrasts local subagents with remote A2A agents in execution and developer visibility.

Key terms: subagents, A2A agents, A2A server, tool calls, event loop, SubAgentSpec, LLMAgentBuilder, black boxes, agent framework

10.1.2 Understanding A2A’s client-server architecture

This section explains how A2A clients discover remote agents and exchange tasks and results with them through servers.

Key terms: agent discovery, AgentCard, well-known URI, HTTP GET, A2A client, A2A server, remote A2A agent, JSON-RPC, A2A protocol, communication

10.1.3 Understanding the A2A elements used in a task lifecycle

This section explains the A2A elements used to exchange task instructions, maintain task state, return results, and request additional input.

Key terms: Message, Part, Task, task ID, status, Artifact, input_required, TaskStore

10.2 Integrating A2A into our framework: client-side

This section introduces the client-side A2A integration and explains the role of the official Python SDK.

Key terms: A2A Python SDK, a2a-sdk, Message, Task

10.2.1 A2AAgentSpec: a core type for specifying an A2A agent

This section introduces A2AAgentSpec, its agent metadata and disclosure method, and its constructors for creating a specification from an AgentCard or server URL.

Key terms: A2AAgentSpec, A2A AgentCard, headers, timeout, catalog(), XML-formatted string, from_url(), from_agent_card(), AgentCard, discovery

10.2.2 Implementing UseA2AAgentTool

This section explains how UseA2AAgentTool dispatches tasks to registered remote agents and supports tasks that require additional input.

Key terms: UseA2AAgentTool, AsyncBaseTool, A2AAgentSpec, _a2a_agents_registry, __call__(), A2A Python SDK, A2A client, A2A Message, ToolCallResult, input_required

10.2.3 Updating LLMAgent and TaskHandler

This section updates the agent framework to use remote A2A agents and illustrates dispatch and input-required handling with a Hailstone example.

Key terms: a2a_agents_registry, _use_a2a_agent_tool, _a2a_agents_catalog, run_step(), UseA2AAgentTool, __call__(), tool-call execution, input-required, ToolCallResult, coordinator agent

10.3 Integrating A2A into our framework: server-side

This section introduces the planned server-side integration that will expose an LLMAgent as a remote A2A agent.

10.3.1 Wrapping LLMAgent in an A2A AgentExecutor

This section wraps an LLMAgent in an A2A AgentExecutor and traces how it executes, reports, and tracks remote tasks.

Key terms: AgentExecutor, LLMAgentA2AExecutor, execute(), cancel(), LLMAgent, RequestContext, A2A Task, TaskUpdater, Artifact, Message

10.3.2 Standing up an A2A server with the A2A SDK

This section outlines how to expose an LLMAgent through an A2A server and demonstrates a remote Hailstone task round trip and its process isolation.

Key terms: LLMAgentA2AExecutor, AgentCard, DefaultRequestHandler, FastAPI, a2a-sdk, A2AAgentSpec, coordinator LLMAgent, Hailstone A2A agent, subagents, remote A2A agents

10.4 MAS patterns using A2A

10.4.1 Router, Fan-out, and Chaining, but interoperable

This section shows how A2A extends familiar multi-agent patterns across framework and process boundaries through a mixed-agent chaining example.

Key terms: Router, Fan-out, Chaining, A2A agents, interoperability, coordinator LLMAgent, CrewAI A2A Agent, Hailstone subagent, UseA2AAgentTool, UseSubAgentTool

10.4.2 Limitations of our integration

This section identifies limitations of the framework’s A2A integration and outlines ways to address streaming, input-required workflows, and multi-turn context sharing.

Key terms: streaming, UseA2AAgentTool, ToolCallResult, LLMAgentA2AExecutor, StreamingLLMAgentA2AExecutor, SupervisedTaskHandler, input-required flow, rollout, LLMAgent, run()

10.5 Summary

Concepts explained in this chapter

← Chapter 9: Assembling MAS with Subagents

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.