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

A2A discovery strategies

- [Lecturer] In a multi-agent network, how do agents discover information about each other? In a previous video, we discussed the Agent Card. This card contains all details about a given agent. To know more about a given agent, another agent can retrieve the Agent Card of that agent and understand the features it supports and the interfaces that can be used to communicate with it. But before we can discover the features of an agent, we need to sometimes discover the agent itself. In a world of agents, how do we know the list of agents that exist, and then search and pick an agent that suits our requirements? The first way to discover agents is by deploying agents in a well-known URI. Here, the agent is built as an A2A server agent, and is deployed with a known URI. The URI is well-known, similar to google.com, or it is an internal AA agent whose URI is published inside the organization. The agent will host its own Agent Card. The path to this Agent Card is a standard path. An example of such a path is given here. Clients can use the published URI and the Agent Card path to retrieve the Agent Card and then discover details about the agent. This mode is suited when the client agent already knows which server agent to use during design time. Dynamic discovery and use of agents during runtime is not possible. The second option is by using curated registries. This is a central registry where all the A2A agents are published. Their Agent Cards are registered here and are available for discovery. Central registries also provide search functions to filter agents based on their desired capabilities and choose the right one to use. The clients in this case should only know about the single registry API. Then, clients can search the registry for the right agents and retrieve their Agent Card. The Agent Card contains the actual URI for the agent. Registries enable dynamic discovery of agents and integrate with them during runtime based on the specific use case or workflow. Registries help govern available A2A agents. For example, an organization can host a central registry for all agents that were built in an organization. This allows for enforcing standards, security, and access control.

Contents