From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
HR policy agent design
From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)
HR policy agent design
- [Instructor] We will be building a HR policy AI agent in this chapter. This agent will use MCP for accessing tools and prompts. In chapter six, we will use this agent as part of an agent-to-agent network. Let's first discuss the features of the HR policy agent. The HR policy agent is used by the human resources department in an enterprise to help with their employee queries. The agent answers questions about employee policies, like time off, remote work, and other benefits. The policies are themselves available in a PDF file. These policies are loaded into an in-memory vector database with their equivalent embedding representations. The MCP server provides retrieval from the vector database for a user query. This is provided as a tool in MCP. This is an example of how retrieval in a retrieval-augmented generation, or RAG, system can be done using an MCP server. The prompt for the LLM is also served by the MCP server. The client is an agent that uses this MCP tool to answer questions about policies. What does the design of this agent look like? We have the HR_Policy_Document.pdf file that contains policy information. A HR policy MCP server provides access to the contents in this file. This server on startup will first load the PDF document into an in-memory vector database. Retrieval from this database is exposed as a tool in the MCP server. The server also exposes the prompt template that can be used to form the prompt for the agent. The HR policy agent is the application that uses the MCP server. It has a bundled MCP client for this purpose. The MCP client will communicate with the HR policy MCP server using the STDIO transport. Here, it will first run an instance of the server and then use it to retrieve data. Let's now proceed to implement this design.