Understanding the Issue
Agentforce agents are designed to use topic classification to determine the next topic in the conversation. However, when the agent presents a list of choices to the user, the topic selector may incorrectly use the user_select_record tool instead of doing topic selection.
Solution
To fix this issue, you can add an instruction to the topic selector to not use the user_select_record tool when the user is selecting from a list of assignments or resources. You can also try adding natural language instructions in addition to if/then statements to improve the topic selection.
The root cause of this issue is the incorrect use of the user_select_record tool by the topic selector when the user is selecting from a list of options. This can be resolved by adding specific instructions to the topic selector to handle this scenario.
Another approach is to review the trace when the agent goes back to the topic selector. This can provide valuable insights into why the agent is not staying in the current topic.
To implement this solution, you can follow these steps:
topic_selector.json
{
"instructions": [
{
"type": "topic_selection",
"condition": "user_selects_from_list",
"action": "do_not_use_user_select_record"
}
]
}
Heads up: Make sure to test your Agentforce agent thoroughly after making these changes to ensure the topic selector is working as expected.
Checklist
- Review the trace when the agent goes back to the topic selector
- Add an instruction to the topic selector to not use the user_select_record tool when the user is selecting from a list of options
- Use natural language instructions in addition to if/then statements to improve topic selection
- Test the Agentforce agent thoroughly after making changes to the topic selector
- Verify that the topic selector is using the entire context to determine the next topic
- Check for any other potential issues that may be causing the agent to return to the Start Agent topic selector
Frequently Asked Questions
What is the user_select_record tool?
The user_select_record tool is used by the topic selector to handle user input when selecting from a list of options.
How do I add an instruction to the topic selector?
You can add an instruction to the topic selector by editing the topic selector JSON file and adding a new instruction object.
What is the purpose of the topic selector?
The topic selector is used to determine the next topic in the conversation based on the user’s input and the current context.
How do I test my Agentforce agent after making changes to the topic selector?
You can test your Agentforce agent by simulating user input and verifying that the topic selector is working as expected.
Need help shipping this in production?
Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.