From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
HR multi-agent assistant design
From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
HR multi-agent assistant design
- [Instructor] Having discussed the concepts of the Agent2Agent protocol in the previous chapter, let's implement a multi-agent system enabled by the Agent2Agent protocol in this chapter. In this video, we will discuss the requirements and design of the system. We will be building an HR employee assistant agent. This agent provides a single portal for employees in an organization. Employees can use this portal to learn more about policies and perform actions like time-off requests. This agent acts as a front-end router. It understands the query or task provided by an employee user and then routes the request to the right agent that can execute it. It acts like a supervisor agent that utilizes other agents to perform a task. For this implementation, this agent integrates with the HR policy agent and the HR time-off agent that we built in the earlier chapters for MCP. We will add in A2A-based communications between the router agent and these two agents. What does the design of this multi-agent system look like? We already have the HR policy agent that we built in chapter 3 for answering questions about policies. This uses an MCP server using the STDIO transport. We also have the HR time-off agent that we built in chapter 4 for adding new time-off requests and answering questions about balances. This uses an MCP server using HTTP. To enable A2A, we first wrap the HR policy agent with an HR policy A2A server. This server runs as its own process and loads the HR policy agent into its memory. Do note that it is also possible to run the HR policy agent as a separate process and then use HTTP or GRPC between the A2A server and the HR policy agent. The A2A server exposes an agent card for the HR policy agent and also handles queries on policies. Similarly, we wrap the HR time-off agent with its own HR time-off A2A server. This wrapping capability is done with boilerplate code and is similar for all implementations. Then we build the HR assistant router agent. This agent front-ends other agents. Inside this agent, we create a policy A2A client. This client integrates with the HR policy A2A server using the A2A protocol. It also has the time-off A2A client. This integrates with the HR time-off A2A server using A2A protocol. Do note that this system has four executing processes that needs to be started up for the system to work. These four are the router agent, the HR policy A2A server, the HR time-off A2A server, and the HR time-off MCP server. The HR policy MCP server will be automatically started by the HR policy agent when needed.