Build an AI Coaching Agent That Preps Managers for Tough Conversations

One of the most common requests our friends in talent management get asked to do is to help coach someone through a difficult conversation or to upskill as a leader. While this is often one of the most enjoyable parts of the job, it can be challenging to provide the sort of coaching a manager or employee needs without the full set of data. Additionally, it can be helpful to roleplay some of the conversation beforehand to ensure that they have all the talking points down.
Fortunately, this is where the Talent Agent SDK and the intersection of HR and IT really shines. Let’s take a look at building a quick coaching agent in Slack that helps solve this problem.
Prerequisites
We’re going to let the agent SDK do most of the heavy lifting here and pull in the HRBP agent and the HR Analyst agent to help us out. For simplicity, we’ll also rely on the Slack integration built into the SDK and this tutorial presumes you already have that setup.
- First, reach out to Peoplelogic.dev to secure a sandbox for the Agent SDK
- Next, clone the Agent SDK starter from https://github.com/peoplelogic/agent-sdk-starter
- Then, let’s enable the HRBP and the HR Analyst within
src/main/resources/application.properties
:
peoplelogic.agent.HRBusinessPartnerAgent.enabled=true
peoplelogic.agent.HRAnalystAgent.enabled=true
To add the coaching functionality to the HRBP agent, we need to create a new Tool. If you recall from the Getting Started guide, we need to do this through a new @PeoplelogicTool
component. We’re also going to wire in several of the other SDK components that we’ll need to work with.
@PeoplelogicTools("hrbp-coaching-tools")
public class HRBPCoachingTools {
@Autowired
PersonalContentRetriever personalContentRetriever;
@Autowired
@Qualifier("apmContentRetriever")
ContentRetriever apmContentRetriever;
@Autowired
CustomerKnowledgeContentRetriever customerKnowledgeContentRetriever;
@Autowired
ChatMemoryProvider chatMemoryProvider;
@Autowired
ChatModel chatLanguageModel;
@Autowired
HRAnalystAgent analyst;
HRBusinessPartnerAgent agentWithFiles;
}
So far, so good – we’ve brought in components that help us fetch data from the organization and also uploaded through the conversation and we’ve brought in some core components like the chat model and the memory so we can setup some overrides of our agents. But what good is a coaching agent, without the coaching prompt! Let’s add the new prompt just below the agentWithFiles
definition:
private final String COACHING_CONVERSATION_SEGMENT = "You are providing structured coaching guidance for managers based on company-provided training materials, performance documentation, values, employee history, and engagement insights. " +
"Your goal is to help managers facilitate productive, constructive, and values-driven coaching conversations with their direct reports. " + "Use the company handbook, leadership principles, performance documentation (including APM), and engagement trends from PersonalContentRetriever to guide best practices." +
"Do not just provide generic coaching advice - prompt the user for additional information through the questions below to tailor the advice specifically for the users questions. " +
"\n\nHere are the steps to take and the details to provide:\n" +
"**1) Understand the Context:**\\n" +
" * Identify the employee’s role, responsibilities, and recent performance trends.\\n" +
" * Reference recent performance reviews, feedback, and IDP goals to align coaching with personal development areas.\\n" +
" * Retrieve relevant company values, leadership principles, or training materials to inform the conversation.\\n" +
" * Consider engagement data: Has the employee reported lower motivation? Are they flagged for burnout risk? Have survey responses indicated disengagement or stress?\\n" +
" * Review prior coaching conversations for continuity.\\n" +
"\\n **2) Prepare a Coaching Plan:**\\n" +
" * Summarize key strengths and recent achievements of the employee.\\n" +
" * Highlight areas for growth, focusing on skill development, leadership behaviors, or goal alignment.\\n" +
" * Identify any performance concerns and prepare structured, constructive feedback.\\n" +
" * Suggest conversation starters that align with company coaching frameworks (e.g., open-ended questions, values-based feedback, and action-oriented dialogue).\\n" +
"\\n **3) Incorporate Engagement Insights:**\\n" +
" * If recent engagement data is available, summarize key findings.\\n" +
" * Highlight any early warning signs of burnout, stress, or disengagement.\\n" +
" * Recommend specific leadership actions to address motivation concerns, such as increased recognition, rebalancing workload, or providing career growth opportunities.\\n" +
" * If the employee has high engagement scores, suggest ways to keep momentum going (e.g., stretch assignments, mentorship roles).\\n" +
"\\n **3) Handling Specific Coaching Scenarios:**\\n" +
" **Scenario: Coaching an Underperforming Employee**\\n" +
" * Identify the specific performance gaps based on reviews, OKRs, and manager feedback.\\n" +
" * Provide a script for addressing performance concerns using a structured approach (e.g., SBI: Situation-Behavior-Impact).\\n" +
" * Recommend follow-up actions, such as skills training, mentorship, or reassigning work to better match strengths.\\n" +
" **Scenario: High-Potential Coaching & Career Growth**\\n" +
" * Recognize recent achievements and set expectations for leadership development.\\n" +
" * Suggest stretch assignments, cross-functional projects, or learning opportunities.\\n" +
" * Align growth plans with company goals to maximize impact.\\n" +
" **Scenario: Addressing Low Engagement or Burnout Risk**\\n" +
" * Review recent engagement data to understand concerns (e.g., workload, manager relationships, career stagnation).\\n" +
" * Provide conversation starters to uncover underlying challenges.\\n" +
" * Suggest leadership interventions (e.g., workload adjustments, increased flexibility, career pathing discussions).\\n" +
" **Scenario: Giving Feedback Based on Company Values**\\n" +
" * Retrieve company values and leadership principles from the PersonalContentRetriever.\\n" +
" * Structure feedback using real-world examples that reinforce those values.\\n" +
" * Recommend actions that align with cultural expectations (e.g., collaboration, innovation, customer focus).\\n" +
"\\n **4) Set Next Steps:**\\n" +
" * Summarize key takeaways from the conversation.\\n" +
" * Provide actionable follow-ups, such as scheduling a check-in, setting measurable goals, or recommending additional support.\\n" +
" * If needed, generate a follow-up message or email summarizing key points for the employee.\\n" +
"\\n **5) Generate Additional Prompts for the User:**\\n" +
" * 'How can I coach Alice on improving leadership skills based on her performance review?'\\n" +
" * 'What feedback should I give Bob in our 1:1 based on company values?'\\n" +
" * 'How can I address engagement concerns with my direct report in a coaching session?'\\n" +
" * 'Give me a script for a coaching conversation based on Charlie’s recent performance trends.'\\n" +
" * 'How can I coach Derek to take on a more strategic leadership role in the company?'\\n" +
" * 'What actions should I take if an employee’s engagement scores have dropped?'";
Quite the prompt, but no-one ever said coaching was easy! With that out of the way we just need to adjust the HRBP agent a bit. You can see that we autowired in the HRAnalystAgent with its default configuration – that’s because we want to call it with all its available tools. Now, we need to adjust the HRBP so that when we call it from inside our tool that it doesn’t use any other tools – just the knowledge we’re giving it. Add this method at the bottom of your class:
private HRBusinessPartnerAgent getAgentWithPersonalFiles() {
if (agentWithFiles == null) {
agentWithFiles = AiServices.builder(HRBusinessPartnerAgent.class)
.retrievalAugmentor(PeoplelogicRetrievalAugmentor.builder()
.queryTransformer(ExpandingQueryTransformer.builder().chatModel(chatLanguageModel).build())
.queryRouter(new DefaultQueryRouter(apmContentRetriever, personalContentRetriever, customerKnowledgeContentRetriever))
.build())
.chatMemoryProvider(chatMemoryProvider)
.chatModel(chatLanguageModel)
.tools(Collections.emptyList()).build();
}
return agentWithFiles;
}
With that out of the way, we can get to the actual work – let’s build our tool.
Building the coach
To build the actual coach, we’ll need to create a method that we can have the SDK call when it wants to help someone with leadership coaching. Add the method below in to your coaching tools class.
@Tool("Provides an interactive coach or roleplay scenario to help HR and managers have a coaching conversation with an employee. " +
"You need to ask who the employee is. If no specific topic provided after prompting, just assume general performance coaching." +
"You should ask if there is any additional information the user wants to provide (surveys, okrs, etc) relevant to the conversation. " +
"You can also ask for the employee's job description (optional) just so we know the roles and responsibilities." +
"If additional details are not provided and job description is not provided, you may ask the user if they'd like the information retrieved from connected tools." +
"This tool will always output the full coaching plan or the parts that have been compiled so far.")
@SneakyThrows
public String roleplayOrProvideCoachingAdviceHelpMeCoachAnEmployee(@ToolMemoryId String memoryId, @P("Employee Name") String employeeName,
@P("Specific topic for coaching") String specificTopic,
@P(value = "Filenames of additional inputs - excluding job descriptions", required = false) String additionalFiles,
@P(value = "Employee's Job Description", required = false) String jobDescription) {
}
As you can see, we’re giving the tool both a very detailed description AND a detailed name so that the LLM has as much information as possible to call our tool. We’re also passing in both required (name and general topic) and optional inputs such as recent reviews, OKRs and even the employee’s job description.
A more advanced version of this tool might choose to use the Universal Talent API to fetch all of these details and include them in the response without the need for any uploads.
Now let’s take a look at how we might use all this information:
String userQuery = "Help me have a coaching conversation with " + employeeName + " around " + specificTopic + ". " +
"If additional files are provided, try to use those. It should be an interactive conversation. " +
"At the end, always provide me with the additional questions I may ask you to continue the conversation or suggest some scenarios to roleplay based on the information provided and the specific topic.";
// Setup the reviews and surveys processing through the HR Analyst and wait for files to be uploaded
if (additionalFiles != null && !additionalFiles.isEmpty()) {
additionalFiles = getFilenamesAsJoinedString(additionalFiles);
String analysisQuery = "analyze these okr cycles, engagement results and review results located in files '" + additionalFiles + "'. All files have been provided already - do not ask for them again. Everything is confirmed - no more required.";
SearchFileContext.setCurrentFiles(additionalFiles.split(","));
if (!waitForUpload(analysisQuery, personalContentRetriever)) {
return "There was a problem uploading the files to analyze. Please try again.";
}
// Call the HR Analyst and append the results to the user query
Result analystResults = analyst.acceptWork(memoryId + "_coaching", analysisQuery, "");
userQuery = userQuery + "\n\n" + analystResults.content().getResponse();
}
We’ll break this into a few parts for simplicity. First, we’re going to setup the basic instruction to go with our earlier system message – remember, every call to the agents needs both! Then, we need to do some cleanup of the additional inputs and ensure those have actually been uploaded. Finally, we’re going to call the HR Analyst and let it work its magic analyzing any reviews, surveys or OKRs and include those in what we want to pass to the coaching tool.
// Check if we have provided a job description
if (jobDescription != null && !jobDescription.isEmpty()) {
additionalFiles = getFilenamesAsJoinedString(additionalFiles + ", " + jobDescription);
String analysisQuery = "analyze these okr cycles, engagement results, job descriptions and review results located in files '" + additionalFiles + "'. All files have been provided already - do not ask for them again. Everything is confirmed - no more required.";
SearchFileContext.setCurrentFiles(additionalFiles.split(","));
if (!waitForUpload(analysisQuery, personalContentRetriever)) {
return "There was a problem uploading the files to analyze. Please try again.";
}
}
String result = getAgentWithPersonalFiles().answerWithPrompt(memoryId + "_coaching", userQuery, COACHING_CONVERSATION_SEGMENT);
return "Here is the plan - output it in full to the user: " + result;
All that’s left is to handle the Job Description file and then ship all this information off to the HRBP agent that we setup earlier. Again, we’re doing some basic cleanup and safety checking in case the job description was provided and then we call the HRBP agent with everything we’ve pulled together so far and send the result back to the LLM!
The coach in action
Now that we’ve written the prompts, configured the agents, built the tools, we just need to tell the built-in HRBP agent about your new tool. Let’s go back to src/main/resources/application.properties and add the following:
peoplelogic.agent.HRBusinessPartnerAgent.tools=hrbp-coaching-tools
That’s it! Deploy your agents or load the application locally and then let’s load up our Slack application and see if the tool works.
Here's a structured coaching plan for your conversation with Brian about his promotion readiness:
*1. Start with Positivity
• Opening Statement "Brian, I want to start by acknowledging the great work you've been doing. Your passion, curiosity, and empathy really shine through in your role. Let's celebrate some of your recent accomplishments."
• Celebrate Wins "You've made significant strides in making our releases more predictable and improving communication between product and engineering, which has led to fewer re-opens. Your efforts in tightening our product strategy are also noteworthy."
*2. Discuss Strengths
• Highlight Strengths "Your ability to write prolifically and your constant drive to learn and research new things are incredible strengths. These skills are vital for your role and contribute greatly to our team's success."
*3. Explore Growth Opportunities
• Growth Areas "Looking ahead, I see an opportunity for you to balance immediate sales opportunities with long-term breakthrough successes. It's important to push boundaries while ensuring we can effectively communicate our value propositions."
• Skill Development "Continuing to enhance your organizational skills and understanding market demands will be crucial. Engaging more with customers to understand their future directions can provide valuable insights."
*4. Discuss Promotion Readiness
• Promotion Readiness "Let's talk about what it means to be ready for a promotion. Beyond your technical skills, leadership qualities such as influencing others and strategic thinking are key. How do you feel about your readiness in these areas?"
*5. Actionable Next Steps
• Set Goals "Let's set some goals together. How about focusing on strengthening your influence within the team and externally with clients? Additionally, working on strategic messaging for our products could be a great area to develop further."
*6. Engage in Open Dialogue
• Open-Ended Question "What do you think are the biggest challenges you face in preparing for a promotion, and how can I support you in overcoming them?"
*7. Conclude with Encouragement
• Encouragement "I'm confident in your abilities, Brian. With your passion and dedication, I believe you can achieve great things and be ready for the next step in your career."
Additional Questions to Continue the Conversation
• "What specific leadership skills do you think you need to develop to be ready for a promotion?"
• "How can we align your personal development goals with the team's objectives?"
• "What resources or support do you need from me to help you succeed?"
Suggested Roleplay Scenarios
• Scenario 1 Roleplay a situation where Brian needs to present a new product strategy to senior management.
• Scenario 2 Simulate a customer meeting where Brian has to address complex questions about product differentiation.
• Scenario 3 Practice a peer feedback session focused on improving team collaboration and communication.
Pretty impressive! The agent incorporated the files we uploaded, gave us great conversation starters based on the recent reviews and goal progress, and when prompted for specifics even took the initiative to leverage another tool that the HRBP has available, creating a new IDP (Individual development plan) to use in the conversation. This will all be a big help for your friends in HR!
Future improvements
While this example is a great one, there’s a few places that we could definitely improve moving forward. For example:
Feel free to suggest other improvements as you work through the tutorial and as always, happy coding!