Создайте агента по тренерскому искусству, который готовит менеджеров к жестким разговорам
31 июля 2025 г.Один из наиболее распространенных запросов, которые нашим друзьям в управлении талантами просят сделать, - это помочь кому -то тренировать кого -то в трудном разговоре или в «Упскилл» в качестве лидера. Хотя это часто является одной из самых приятных частей работы, может быть сложно предоставить такую коучинку, которую потребности менеджера или сотрудника без полного набора данных. Кроме того, может быть полезно заранее ролевое разговор, чтобы убедиться, что у них есть все точки разговоров.
К счастью, именно здесь талантливый агент SDK и пересечение HR, и он действительно сияет. Давайте посмотрим на создание быстрого тренерского агента в Slack, который помогает решить эту проблему.
Предварительные условия
Мы собираемся позволить агенту SDK сделать большую часть тяжелой работы здесь и потянуть в агент HRBP и агент HR, чтобы помочь нам. Для простоты мы также полагаемся на слабую интеграцию, встроенную в SDK, и этот учебник предполагает, что у вас уже есть эта установка.
- Во -первых, обратиться кPeopleLogic.devЧтобы закрепить песочницу для агента SDK
- Затем клонировать агент SDK Starter отhttps://github.com/peoplelogic/agent-sdk-starter
- Затем давайте включим HRBP и HR -аналитик в пределах
src/main/resources/application.properties:
peoplelogic.agent.HRBusinessPartnerAgent.enabled=true
peoplelogic.agent.HRAnalystAgent.enabled=true
Настройка инструмента для коучинга
Чтобы добавить функциональность коучинга к агенту HRBP, нам нужно создать новый инструмент. Если вы помните изНачало работы, нам нужно сделать это через новый@PeoplelogicToolкомпонент. Мы также собираемся подключиться в нескольких других компонентах SDK, с которыми нам нужно работать.
@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;
}
До сих пор так хорошо - мы принесли компоненты, которые помогают нам извлекать данные из организации, а также загружены через разговор, и мы принесли некоторые основные компоненты, такие как модель чата и память, чтобы мы могли настроить некоторые переопределения наших агентов. Но что хорошего в тренерском агенте, без подсказки коучинга! Давайте добавим новую подсказку чуть нижеagentWithFilesопределение:
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?'";
Довольно быстро, но никто никогда не говорил, что тренировка была легкой! Благодаря этому нам просто нужно немного настроить агент HRBP. Вы можете видеть, что мы автоматически разбираемся в HranalyStagent с его конфигурацией по умолчанию - это потому, что мы хотим назвать его со всеми его доступными инструментами. Теперь нам нужно настроить HRBP так, чтобы, когда мы называем его изнутри нашего инструмента, он не использует какие -либо другие инструменты - просто знания, которые мы даем. Добавьте этот метод внизу вашего класса:
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;
}
Благодаря этому мы можем добраться до реальной работы - давайте создадим наш инструмент.
Строительство тренера
Чтобы построить фактического тренера, нам нужно создать метод, который мы можем позвонить в SDK, когда он хочет помочь кому -то с руководством. Добавьте метод ниже в свой класс инструментов коучинга.
@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) {
}
Как вы можете видеть, мы даем инструмент как очень подробное описание, так и подробное имя, чтобы в LLM было как можно больше информации, чтобы позвонить нашему инструменту. Мы также передаем как требуемую (имя и общую тему), так и дополнительные входные данные, такие как последние обзоры, OKR и даже описание работы сотрудника.
Более продвинутая версия этого инструмента может выбрать использование Universal Talent API для извлечения всех этих деталей и включить их в ответ без необходимости каких -либо загрузок.
Теперь давайте посмотрим, как мы могли бы использовать всю эту информацию:
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<PeoplelogicResult> analystResults = analyst.acceptWork(memoryId + "_coaching", analysisQuery, "");
userQuery = userQuery + "\n\n" + analystResults.content().getResponse();
}
Мы разбим это на несколько частей для простоты. Во -первых, мы собираемся настроить основную инструкцию, чтобы перейти с нашим предыдущим системным сообщением - помните, каждый вызов агентам нуждается в обоих! Затем нам нужно сделать некоторую очистку дополнительных входов и убедиться, что они фактически были загружены. Наконец, мы собираемся позвонить в HR -аналитика и позволим ему использовать свою магию, анализируя любые обзоры, опросы или OKR и включить в то, что мы хотим передать в инструмент коучинга.
// 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;
Все, что осталось, - это обрабатывать файл описания заданий, а затем отправить всю эту информацию с агента HRBP, который мы настраиваем ранее. Опять же, мы проводим некоторую базовую очистку и проверку безопасности на случай, если будет предоставлена описание работы, а затем мы называем агента HRBP всем, что мы собрали вместе, и отправили результат обратно в LLM!
Тренер в действии
Теперь, когда мы написали подсказки, настроили агенты, создали инструменты, нам просто нужно рассказать встроенному агенту HRBP о вашем новом инструменте. Давайте вернемся к src/main/resources/application.properties и добавим следующее:
peoplelogic.agent.HRBusinessPartnerAgent.tools=hrbp-coaching-tools
Вот и все! Разверните свои агенты или загрузите приложение локально, а затем давайте загрузим наше приложение Slack и посмотрим, работает ли инструмент.
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.
Довольно впечатляюще! Агент включил файлы, которые мы загрузили, дал нам отличные стартеры разговора на основе недавних обзоров и прогресса в целях, и когда было предложено, чтобы специфические показали инициативу, чтобы использовать другой инструмент, который имеет HRBP, создав новый IDP (индивидуальный план разработки) для использования в разговоре. Все это будет большой помощью для ваших друзей в HR!
Будущие улучшения
Хотя этот пример отличный, есть несколько мест, которые мы определенно могли бы улучшить движение вперед. Например:
- Перемещение длинных системных подсказок в файл для обслуживания.
- В том числе универсальный API таланта талантовтак что нет необходимости загружать файлы.
- Персонализация HRBP, чтобы соответствовать личности вашей организацииПолем
Не стесняйтесь предлагать другие улучшения, когда вы работаете в учебном пособии и, как всегда, счастливого кодирования!
Оригинал