Rajiv Handa
ServiceNow Employee
ServiceNow Employee

Ever since Generative AI knocked on the doors of the world, it has shackled the nooks and corners of all organizations, be they small-scale or large enterprises. So is the case with Servicenow, which has decided to imbibe GenAI in each and every workflow. One of the very important aspects of Generative AI is writing effective prompts. You will find a thousand videos and articles online on how to write an effective prompt. But this article is about how to write a prompt while creating topics in the Virtual Agent Designer. Let's get started.....

 

While creating a topic, the first area where the LLM prompt comes into the picture is in the properties tab, there is a field titled Topic description used for discovery, which is used to describe:

  • What the topic is about?
  • What are the standard utterances that should lead to the discovery of this topic?
  • What this topic is not about?
  • Any limitations about when the topics should not be discovered.

Here is a sample prompt for one of the topics related to the Holiday Calendar:

Users often inquire about upcoming company or regional holidays without mentioning a holiday calendar. 
They seek information on the next holiday, using phrases like "next corporate holiday," "next company holiday," "when is the next holiday," "upcoming holiday" or simply "next holiday." 
Their intent is to determine their next holiday, often specifying their country or region with phrases like "When is the next holiday in my country?" or "When does the next holiday come in my region?" 
This helps them plan their schedules without explicitly mentioning a holiday calendar. This topic is not meant for time off related queries.

Secondly, with conversational experience getting more mature with every ServiceNow release, the best experience is where the user has to type very little, and the system automatically understands or slot-fills most of the information. To support this, it's very necessary that variable names (script vars and input vars) and node names are self-explanatory. For example:

  • Instead of a variable name as a response, use query_response.
  • Instead of the node name, as Get Input, it could be Get User Current Location
  • Also, Avoid using reserved keywords like response, request, topic, option, etc.

Thirdly, while creating a node in a topic, there are specific fields like Detail Description in the 'Static Choice Input' node, etc., which should include details about:

  • what the node is about.
  • what values does it expect from the user?
  • What values should not be considered?
  • Suggest a decision path to handle extracted values that don't match the choices.
Ask the user about the "Types of benefits documents available." 
For additional instructions, "Do not extract a value unless specific terms like 'policy,' 'elections,' or 'contribution' are present."

Remember, GenAI is highly probable. I call it 'Very Moody'. You must try various permutations and combinations to get the desired output from an exact prompt.

1 Comment