Build a multi-agent system: A2A & Agent Registry
Key Takeaways
Build a multi-agent system using the Agent2Agent (A2A) Protocol and Agent Registry, with a production-ready implementation on Google Cloud Tech
Full Transcript
The core problem is we have everything fragmented. We have multiple different agents and all of this may be spread across your cloud, your on-prem, anywhere else. And this creates massive sprawl across. To address that, we can use agent registry as a solution. >> First, you will go to the Google registry to find the registered dog and then you will call the remote A2A agent and then it's going to connect you know dog worker agent and trying to plan how to work my dog. >> What are the other modes of communication that we can have like an asynchronous? >> Uh for example, I'm going to uh bubble tea place and I'm waiting for my bubble tea. So, I just keep calling you to see hey Sita, is my bubble tea is ready? So, one way is you can just calling to handling this uh this is request. Hello everyone. Welcome to hands-on AI where we walk you through AI step-by-step and Annie. And today, I will introduce you one of my favorite co-workers, Sita. Hi Sita. >> Hi Annie. Hi everyone. My name is Sita and I'm a developer relations engineer at Google Cloud. So happy to talk with you Annie and everyone on A2A agent registry today. >> Yeah. So happy to have you. So, what we're going to cover today, Sita? I know that we're going to start with A2A protocol. Some people may already familiar with it, you know, this is to help agent discover with each other with agent card. What's next, Sita? >> Absolutely. The next logical step that we have today is the agent registry. So, we've been talking about A2A protocol for a year now, right Annie? And we know agents communicate using A2A protocol. But when you have 50 different or 100 different agents, how do you know what exists in your org? How do you manage them? How do you know who owns them and how do you call them dynamically? These are a few of the interesting questions that agent registry answers and we'll see them today. >> Yeah. So, by the end of this episode, you will have everything you need to know to build a production-ready multi-agent system with A2A protocol and agent registry. And let's get started to learn them. All right. So before we get start and deep dive, let's quickly recap of what we've done earlier in the previous episode. In the previous episode, we covered about Marathon race condition on repo and there's a Marathon simulator app. And I just quick recap of the architecture we're using in that repo. So basically we had a front end client. We have a back end Python agent service and and between them we have this go gateway that handles communication. And the go gateway we have this hub. Basically they can communicate with all the agent. So we are connecting with all we are basically putting all the agent and let them connect to each other through A2A and also put them to the hub. This is now the modern way of, you know, let agent to agent to communicate with each with each other. So today we're going to also show you what is a modern way of how agent discover each other and connect to each other. And also in the Marathon app, we talk about two dispatch modes. Uh we have this cobble mode and subscriber mode. And they're different type of agent. We also define that in our A2A. So in order to understand those complicated example, let's go back to simple and we were going to work through, you know, what is A2A, how to use A2A in more comprehensively with a simple example and by the end of today's, you know, episode you will know the basic and also how to build a more complex example from those simpler example and more comprehensive work through. How's that sound, Sita? >> Fantastic. But before you jump to the demo, I really want to hold in on the basics here. So how would you explain A2A in a simple manner to those who have never used it? >> Yeah. So if you take a look, you know, at this diagram like picture on the screen, we have this A2A you know, we have this A2A protocol. So basically A2A stands for agent to agent protocol. And Google announced it last year. It's almost, you know, oh my god, it's it's more than a year right now. And to understand what is A-to-A, you can think of it as HTTP, but for AI agent. You know, for HTTP, if you're familiar with HTTP, basically, no matter it it doesn't care if you're running like Apache or anything. Any browser can talk to another web server. And similarly for A-to-A, you know, it doesn't matter if you're building with Google agent development kit ADK for your agent, or you're like to build your agent with LangChain or LangGraph, or or your Crew AI, anything. If they speak A-to-A, they can discover with each other and hand off task and stream results like together. So, with no custom glue because because they all speak A-to-A. So, that's the magic of A-to-A. And yeah, that's the point. >> Great. So, what are some scenarios that we should use A-to-A for? >> Yeah, that is a great question. You know, um I recently find it's very helpful just simply in the multi-agent use case. A lot of time that you're building a system that you may not like one agent may not be enough. I know that you can simply put all the prompt all the logic in one prompt and build a very like a powerful super agent to handle everything. However, in a lot of use case, especially production use case, it's um you probably want to have multiple agent and one agent responsible one thing, and you want to connect them together. But to connect them together in A-to-A, it's a great you you know, it's a great use um it's going to be really powerful in this use case. However, uh you probably say that, you know, you can have you can glue all the agent together locally together, but why you need to have A-to-A, right? Cuz you know, ADK, for example, ADK uh ADK one it does have workflow agent. You can simply just uh put agent to sub agent, or you create a have workflow agent like sequential agent together. They can easily put together. Why you even need a A2A to glue them together, right? So, basically, without A2A, you know, each agent, you know, you have to have the custom HTTP, you have to like define exactly how to communicate how to custom custom auth. You have to like have the manual URL line. It's a lot of work. And the another another like headache is, you know, it's tightly coupling. Imagine that you have like multi-agent system all local and deploy them in the one server. And later on you want to change the direction. Later on you want to maintain it or fix something. It's it's like it's very messy cuz you have to basically rewrite the whole thing, redeploy the whole thing, right? But if it's A2A, imagine you have A2A, you have like one agent deployed to a server, and then you can just go to the one specific agent, and then, you know, rewrite that and fix that, and then, like, updating your production system. So, it's like with A2A it's a loose coupling. It's a lot easier to extend, to modify, to maintain. And of course, they're easy to discovery, which we're going to deep dive in our agent registry part. >> So, you've explained why A2A and what is A2A, but how How do these agents communicate with each other? >> Yeah, that is a good question. So, think of like us human, we want to connect to each other. How you connect? You probably want to like let's connect on LinkedIn, and I go to see your LinkedIn profile to understand what you're doing and how to like what what is specialty and how do I how do we collaborate, right? Similarly, for agent, they also have their name card. An agent name card is agent card. An agent card is also similar to our LinkedIn profile, our name card. It specify what this agent skills, what they can do, what their capability, and how to connect with them, how to do us, stuff like that. And then they can just have this card so that they It's like their identity. And then, once they have this card, you know, with A2A protocol, for example, I have this one agent, I want to connect to another agent, and I basically want to get all the valuable agent card so that I can choose, okay, which agent is the agent I want to choose from, I want to talk to. So, once I know the agent I want to talk to, and then I will just send a task and I'll connect uh like this through A2A protocol. So, that's the the basic concept. >> Wonderful. So, we're using agent cards to identify skills of the other agents to connect. Great. Can you walk through an end-to-end scenario of how this might play out? >> Yeah, sure. Um so, to to you know, like if you take a look at the screen right now, maybe it's a lot of things going on, but then we can just take a look at by different different use case and how they how how do they actually connect? So, let we can start with like a simple use case. You know, imagine you only have two agent like uh have a client side and a server side server side remote remote agent. For example, the client side is the one I want to uh so, I have a agent A, I want to using agent B, right? So, agent A can be the client side and agent B is the uh remote server side, right? So, first, I need to like expose This is this agent B The agent B needs to be discoverable. And then um and then agent A starts to know, "Okay, who are you? What can you do?" by reading the agent card, right? So, I'm reading the agent card, I'm like, "Okay, reading your agent card, this is what you can do." And agent card is actually in this /agent_card.json file. So, this agent card is like the the business card of the agent, and then it tells the client side, "Okay, what what it can do and how to connect to it." And once it read, "Okay, this is what you can do, this is how you can how I can connect to it. And then I decide, "Okay, uh what is the URI?" And then um and then like what is the protocol binding? Like for example, it's a HTTP JSON. And then uh agent A will send a request to agent B uh to using that URI so that you will then connect into this agent. Right? So, this is like how it looks like the basic interaction. We have this uh message object. It contains the role. It contains the multimodal data or JSON. And then they just uh communicate with each other. Like simple use case, right? Uh yeah. >> I think that you had uh synchronous there um in the slide. So, what are the other modes of communication that we can have? Like an asynchronous? >> Yeah, so imagine uh for example, I'm going to uh bubble tea place and I'm waiting for my bubble tea. So, uh I probably So, what So, I might I might want to just have a uh synchronous use case to say that, "Oh, I want to check if my bubble tea is ready." So, I just keep polling you to see, "Hey, Sita, if my bubble tea is ready, can you just uh um can you check if if my bubble tea is ready?" So, I'm just keep polling. So, one way is you can just polling to handling this uh this request is like agent A is like me, agent B is like bubble tea uh working at bubble tea, and I just keep asking, "Oh, is my bubble tea is ready?" And just keep polling. And then I just uh check the result. Right? So, another use case for asynchronous can be um you know, but if I keep polling, it's not very efficient. I basically have to stay in the store, and I just keep asking, and it's it's annoying, and then it's like using up my time time, right? So, another use case can be uh another way for asynchronous can be, you know, I have this real-life update. I have the streaming with SSE. So, basically, whenever I'm subscriber to this bubble tea place, and then whenever the bubble tea is ready, I can get this, uh, not push notification, and then I'll able to come and fetch my bubble tea, right? So, this is another way of doing that. And you can all configure that with A2A. But, to, um, go deep to this more complex example, we can start with a simpler example to see how we define A2A and, uh, how does multi-agent system work with A2A? Let's get started. >> Let's do it. It's demo time. >> All right, I'm going to show this demo. The reason I build this demo is, you know, I have a dog. I know you also have a dog. And we need to walk our dog. However, sometimes we might need to go to a business trip, or we might, you know, go to somewhere else. We might want to ask a dog walker to help walk the dog. So, as a dog walker, you need to plan the trip to walk the dog. And I also, you know, if I want to go to a go for business trip at a different location, I want to plan the trip at the same time. I need to take care of my dog. I need to plan how to walk this dog. So, that's why I'm building a multi-agent system that I want have one agent responsible for how to walk this dog. Another agent is doing, you know, how to plan the trip. At the same time, you know, um, to walk no plan working the dog. So, in this scenario, when I do the planning the trip, I need to communicate to my dog walker agent. And that, uh, I'm going to demonstrate through A2A. And later on, we're going to demonstrate, uh, with agent registry and A2A, um, in this simple multi-agent example. So, I'm going to first show you about this dog walker agent. All right, so, what you're looking at is, uh, it's agent written by Google agent development kit in 1.x version. It's not 2.0 version. It's still 1.x version. And similarly, you know, here we're using LM agent. Uh, it's a single agent. And here we have the name is dog walker agent. We're using Gemini 3 flash model, um, to use a brain to identify logic. And as the tools, we have this, you know, uh, we have this get dog profile to understand the dog, and then get the local weather, finding the park, finding a walk route. And here in the instruction here, I basically first learn more about the dog situation so that I can better plan how to walk the dog, you know, I have a small dog, I cannot just take her to like walk her so far away. I need to be aware of the dog breed. And then I need to check the weather if it's raining or not. And then I need to find a nearby dog parks with Google Map API. And then, uh, I I need to design the location with dog's energy and the weather, and then getting the route so that I can have the route, uh, where to walk them, and then return the the result, right? So, this is the example of it. I'm going to quickly, uh, show you in ADK Map UI. So, what you're seeing right now is ADK Map UI. And first I want to select in the dog walker agent, which is show, and then I'm going to just test it by asking the question. Let's say, "Oh, walk Bobby this afternoon at this location in San Francisco." And let's see. Just to verify the agent's working. And later on, what we're going to do is we want to like create a planner to planner agent that connecting to this dog walker agent. And to do to connecting to this agent, we want to first, uh, expose this agent, ADK agent, to A2A agent as ADK remote agent. And then another agent going to connect into this remote agent through A2A protocol. So, that's what I'm going to demo for you. But now just to quickly verify this agent's working. So, now you can see first it's checking the tools, getting the dog information, weather information, and then planning the route. And eventually it's sending me, "Okay, this is the Bobby's information." And then this is the route. And this is the warning. And I can even go to the map over here to view it. Very It's amazing, right? You can see the see the view over here. So, now we know how the stock broker agent works. So, and then let's see how do we convert this to A2A like wrap this to A2A remote agent so that other agent can communicate them. How do they speak A2A and how do they view that agent card and like mystery, right? Okay, so next let's take a look at the A2A part. So, how I do this is first you go to the server. the python file. So, at the server.python file you will see we have something called to A2A. So, basically with ADK we have this to ADK library that we can just wrap our ADK agent to A2A. And here we know that you can see that we have this agent card implementation. But see that I wonder is this necessary or do I have to build my own agent card for this agent identity? >> Not every time actually. So, if there's an optional parameter in 2A2A, so if we don't add it the the agent card will automatically get created for us. >> Wow, I see. So, sounds like we have option to either to like specify our own agent card with custom, you know, skills and forge like sounds like we're trying to specify the port here or we can just use default one. But here we're having this agent card library to add our own customization with our skills and more. So, this is essentially your call on how do you specify our agent card? And to to show you how does the card look like and let me show you this is how the agent card look like over here. Now, if you take a look at the screen this is basically the agent card look like. This is a JSON format and it's talking about okay, what is the description of what this agent and the name of what this agent can do and this is a skill of this agent. Basically, it can planning the route for walking the agent and more. So, and also it has a URL. And this URL is where where other agent can connect to it. So, basically now this agent has all the information. Imagine this is just like a linking file, you know, profile or name card for this agent so that another agent know what is the what this agent does and how to connect to this agent. Basically, connect to them through this URL. And then let's take a look at, okay, now I have another agent and I want to connect to it. And how do I do that? So, let me show you what is another agent. So, now let's go back to our VS code. And here my another agent is called trip planner agent. So, here basically I want to I want to have a trip planner agent that's planning the trip for like a shopping. For example, I want to visit visit visit you see that where you base it. >> I visit of Toronto, Canada. >> Yeah, so if I want to like go Toronto for a quick trip and then >> [laughter] >> and then I want to use this trip planner but also I want to take care of my dog. So, basically I'm using this trip planner to first understand, you know, what is the weather of Toronto and then what are some fun place over there. And then after I planning this, I also want to, you know, take care of my dog. And then in this scenario, I want to call my dog worker agent. So, remember previously we are we are we have we installed our agent and we wrapped them with A2A remote agent. So, now I this is a client agent and then the dog worker agent is a server side. And the client I want to talk to the server side, right? So, here I want to connect them through the A2A URL. And this is exactly how I how I do them is I have this call dog worker with this this call by URL. >> Yeah, so basically this card URL is very used to see the agent card where I just show you. And URL is very I'm connecting to this agent. And if you go back to my um trip planner agent, I simply just specify the logic and I'm using this um So, I'm using those tools and one tool is called dog worker by making that call to remote A2A agent and that is how I build this planner agent. So, Sita, looks like it is working, right? It's working really well for two agents. Right? What about we have more more agents? What is really a best practice in our scenario? >> Great question, Annie. Which is why we need to talk about agent registry. And before we go into what agent registry does, we need to acknowledge what's the problem, right? So, the core problem is we have everything fragmented. We have multiple different agents, like what we saw with the dog walker and the trip planner, right? These are two different agents, but there could be more. There could be hundreds of agents in your organization. And same with MCP servers and endpoints. And all of this maybe spread across your cloud, your on-prem, anywhere else. And this creates massive sprawl across agents, MCP, and LLM. And to address that, we we can use agent registry as a solution. Because number one, agent registry supports reusability of agents and tools. So, instead of uh adding your dog walker and MCP as sub agents to your orchestrator agent, you can instead register them with agent registry. And we'll see how to register it further down. But you can register them with agent registry and then use it across any agents in your organization. >> Yeah, but this sounds really cool. In my demo, I just directly connect to a to a URL, but why we still want to use this, you know, agent registry? >> That's fantastic question. We're not only solving for reusability, right? We're also solving for how we connect fundamentally to these agents and tools. So, if you have many different tools, MCP servers, each of them having their own requests and response and nuances to connect, same with agents, we're basically looking at a lot of plumbing work of how do you connect these systems with our agents, right? But agent registry also simplifies and standardizes how you connect across these different resources or assets with just one way. >> I see. But what are other advantages agent registry provide? >> I'm glad you asked. With this my third point actually, which is governance and audit. So, agent registry also brings the goodness of, uh, you know, cloud systems like audit compliance, cost, and then risk monitoring across cloud, one central view, logging, and all of that additional stuff you might want for your auditing. So, these three are the fundamental things that we're trying to address with, uh, agent registry. >> Is agent registry limited to Google agent development kits with, uh, Google Cloud Run? >> No, not at all, actually. So, as we go through the demo, we'll also show you the console, but agent registry, you can bring in first party or even third-party agents that are not written in ADK. You know, your agent could be written in LangGraph or CrewAI, hosted in another cloud, hosted on prem. No matter where you have them, you can still bring in third-party agents and MCP servers. >> I see. Sounds really powerful. So, now I know why I should use agent registry, but can you show me how do I register my agent? You know, I just create my doc worker agent and trip planner agent. How do I register them so that I can, you know, take advantage of this cool feature? >> That's a great question, Annie. And here I've brought up my code that you actually showed us, you know, the dog walker and the trip planner agent. And we're going to register both of those agents to agent registry. So, we're going to start with this uh register.py file, which runs this gcloud command as a sub process. You can run it individually, but since we're building a multi-agent system in Python, I'm going to use this register.py file to run the command. And what this does is it creates a new service under agent registry. It takes the dog walker's agent card. And then once you run this command, it registers it. >> Oh, I see. Let's go ahead and register those with gcloud. >> Yeah, so I'm going to >> Oh, why you're running a shell script, not gcloud? >> Yeah, great question. So, what the shell script does is let me go to the deploy.sh local. This has a bunch of commands, and this is going to deploy both those A2A agents locally for us, and then register the dog walker agent with agent registry. And you can see I've commented out the trip planner here, which will come later on. I want to show you how to register this agent via the UI console. So, basically the shell script deploys both the agents locally as A2A agents and registers the dog walker. >> I see. Let's go ahead and deploy them and register our agent. >> Yes. I've just started it, and let's give it a couple seconds for uh for it to finish the job. >> Yeah, for those folks who wonder how we deploy them, basically we're running a server.py file I just explained to you. So, let's see. >> Okay, now we see that both the agents have been um have been deployed. And let's go to the console, and let's quickly confirm if that's the case. >> Oh, where are we? Are we at the agent registry at agent platform? >> Right. So, this is the agent platform and we're under the registry in agent platform. Uh let me zoom out a little bit so you can see more of the console. And so, this is the agent registry under agent platform. So, as as you see, I've I've hidden the system-generated agents. So, these are basically agents that are automatically generated in the console. And this is the dog walker agent that we just deployed. And you can see it has an ID and then it is deployed where it had follows the 8-way protocol and it also has a set of skills if you see. So, the skills are automatically picked up. When you register an agent, the skills are picked up and it is shown here in the console. Just for convenience. >> Yeah, so this this skill is a little bit different from the skill where we might be familiar with cuz you know, whenever you're creating things with my coding agent or coding agent or you're creating your own agent with skills, a lot of times skill probably refer to empty file and that is helping you do certain things or connecting certain things. And then but here the skill is simply to explaining about what this agent can do so that when the client agent discover this agent, it knows about the skill and then know whether it should interact with this server-side agent as well, right? >> Absolutely. That's a fantastic call out. Yes. So, these are not to be mapped to the NPX skills that we use. These are instead metadata for the client, uh meta metadata for your agent to find this remote agent when it calls each other. So, now, once we now that we've deployed the dog walker agent, let Why don't we go ahead and deploy our trip planner agent, you know? To do that, >> We're going to do it the same way with G Cloud? >> No, we're not going to use G Cloud for that. Instead, so going to be using Cloud Console, but I'm just going to show you the agent that we're deploying. So, this is the same agent that Annie walked through us, and we have the agent card here for the agent. And now, let's go ahead click on add agent, and this again is an A2A agent. I'm going to select the region as global and paste from JSON. And I have the JSON for the agent. I'll scroll down and click save. Let's give it a couple seconds, and you should see the Yes, the Trip Runner agent is now registered, and the skills for those agents are here, and this agent is good to use. >> Wow. Super cool. So, what we just saw is we saw how to how to register them through either G Cloud command or um directly on the UI. >> Absolutely. And a good call out here is Here is also agent registry. Even though the name has agent registry, it still supports two other capabilities, right? You can also add MCP servers to it, or you can also add endpoints, which are basically any endpoints that you want your agents to use. You can put them all together in one single place. >> Wow. That's super cool. So, when I open this registry, does it already have some preloaded MCP server or agent that I can connect to? >> Absolutely. Yes. So, most or all of Google and Google Cloud MCP servers should be here already pre-populated for you, and you can also discover other Google Cloud MCP servers from this list, enable the APIs, and it should be already available to use from the console. >> Very convenient. It feels like I have a yellow book or like a phone book. And then whatever I need in this multi-agent system, no matter it's other agent or MCP server or like even like anything in the school cloud ecosystem, I can just all find it here and connect it to it. Super It's like a place that puts together all the necessary useful things and I can just directly use them. >> Absolutely. And so all of these are also vetted agents and MCP servers, you know, so you can also set policies saying these are the only agents that are allowed to that you can you're allowed to use or these are the only MCP servers that you can use. And these can be done with a something called agent policies, but that's currently in private preview. So once it's available in public preview, you can use that to say my dog walker agent or my travel agent can only talk to my dog walker agent and nothing else. >> Very cool. So now I So what we done so far is we use the dog walker agent and trip planner agent. We all have the remote agent and we they're all registered in the agent registry. So what's next is we want to like connecting them through agent registry, not directly using agent URL. So now my question is uh how do I how do I connect to them? >> Great question, Annie. So there are two different ways to do this, you know, so one, we can directly take the agent ID or the MCP ID once we've registered in the console and use that in our agent. But that's not going to be super useful, right? Our agent registry has tons of different agents and MCP servers and you might want to call them depending upon the prompt or depending upon your use case. And to do that agent registry exposes an MCP server. So from the code, we using agent registry's MCP server to connect and fetch agents and tools dynamically. So that's the code that you're seeing here. We're initializing the registry and providing it headers. >> I see. But even like I know we have MCPs uh tool to MCP server to connect to agent registry. I know that they already registered, but how do I know I connect to the right one? >> That's a great question, Annie. So, I've scrolled down here to the agents instructions, and this is where, let's say for example, we're we're giving a prompt to our agent saying, "Plan a trip to Tokyo." So, the agent is going to use this prompt, use the agent registry's MCP server, pass it a few tags, and the registry's MCP server is going to implicitly identify the right agent or tool to carry out that specific function. And this is where the agent skills, the ones that we saw in the console, actually come into play. Because the agent, the MCP's, sorry, the agent registry's MCP server is going to use that information to map to our prompt. >> Oh, okay. So, that skill is really helpful for them to discover. >> Yes. So, once we have this, uh, agent registry's MCP server, we've written down the instructions of how to find our specific agent or a specific MCP tool, the second thing is to call that specific agent or tool once it's once it's been identified, right? So, your agent registry's MCP server, what it can do is return you the specific agent or MCP tool, but you still have to do the manual job of calling that specific agent or tool. And to do that, I'm going to switch to A2A client definition here, which is specific for our call remote A2A agent. >> Yeah, I remember previously it was only just to, uh, do the URL, right? How how's different this way? >> Right. So, in we used to hardcode URLs here, but now we rely on the agent registry's MCP server to give us the URL dynamically, and that URL is what is going in here. >> Oh, that way we don't have to, uh, you know, worry about a hard code and, cuz, you know, what if the URL change, right? What if information change? And this way it seems like it's, uh, it's more it's more scalable, extensible this way. >> Absolutely. And we can do this not only for A2A, but the MCP tool is also going to follow a similar approach, you know, we're going to rely on the registry to give us the endpoint, and then we'll make the MCP call. >> Yeah. So, for those who are watching this video, you know, we are making a API API call for Google Maps. But, if you want, you can try use a similar logic, uh, and use Google Map MCP server with agent registry to, you know, give a try to see how it's a different, you know, uh, just also a good practice for you to understand agent registry and understand how to use MCP server, right? Uh, a good practice for those of you homework for you >> [laughter] >> for those of you who are watching it right now. >> Yeah. >> Absolutely. Yeah, that's a that's a good exercise. And with that, I think we should move to the demo for how all of this works together. >> All right. So, you're looking at the screen that we just had with a dog walker, right? So, what's next is I want to show you the trip planner. So, for trip planner agent, um, here basically I want to, uh, plan a trip. So, I can just first try, okay, I just want to plan a trip, uh, weekend in Ki- uh, Kyoto and then foodie, I want to do the low budget. So, this example is I simply just want to plan a trip. And, um, next, uh, so, after this simple planner, I also want to give another try to see how do I, um, plan a trip to take care of my dog as well. But, let's first just see the trip planner to see if it's working and uh just like what you're saying that first is trying to find a weather, trying to find attraction. So now you can see that it's looking for the registry search agent first because it's need to connect to the doc worker agent. And how how it's doing that is first it will go to the Google registry to find the registered doc. And then it will call the remote A2A agent because we're we're we have wrapped our agent to remote A2A agent already. So that we have the agent card. And then uh it's going to connecting the doc worker agent and trying to plan how to walk my dog. Cool. So now if you see the results we do have a trip summary for the trip. And also we have this uh So in the trip summary we have how to um how to explore the city. We also have the pet care for Bobby. And then it says since Bobby is high energy Oh, see that? How do you say this? Labrador? Labrador. Yes, Labrador. Okay. And he will have many consistent activity. So here is a two-day trip. Um here is a suggested care routine for your two-day trip for to keep the Keotal. So basically uh it's suggesting how to take care of the dog at the same time. All right, so this is a simple example of for you know this trip planner agent is connecting to uh a doc worker. But what if you want a more complex example? For example, you want to connecting to both have an auxiliary agent to connecting both triple agent and also doc worker agent. In this scenario um we have multiple agent. Uh so to do that in our agent code. So here uh is our sequential agent. So basically we have multi-agent system, and then we have this different uh top like we have this different sub-agent over here. We have this A2A dispatcher, and in the A2A dispatcher, we have this call A2A agent that basically just directly call the A2A uh like remote agents through their URI over here. So, this is an example of how do you connecting them directly A2A URL, but now because we already registered them both of them in agent registry just like Cida just show you. Now, agent that uh using agent registry instead of uh directly calling the URI, we having we're using this call remote agent. So, that's basically the way you're doing this with directly calling the A2A URI. And let me show you how to do it with agent registry. You know, like um Cida just show you um that we have both agent registry with agent registry, and Cida also show you the like how we using the registry MCP faucet, and connecting to the agent remote. So, this example is Australia agent. And this Australia agent basically we define a specific workflow, and we want to connecting to both agent the both stream panel agent, and also the uh dark worker agent. >> Yeah, that's the old way, right? I mean, so we used to add them as sub-agents with our registries, but now that we have registry, how does the orchestrator agent change? >> Yeah, that's a great question. You know, like you just show us that how those agents are in the agent registry, right? And you also show us how to use the MCP server to connecting to the uh registered agent. So, here is basically how we can do it differently is here we in the A2A dispatcher, we're using this call remote A2A agent. This is exactly you just show us uh basically um yeah, basically it is defined, you know, how do we using the registry to get the registry that's just agent and connecting to it. Uh so now in this new way I can also give a quick demo of what does the result look like. So now I'm going to my auction agent and I'm going to ask question about walk Bobby this afternoon and also plan a today trip to Lisbon. Okay, so let's see how this auction do. Work. So what are expected to do is first of all go to what the age like agent registry using the MCP tool to search the register the agent you want and then it will call remote uh uh A2A to connecting to the agent. See first it is like registry search agent trying to finding the which agent you want find and then it will search the agent. >> Right and it repeats the same for both the agents, right? So call registry to find both different agents, get back their IDs and then you use the call remote A2A function to actually call them. And while we wait for the response actually, so if the viewers of the video also replace our hardcoded tools with MCP server, the overall flow is going to be our orchestrator agent uses agent registry's MCP server to find two different agents, dog walker and trip planner and gets back the IDs for the orchestrator to call. Internally, each dog walker and trip planner will call agent registry's MCP server to find MCP tools, the Google Maps MCP tools to invoke them. >> Yeah. So for those of you who are actually try this is Google Maps MCP server still agent registry. You can yeah, I definitely encourage you to try it and like while you test it in the agent UI you will see um how it's different from the current um trajectory. >> Yeah, and let us know in the comments if if there any blockers or if you've successfully made it. >> Yeah, looks like we have a result. Let's take a look. Wow, so first thing you will have a trip summary about what are the beautiful view we have. And then it has a pack here. Oh. Yeah, sounds like it is working. Right. So, just a quick recap of what we've done so far is first we learn about what is A2A and how to do with A2A. And then uh we create a simple agent here with stopwatch and trip planner and we are we are wrapping them with remote A2A so that we are we are converting the agent local agent to the remote A2A agent with agent card to identify what the agent does and how to connect into agent. And then we showed two different way of connecting agent. One is directly with A2A UI. Another one Another way is we showing how to use uh agent registry and Sita also walk you through uh how to register the agent and how to connecting those agents through the agent you registered. But we learned so much about A2A agent registry. I'm also curious about, you know, the auth. For example, how do I know uh if the agent is correctly authorized? Can you maybe share more about that part? >> Yes, good question, Annie. So, many different agents and tools have their own authentication requirements, right? So, here in order to authenticate to those agents and tools, we using Google's auth default. And this fetches Google's application default credentials. So, basically, if you if you are authenticating authenticating using G Cloud auth login or you using service accounts here, that would be a primary form of authentication that your agent will use to communicate to those agents and tools. But, let's say you want to use users credentials, the the user who's calling to use their their credentials, you might want to do like an OAuth three-legged OAuth here to fetch their access token and then do the refresh, but that's a much larger scope than what we're dealing with today and I know we you have more videos on that coming soon, Annie. >> Yeah, we will cover that in future video. So, if you're interested in learning more about us or you have specific question, you can leave it uh leave your question in the comment. We will address together in a future video. All right, sounds like we covered a lot and we covered about A2A uh basic and then how to do A2A different mode of A2A. We also covered why we want to use agent registry and then uh how to use them together with A2A. So, now I hope that you have a much better understanding of how to build a production-ready multi-agent system together with A2A and agent registry. Anything to add, Sida? >> Yeah, uh the GitHub link is in the description below for you to try the same example and there's also documentation links that we've added, so please do take a look and let us know what you think about this. >> Yeah, and again, thank you so much for watching and I will see you in the next video. Bye. >> [music] [music]
Original Description
Github repo → https://goo.gle/multiagent
When you have 100 AI agents across your org, how do they find and talk to each other? This is how: the Agent2Agent (A2A) Protocol and Agent Registry. In this episode of Hands On AI, we build a production-ready multi-agent system. We start with the Agent2Agent (A2A) Protocol, think "HTTP for AI agents", then solve agent sprawl with Agent Registry, so your agents discover each other instead of hard-coding URLs.
We build it live with a dog walker agent and a trip planner agent on Google's Agent Development Kit (ADK), then orchestrate them together.
What you'll learn:
* What the A2A protocol is, and when to use it for multi-agent systems.
* Agent cards — an agent's "LinkedIn profile" for discovery.
* Sync vs async agent communication (polling vs streaming).
* Wrapping an ADK agent as an A2A remote agent with to_a2a.
* The agent sprawl problem — and how Agent Registry solves it (reusability, one way to connect, governance).
* Registering agents via gcloud and the Cloud console.
* Using Agent Registry's MCP server to discover agents + tools dynamically — no more hard-coded URLs.
* Bringing in third-party agents (LangGraph, CrewAI) and MCP servers.
Chapters:
00:00 - Intro: Agent2Agent (A2A) Protocol & Agent Registry
03:06 - What Is Agent2Agent (A2A) Protocol? (HTTP for AI agents)
04:29 - When & why to use A2A
06:31 - Agent cards: An agent's LinkedIn profile
09:34 - Sync vs async communication
11:20 - Demo: building a dog walker agent (ADK)
15:21 - Wrapping an agent as an A2A remote agent
17:20 - Connecting two agents with A2A
19:27 - The problem: Agent sprawl
20:05 - What is Agent Registry?
22:35 - Registering agents (gcloud + console)
27:13 - Beyond agents: MCP servers & endpoints
29:18 - Connecting through the registry — No more hard-coded URLs
35:36 - Demo: The orchestrator agent
41:09 - Authentication & wrap up
More resources:
Google Agent Development Kit (ADK) → https://goo.gle/3PItVzL
Agent Runtime → https://goo.gle/4nXD
More on: Agent Foundations
View skill →Related Reads
📰
📰
📰
📰
Google tests letting Gemini call businesses for you
TechCrunch AI
Pipecat Benchmarked 23 Real-Time STT Models for Voice Agents. There Isn’t One Winner.
Hackernoon
How to Maximize Your Coding Agent Subscriptions
Towards Data Science
From AI Pilots To AI Factories: The Next Mandate For CIOs And CAIOs
Forbes Innovation
Chapters (15)
Intro: Agent2Agent (A2A) Protocol & Agent Registry
3:06
What Is Agent2Agent (A2A) Protocol? (HTTP for AI agents)
4:29
When & why to use A2A
6:31
Agent cards: An agent's LinkedIn profile
9:34
Sync vs async communication
11:20
Demo: building a dog walker agent (ADK)
15:21
Wrapping an agent as an A2A remote agent
17:20
Connecting two agents with A2A
19:27
The problem: Agent sprawl
20:05
What is Agent Registry?
22:35
Registering agents (gcloud + console)
27:13
Beyond agents: MCP servers & endpoints
29:18
Connecting through the registry — No more hard-coded URLs
35:36
Demo: The orchestrator agent
41:09
Authentication & wrap up
🎓
Tutor Explanation
DeepCamp AI