Natural Language Understanding topic discovery logic in Virtual Agent
Summarize
Summary of Natural Language Understanding topic discovery logic in Virtual Agent
This documentation explains how ServiceNow Virtual Agent uses Natural Language Understanding (NLU) to identify and select the most appropriate conversation topics based on user input. It details the criteria for topic discovery, the logic Virtual Agent uses to predict intents, confidence scoring, and handling topic switches during an active conversation.
Show less
Prerequisites for Topic Discovery
- Topics must be published, active, and marked as discoverable in the Topics [syscstopic] table.
- Topic conditions must evaluate to true at runtime.
- If roles are assigned to a topic, the user must have at least one of those roles.
- The topic’s NLU model must support the language of the current session.
Note: The Is Topic Visible attribute does not affect topic discovery.
NLU Topic Discovery Logic
- Virtual Agent sends the user utterance and session language–bound NLU model IDs to the NLU provider for intent prediction.
- Returned intents correspond to topics that match the utterance.
- Virtual Agent will either:
- Automatically select a topic based on confidence scores,
- Prompt the user to choose from a list if multiple intents are closely matched, or
- Use keyword search fallback if no NLU matches are found and keyword fallback is enabled.
Confidence Scores and Intent Selection
- Confidence thresholds are configurable via the ServiceNow NLU driver settings.
- If an intent’s confidence score meets or exceeds the threshold, it's considered a valid match.
- Virtual Agent automatically selects the highest-confidence intent when:
- Only one intent is matched, or
- There is a clear confidence gap between the top intent and others (no tie).
- If multiple intents are close in confidence, Virtual Agent prompts the user to select from a list of topics, with the list size controlled by a system property.
- If no intents meet the threshold, keyword-based topic discovery is used if enabled via system properties.
Mid-Topic NLU Discovery
While a topic is active, users can input new utterances that may trigger a switch to a different topic. Virtual Agent detects this by sending the new input to the NLU predictor. If a new intent is identified and bound to another topic, the conversation context switches to that new topic seamlessly. This allows flexible and dynamic conversational flows.
Practical Benefits for ServiceNow Customers
- Ensures users receive relevant and accurate topic suggestions based on their natural language input.
- Allows dynamic conversation management including mid-dialogue topic switching, improving user experience.
- Configurable confidence thresholds and fallback mechanisms help balance automation with user control.
- Role-based topic discovery secures sensitive topics by restricting access as needed.
Understand how Virtual Agent returns intents and how it selects which intents to show to the user.
Prerequisites for topic discovery
- The topic must be published and active.
In the Topics [sys_cs_topic] table, the Active, Published, and Is Topic Discoverable values are set to true.
Note:The Is Topic Visible column does not affect topic discovery. - The topic must be discoverable.
- Topic conditions must evaluate to true at runtime.
- If any roles are configured for the topic, the requestor must have at least one of those roles.
- The topic's NLU model must have a binding for the session language.
NLU topic discovery logic
- Automatically selects a topic for the requester, based on the confidence score.
- Prompts the requester to pick a topic from the returned list of matches.
- Finds no matching topics.
If no matches are found but backup keywords are enabled (the com.glide.cs.nlu.keywords.enabled property is true), Virtual Agent searches for a topic based on keywords.
Virtual Agent NLU confidence scores
Virtual Agent uses confidence scores to return predicted intents. To set the confidence value:
- Navigate to .
- Select ServiceNow NLU. You can also select All and enter open_nlu_driver.list.
- In the Intent Confidence Threshold field, enter the confidence threshold.
If an intent's confidence score is greater than or equal to the configured threshold, Virtual Agent considers it a good match.
- Auto-selects the highest predicted intent.This occurs when only one intent is matched, or in the event of a tie-breaker, when the next closest match is a distant second.Note:If ServiceNow NLU is used and the Intent Confidence Delta field in the ServiceNow NLU driver table (open_nlu_driver.list) is set to 0, there can be no tiebreaker.
- Returns a topic list for the requester to choose from.
This occurs if auto-select is not applicable. The length of the list is determined by the com.glide.cs.max_number_display_topics system property.
- No intents are matched.
When zero NLU Intents are predicted with a confidence score greater than or equal to the configured threshold, Virtual Agent falls back to a keyword search if configured. (The com.glide.cs.nlu.keywords.enabled and com.glide.cs.nlu.keywords.include_topics_bound_to_lang system properties are true).
Mid-topic NLU topic discovery logic
While a topic is running, the requester can enter an utterance or phrase that results in a topic switch. For example:
- The requester is in a Virtual Agent conversation, and Topic A is running.
- Topic A prompts the user to enter their date of birth.
- Instead of choosing a date, the requester types, "I want to view my Incidents."
- Virtual Agent can't resolve this phrase to a date, so it issues an NLU prediction request.
- The NLU predictor returns Intent B, and Virtual Agent sees that Topic B is bound to Intent B.
- Virtual Agent switches the conversation to Topic B, which then presents information to the requester about their incidents.