From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)

What is A2A?

- [Instructor] In the past few chapters, we learned about MCP. In this chapter, we will discuss the concepts of agent to agent protocol, or A2A for short. In the next chapter, we will integrate the agents we built earlier with A2A. To understand the need for A2A, we need to discuss the challenges while building multi-agent systems. In a multi-agent system, multiple AA agents can collaborate with each other to execute business functions. Each AA agent can perform a specific function. An AA agent can leverage another agent to execute a business function. For example, a technical support agent can utilize a product knowledge agent to understand more about a product's features. As multi-agent systems evolve, we end up with agents that are built with different frameworks like Lang Chain and LAMA Index. They may also be deployed inside a single cluster or distributed across cloud services like AWS and GCP. They may be deployed by different organizations, and communication would require crossing organization boundaries. So when developers need to integrate two AA agents, they need to understand the custom interfaces and capabilities that each agent provides, and then build custom code to integrate them. As the number of agents in a multi-agent system grows, the integration complexity multiplies. There is also the need to discover agents ad hoc based on specific requirements and then dynamically connect to them. This requires the available agents to be discovered using a search engine like capability. The agent to agent, or A2A protocol, was introduced to specifically handle these challenges. It is a common open standard for agent to agent communications. Each participating agent in a multi-agent system can implement this standard once, and then it can communicate with any other agent implementing the same standard. A2A is a protocol similar to communication protocols like TCP, IP or rest. It provides a common transport layer as well as a message structure. It is modality agnostic. The content of the messages can be text, audio, video, or images. A2A also supports agent discovery. Agents can be published through a directory and other agents can discover them based on their capabilities supported. A2A also supports task-based workflows. So a given workflow can be created using multiple agents in an A2A enabled multi-agent system. It has support for access, control, security, and privacy. This allows A2A to be used for communications with agents across organizational and trust boundaries.

Contents