🧑💼 AskHR: Automate HR tasks with Agentic AI¶
Pre-requisites¶
- Make sure you've already setup the environment:
- Lab 0 - Environment setup
- ADK Installation
- Download files
- Download the zip file from Lab1 folder
Note: If you are an instructor, complete the instructor guide and update the url in hr.yaml. If you are a practitioner, obtain the updated hr.yaml file from your instructor. Do not directly use the yaml file to import into Orchestrate. - If you are an instructor, complete the instructor set-up guide and update the hr.yaml with new url after completing the setup.
Step by step instructions to build the HR Agent¶
-
When you launch watsonx Orchestrate, you'll be directed to this page. Click on the hamburger menu in the top left corner:
-
Click on the down arrow next to Build. Then click on Agent Builder:
-
Click on Create agent +:
-
Select "Create from scratch", give your agent a name, e.g. "HR Agent", and fill in the description as shown below:
You are an agent who handles employee HR queries. You provide short and crisp responses, keeping the output to 200 words or less. You can help users check their profile data, retrieve latest time off balance, update title or address, and request time off. You can also answer general questions about company benefits.
-
Click on Create
-
Scroll down the screen to the Knowledge section. Copy the following description into the Knowledge Description section:
This knowledge base addresses the company's employee benefits, including parental leaves, pet policy, flexible work arrangements, and student loan repayment.
-
Click on Upload files
-
Upload the Employee Benefits.pdf and click on Upload:
-
Wait until the file has been uploaded successfully and double check that it is now shown in the Knowledge section:
-
Scroll down to the Toolset section. Click on Add tool +:
-
Select Import
-
Drag and drop or click to upload the hr.yaml file (provided to you by the instructor), then click on Next:
Note: Instructors make sure the url in the hr.yaml is updated after instructor set up before providing to clients. -
Select all the operations and click on Done:
-
Scroll down to the Behavior section. Insert the instructions below into the Instructions field:
Use your knowledge base to answer general questions about employee benefits. Use the tools to get or update user specific information. When user asks to show profile data or check time off balance or update title/address or request time off for the very first time, first ask the user for their name, then invoke the tool and then use the same name in the whole session without asking for the name again. When the user requests time off, convert the dates to YYYY-MM-DD format, e.g. 5/22/2025 should be converted to 2025-05-22 before passing the date to the post_request_time_off tool.
-
Test your agent in the preview chat on the right side by asking the following questions and validating the responses. They should look similar to what is shown in the screenshots below:
1. What is the pet policy? 2. Show me my profile data. 3. I'd like to update my title. 4. Update my address 5. What is my time off balance? 6. Request time off 7. Show my profile data.
-
Once you have validated the answers, click on Deploy in the top right corner to deploy your agent:
-
Click on the hamburger menu in the top left corner and then click on Chat:
-
Make sure HR Agent is selected. You can now test your agent:
Conclusion
👏 Congratulations on completing the lab! 🎉