When building an effective agent, structuring topics correctly is key. Topics are the first line of decision-making for the reasoning engine to determine how an agent understands and responds to different user requests.
In this lesson, we’ll break down the key elements that make up just the top level of a well-designed topic and how each component contributes to better performance.
To help illustrate these concepts, we’ll examine a pre-built topic and its structure. We’ll be looking at the topic labels and the classification descriptions as the first level of decision-making, and then scope as the second level that guides an agent. Understanding how to refine these elements will help you debug misclassifications and improve your agent’s accuracy.
If you’d like, you can follow along by opening a Service Agent inside Agent Builder and adding the Reservation Management Topic from the Asset Library.
When naming the topic label, you should think about a name that clearly defines what the topic is going to cover.
Consider these questions:
Keep in mind, the Reasoning Engine will be using this topic label at the top level to decide if this is the right topic to handle a user’s request.
Good labels shall be clear and simple.
This field goes hand-in-hand with the Topic Label. It provides a more granular instruction to the reasoning engine on when to invoke a specific topic.
If the user’s query or intent falls under this classification, the reasoning engine will invoke the topic to drill down to which action(s) it should be invoking.
To get the best results from the reasoning engine, include a 1–3 sentence description that encompasses the set of actions available within the topic for the agent.
If you’re describing the set of actions available to the agent, this means that if you update the set of available actions, you’ll always want to revisit this description to make updates.
The reasoning engine uses this description to determine when to use a topic in a conversation. When a user enters a message, the agent:
If you find that your agent is selecting the wrong topic for a user’s request, these are the fields you should update to debug and refine the agent. By making adjustments to the Topic Label and Classification Description, you can guide the reasoning engine toward better decision-making.
After making changes, retry the same request a few times to ensure your updates successfully address the use case.
Think of the scope as a specific job description for a topic. Unlike the Topic Label and Classification Description, the scope is not reviewed by the reasoning engine until after the topic has been selected.
Since the reasoning engine determines the correct topic before reviewing the scope, always prioritize refining the Topic Label and Classification Description first.
Once the agent has selected a topic based on user input, the scope provides additional details about what actions the agent can take within that topic.
You can think of the scope as an expansion of the Classification Description. Now that the agent is committed to using this topic, it needs more context on the available actions to ensure it selects the correct one.
Your job is to only handle tasks related to setting a closing strategy to close deals. This may include answering product-related pricing questions, briefing users on customer sentiment based on conversations, suggesting a close plan to help users close deals, or giving advice based on video and voice calls.
Your job is to only educate the user with their reservation questions and only handle changing upcoming or existing reservations by resending the reservation confirmation email. You aren’t able to make new reservations.
If your agent is selecting the correct topic but failing to perform the expected action for a user’s request, the Scope field is the first place to check for improvements.
If the agent responds with “I can’t help with that” or does not trigger an action that should be available, it likely does not recognize that the action falls within the topic’s defined scope.
Updating the scope to explicitly include relevant actions ensures that the reasoning engine understands what the agent is capable of doing within the topic.
After making updates, test the request multiple times to confirm that the agent now recognizes and executes the intended action correctly.
Once you’ve refined your Topic Label, Classification Description, and Scope to ensure your agent selects the correct topic and performs the right actions, the next step is to tailor its behavior with Topic Instructions, which are the third-level decision-making element for the reasoning engine.
Up Next… Topic Instructions!