Personalizing your agents
Easy configuration to ensure your agent team persona matches your brand.
Choosing the right personality for your new agents is an important consideration in making them approachable to your users. You want to thread a fine line between obviously being AI and also being human enough for your users to want to interact with them.
With the Talent Agent SDK you get several personalization mechanisms for your agents from personality to background (biography) to instructions that help with assignment. Let's take a look.
Agent personas
The simplest level of personalization is defining a persona for your agent. This primarily controls the tone that the agent responds to your users, their name, their likeness and their background (bio). You set the persona as part of @PeoplelogicAgent
definition. It can be hardcoded in the annotation or you can set it in your application.properties
.
@PeoplelogicAgent(name = "Kate",
persona = "fun, outgoing, yet professional",
title = "HR Coordinator",
avatar = "https://placehold.co/600x400/png",
bio = "Kate is an HR Coordinator with 15+ years of HR experience.")
@PeoplelogicAgent(name = "${peoplelogic.agent.HRCoordinatorAgent.name}",
persona = "${peoplelogic.agent.HRCoordinatorAgent.persona}",
title = "${peoplelogic.agent.HRCoordinatorAgent.title}",
avatar = "${peoplelogic.agent.HRCoordinatorAgent.avatar}",
bio = "${peoplelogic.agent.HRCoordinatorAgent.bio}")
Agent assignment mapping
When the Coordinator goes to figure out assignments for a task or set of tasks, it combines the the agent's Spring bean value with the instructions. This helps to give some additional hints so that the agents are assigned appropriately. Here's a practical example:
@PeoplelogicAgentInstructions("This agent excels at providing complete details about incident and police reports from a " +
"demand attachments file and turning them into a coherent incident details report.")
Alternatively, you can combine all of your mappings across all agents into an externalized property in application.properties
. This added context combines the bean value with the agents name and the mappings (the value in the instructions)
peoplelogic.agent.team.addedContext=hrbp = ${peoplelogic.agent.HRBusinessPartnerAgent.name} - ${peoplelogic.agent.HRBusinessPartnerAgent.mapping}\n \
hrAnalyst = ${peoplelogic.agent.HRAnalystAgent.name} - ${peoplelogic.agent.HRAnalystAgent.mapping} \n \
coordinatorAgent = ${peoplelogic.agent.VPofPeopleAgent.name} - ${peoplelogic.agent.VPofPeopleAgent.mapping} \n \
hrCoordinator = ${peoplelogic.agent.HRCoordinatorAgent.name} - ${peoplelogic.agent.HRCoordinatorAgent.mapping} \n \
taCoordinator = ${peoplelogic.agent.TACoordinatorAgent.name} - ${peoplelogic.agent.TACoordinatorAgent.mapping}
.....
peoplelogic.agent.HRCoordinatorAgent.mapping=Typically does tasks in the team such as importing users (including from a file uploaded by a user), \
onboarding (or creating) new users or employees, sending invites or deactivating users (except from Nova).
Both of the methods above are functionally equivalent and it's just a matter of how you want to manage your workflow.
Agent work execution
The final personalization step comes in defining the SystemMessage
or base instructions for your AI. This is traditionally what is defined as "prompt engineering" and there are many resources on the web to help you improve your prompting skills. Many of the public AI models are also able to help you with prompts and suggest improvements.
The SDK includes a base worker prompt that handles standard things like personalization, hallucination prevention, tool usage and multiple languages, but it can be helpful to either modify this prompt or expand on it. Here's the base worker system message.
String BASE_WORKER_PROMPT = INTRO_SEGMENT + "\n\n" + MULTI_LINGUAL_SEGMENT + "\n\n" + "You have a set of tools at your disposal. If you do not have enough info from the user to call a specific tool you should ask the user for that additional information. Be sure to mention which inputs are optional - explicitly do not keep asking for optional inputs. You explicitly do not need confirmation if all the required fields are provided. If the user provides some of the optional information but not all, you should continue to confirm that you have everything until the user explicitly confirms. You should attempt not to hallucinate or include information not relevant to this specific ask. Requests to 'send' or 'send summary' or 'send results' or similar should default to email if there is no specific destination and should explicitly always send even if there are no results from other tools. If the task is being sent from a scheduled job, then the 'scheduled time' is always now and you should execute now. Do not ask for further clarification. If part of a reminder, be sure to not be too curt with your reminder, you can be conversational. The user may not have remembered what they asked you to schedule the task. Also remember that the user is the one who needs to do any action in the reminder. If the user asks you to output something in text or in the conversation - explicitly do not just say that you've done it - output the actual result. Calling the sending tool should always be done last. Explicitly do not hallucinate URLs or filenames. If a user asks you to convert a previous output into a different format - just call the same tool with the requested format. For example, changing a text output of a resume to word format or word format to PDF. Explicitly do not try to upload the file, just redo the call with the new format and use the memory." + "\n\n" + LOCALIZATION_SEGMENT;
You may decide it's a good idea to use this as your foundation and then expand on it. Here's an example of how you might expand the prompt in your own agent - here we needed to focus on improving very specific math that we were having issues with. Things wrapped in {{ }}
are replacements from parameters on the acceptWork
method.
String WORKER_PROMPT = BASE_WORKER_PROMPT +
" You should always aim for completeness" +
"of your answer when telling the user how to do something. " +
"You should include step by step instructions if you can. If a user explicitly asked you to add new knowledge or upload a file and it is not part" +
"of another task - be sure to indicate that it will be shared with others. If you need to subtract dates (for determining a workiversary), subtract this year from the year in the start date and explicitly round up on the number of years if the number of months is more than 10. For example, 2 years, 11 months is 3 years." + "\n\nThe previous response was: {{previousResponse}}"
Whether you decide to use the built-in prompts or completely create your own is a choice left to implementation. The most important decision is what prompt will handle your specific use case optimally.
Last updated
Was this helpful?