Designing a Virtual Agent topic
Summarize
Summary of Designing a Virtual Agent topic
This guide walks ServiceNow customers through designing a Virtual Agent topic, using an example that allows users to view the status of incidents they submitted. It highlights how to use Virtual Agent tools and features to create conversational flows that automate common self-service tasks, reducing the need for human intervention. The design process integrates creativity with platform capabilities to build effective, natural-language conversations.
Show less
Key Features
- Pre-built resources: Use available pre-built Virtual Agent topics, topic blocks, and ServiceNow NLU models. These can be duplicated and customized to fit your organization’s needs.
- Topic Recommendations app: Leverages Intent Discovery to suggest relevant pre-built topics based on your organization's data, helping you quickly implement or create useful topics.
- Conversation design controls: Virtual Agent Designer provides reusable controls such as Dynamic Choice for selecting records, Card for displaying information, Boolean for yes/no prompts, Decision for branching logic, Text Input for gathering user input, and Record Action for updating records.
- Integration with AI: Supports natural language understanding (NLU) and large language models (LLM) for enhanced conversation experience. You can configure instructions and slot-filling, manage small talk, and associate topics with AI assistants.
- Design process in Assistant Designer: Includes defining topic properties (scope, portal, description), building conversation flows incrementally, testing frequently, and publishing the topic for end users.
Practical Design Considerations
- Identify the use case, target users, and conversation goals early to ensure the topic addresses real needs such as incident status inquiries and commenting.
- Plan the conversation structure with a clear start, middle, and end, including how to handle topic switches, loops, or interruptions like small talk.
- Leverage existing pre-built components where possible to accelerate development and maintain consistency.
- Consider data collection and privacy when using LLMs by customizing instructions and managing user input.
- Understand the technical background required, including knowledge of ServiceNow platform tables, scripting (JavaScript, HTML, REST), and AI models (NLU intents, entities, utterances).
Example Conversation Flow for Incident Status
This example flow enables a user to:
- Select an active incident from filtered records using a Dynamic Choice control.
- View incident details displayed on a Card control.
- Decide whether to leave a comment via a Boolean control.
- If yes, input a comment through a Text Input control and add this comment to the incident using a Record Action control.
- Branch the conversation based on the user's choice, using a Decision control to either end the conversation or proceed with the comment input.
Testing and Validation
ServiceNow customers are encouraged to frequently test their conversation flows using the built-in Test button in Assistant Designer. Incremental testing helps quickly identify and fix errors or unexpected behaviors, ensuring a smooth user experience. For complex issues, debugging tools are available to troubleshoot topics effectively.
Walk through the design of an example Virtual Agent topic that enables users to view incidents they submitted. The example highlights various design controls that can be used to build the conversation flow.
Using Virtual Agent tools and features, you can develop conversations that address many issues that can be resolved without human intervention. Once you become familiar with the product and its capabilities, your creativity is one of the most important tools for developing conversations.
- Now Assist in Virtual Agent
- Create natural-language–based conversations with Now Assist. Virtual Agent uses large language models (LLMs) to improve conversation experience and self-service workflow success by way of generative AI skills.
- Pre-built Virtual Agent topics, topic blocks, and ServiceNow NLU models
These pre-defined conversations help users with common self-service tasks in each business area, such as creating or updating cases or providing answers to frequently asked questions. Duplicate the pre-built topics you want to use, and then customize them for your organization.
- Virtual Agent Topic Recommendations
- Use the Topic Recommendations app to identify pre-built Virtual Agent topics that can be quickly implemented in your organization. Topic Recommendations uses Intent Discovery to analyze data from your organization and to find relevant pre-built topics that your organization can benefit from, and new topics that would be useful to create.
Getting started with conversation design
Use Virtual Agent Designer controls and reusable conversational elements to create the dialogue for your conversations between Virtual Agent and the end user. Before you begin, make sure you do the following:
- Identify the use case for a conversation.
Determine who will use a conversation topic and the goal, such as solving a user problem or assisting with a self-service task. Besides gathering key requirements for your topic, identify the information that you need from the user to complete the goal.
For example, you can review your support requests over time and other available metrics to determine common issues, use cases, and customer requests or goals. From there, you can predict recurring requests or issues that a virtual agent could help with.
- Determine the structure of a conversation.
As you think about your conversation flow, identify the direct path to resolution. Then consider alternate paths where the conversation might branch, depending on the information supplied by the user. Consider how to handle each branch and whether users might loop back to an earlier point in the conversation.
Conversations have a beginning (the greeting), a middle, and an end, which may include a survey or an incident number to follow up on. In the middle, consider how the user might need to switch topics, depending on the issue.
If you're using LLM, consider whether you want to add or restrict any data collection from the user through means such as additional instructions to the LLM or customized slot-filling.
If you're using Natural Language Understanding (NLU), consider scenarios where a user might want to switch topics during a conversation session. For example, a user might want to change topics entirely. Or a user might get sidetracked and ask a question that seems out of context, maybe to engage in "small talk" with the virtual agent. Determine whether you want to let the user resume the original conversation after switching topics during the conversation.
Consider setting small talk filters to redirect user statements in LLM conversations, or creating small talk topics in both LLM and NLU/keyword conversations. For more information, see Configure small talk filters and Create a small talk topic.
You can also review the pre-built setup topics, conversation topics, and topic blocks (reusable subflows that perform certain design steps and logic). Determine whether you can use these pre-built items and consider customizing them as needed.
- Understand the design process in Assistant Designer
-
When you create a topic in Assistant Designer Asset library, the design process involves these basic steps:
- Decide what use case the topic will address.
- Create the topic and set properties that define the scope, what portal it will be published in (what assistant will be used), and a thorough topic description that will be used for discovery.
- Build the conversation flow in Assistant Designer's Asset library topic flow tab.
- Test and fine-tune the conversation flow.
- Publish your topic.
- Have knowledge in the following areas (what to know before you begin)
- General knowledge of the ServiceNow platform and application table structures.
- If you're using LLM, an understanding of how large language models and LLM assistants work.
- If you're using NLU, an understanding of how intents, entities, and utterances are used in your NLU models.
- If you're using scripts in conversation design, an understanding of HTML, JavaScript, and REST integrations.
Plan the structure and purpose of a conversation
The first step in implementing a Virtual Agent topic is to decide what the topic covers. Consider the intended audience and what you want the audience to accomplish when using the conversation. For this example, the goal of this example topic is to create a flow that enables end users to see the status of incidents they submitted. The topic includes an option for the user to add a comment to the incident.
- A prompt for the user to select an incident
- An output showing the status of the incident
- A prompt to ask if the user wants to leave a comment
- A utility control to branch the conversation on that answer
- A prompt for the user to enter a comment
- A utility control to add the user input as a comment in the incident
There are extra considerations when creating topics for LLM conversations. For more information, see LLM description and instruction guidelines for Virtual Agent topics and General guidelines for writing instructions for generative AI large language models (LLMs).
Build the conversation flow with Virtual Agent controls
The conversation will look similar to the following dialogue flow.
Configure controls within the conversation
- In your Virtual Agent topic, add a Dynamic Choice control node to the conversation flow. This control is used to select the incident.
- Enter Choose an incident for the Node name property. The variable name
choose_an_incidentis automatically generated for the control. - In the Prompt property, enter the text the user sees before selecting an incident. For example, Please choose an incident record.
- In the Populate choices by property, select Record.
- In the Table property, select Incident [incident].
- In the Filter choices property, select the Condition option, and create a condition:
- Active is true AND Assignment group is Hardware AND Category is Database
- AND
- State is New OR State is In Progress
Figure 2. An example condition builder
- Enter Choose an incident for the Node name property. The variable name
- Add a Card control to the flow. This control shows information from the record selected by the Dynamic Choice in the previous step.
- Enter Status Card for the Node name property.
- In the Card type property, select Record.
- In the Record property, select Choose an Incident. This choice refers to the Dynamic Choice control created in the previous step, so the data displayed comes from the record chosen there.
- In the fields control, select a field. The choices available are the available fields on the chosen record. In this case, you can see the fields on the incident table.
- After a field has been selected, select the Add Field option to add additional fields to the card. To delete fields from the card, select the delete icon to the right of the field.
- Add a Boolean control to the flow. This control is used to prompt the customer with a yes/no question. In this case, the control checks whether the user wants to leave a comment on the selected incident record.
- Enter Leave Comment? for the Node name property. The variable name
leave_comment_is automatically generated for the control. - In the Prompt property, enter the text the user sees before the prompt. For example, Do you want to leave a comment for this incident?
- Enter Leave Comment? for the Node name property. The variable name
- Add a Decision control to the flow. This control branches the conversation into two possible paths. The path the conversation follows depends on the choice the user made in the previous step.
- There are no properties on the decision control; however, there are properties on the branches below the decision. By default, there is a single branch labeled Always. Select the blue plus icon at the bottom of the decision control. A second branch appears that is also labeled Always.
- Select one of the branches to access the properties for this branch.
- Change the name to Leave Comment.
- In the condition property, select the Condition option and select the Add Condition button. Use the condition builder to create a condition as shown in the following
screen shot.
If the value of the Leave Comment? is true, this condition is met. This variable is the variable from the Boolean control in the previous step. If the user chose Yes at that prompt, the conversation follows this branch. - Select the other branch of the decision to access the properties for this branch.
- Change the name to No Comment.
- In the condition property, select the Condition option and select the Add Condition button. Use the condition builder to create a condition as shown in the following
screen shot.
If the value of the Leave Comment? is false, this condition is met. This variable is the variable from the Boolean control in the previous step. If the user chose No at that prompt, the conversation follows this branch. - One of the two branches you have created points to the End node of the conversation. The second branch should also lead to this node. Select the arrow at the bottom of that branch and drag it to the End node.
- Add a Text Input control to the Leave Comment branch of the conversation. This control is used to request text input from the user.
- Enter Get Comment for the Node name property. The variable name
get_commentis automatically generated for the control. - In the Prompt property, enter the text the user sees before the prompt. For example, Please enter your comment.
- Optionally, you can enter a value in the property. This value appears after the user enters a comment.
- Enter Get Comment for the Node name property. The variable name
- Add a Record Action control to the conversation below the Get Comment control. This control is used to add the text entered into the previous control as a comment on the selected
incident.
- Enter Update Incident for the Node name property.
- In the Action Type property, select Update a Record.
- In the Record property, select Choose an Incident. This choice refers to the Dynamic Choice control created in the previous step, so the record chosen there is the one that this Record Action control updates.
- In the Field property, select Add Field. You can select and give values to fields from this record in the pop-up window that appears.
- Select the Additional Comments field from the list.
- Select the data pill picker icon
, and then select the Get Comment input variable from the list. This option refers to the value entered by the user in the Text Input control in the previous step.
- Select Save.
Test the conversation
Use the Test button to test the flow of the conversation. Preview topics often throughout the design process to find errors or unexpected behavior quickly. For further information on identifying and resolving issues with topics, see Debug a Virtual Agent topic.