logo

NJP

Virtual Agent Academy: Using dispatcher topics to improve your Virtual Agent conversation

Import · Jul 27, 2022 · video

all right we're gonna go again and get started as always uh feel free to visit our va and nlu community for all the latest resources and q a and if you like what you're seeing uh where all of this will be recorded and put on youtube uh within 48 hours or try to and if you're watching on youtube if you like what you've seen go ahead and click that like and or and subscribe button and there you'll see our playlist of all the latest va academies and you'll get notified whenever a new video is uploaded so today's topic uh is a big one it's how to use dispatcher topics to improve your virtual agent conversations and i've been thinking about this topic for a while i know that it's a guidance that we've been sharing in the past and i wanted to really break that down and provide some uh steps on how to achieve dispatch topics and what to do and not do so let's jump right into that so yeah it's basically our overview exercise and q a so what is a dispatcher topic now you might have heard this term thrown about sometimes but a dispatch type is basically a topic that can direct users to other related topics and those other related types that you get directed to or dispatched to we call target topics so you usually have a dispatcher topic leading to a target topic and usually when you hear the dispatch topic and you're like oh that's fancy should i create one well you know i usually follow this train of thought number one you know can the question be addressed via ai search right is it a one and done question if it's if it can be then maybe you use yeah i searched to surface that knowledge article or surface that catalog item right however if the answer to the user's question is it depends then you should consider definitely using a virtual relation topic right and if the question contains you know if they're if that question uh leads to several similar topics per item or per object basically you know different flavors of very similar topics are intense then you should consider using a dispatcher topic right there's no use well not no use but rather than having five topics you know fixing issues for say teams and webex and slack or different hardware different software you should probably create a dispatcher topic that leads to other uh similar topics so then you know how do i create a dispatcher topic right well in this is you know the very high level brief answer right you first want to sketch out your topics ahead of time right you want to figure out what's the most scalable approach you want to start with the user problem as your dispatcher topic in other words the verb right you know you want to fix something or you want to request something or solve or answer something whatever it is you're trying to achieve for the user that's what you want as your dispatcher topic and then that leads to objects or nouns for your target topics right so if it's about different software you know adobe teams webex those are good candidates for target topics right or if it's about you know lenovo ibm or about different uh benefit packages uh you know fidelity morgan stanley um united health those are good candidates for target topics right and then you build out your topics you build out your nlu intent and your you know and entities for the dispatcher topic and you test and we're gonna go through that uh in the exercise some do's and don'ts of dispatcher topics you do want to try to keep it to less than five target topics per dispatcher topic uh after five it's it can be difficult for uh admins to manage those topics to test those topics etc right uh after five you may you know want to think about whether or not you know that that sixth target topic should just be search to uh funnel those to a search engine rather than trying to build out more and more targeted topics right you do want to label your target topics with dispatcher topic name in va designer so if i have like one dispatch topic with that leads to say three target topics those three target topics we should label them with the dispatch topic names that you're you know you can find them easily and you do want to keep dispatcher topics to one level and i know it's tempting to say ah well i can you know create two or three levels and target topics could also be dispatched topics that lead to more target topics tempting but um you know it's recommended you keep it to one level again for simplicity uh easier to manage easier to test the user doesn't get lost and if they you know want to go back you're not sending them uh you know back multiple levels inception style right so just keep it on level where it all possible some don'ts uh don't use talk uh don't use topic blocks as target topics unless you plan on repeat use elsewhere so if i've got a target topics on for example how to fix microsoft teams um that shouldn't be a topic block but if the topic block is saying oh or the target topic is like oh it's going to leave to a live agent or it's a search or something else that i'm going to use multiple times and then you can use then it's you know you can use topic blocks don't make target topics discoverable or even visible you can help it so if you've got target topics like you know one topic how to fix teams one topic how to fix web back one topic how to fix i don't know some other messaging app or collaborative app you run the risk of conflicts right or nlu collisions or keyword collisions so you want to make your target topic i'm sorry your dispatcher topic discoverable and your target topics not discoverable you don't even want them visible on the show everything topics you can if you want but if you want to want to clean up your show everything list just don't make them visible and then finally don't jump directly to a target topic the reason why is if if you jump to the wrong target topic uh it's a long way back for the user maybe you know way back to the user it's a very bad experience so you know throughout these do's and don'ts the overall message is you know it's better ux to repeat and ask and confirm with the user uh where they want to go rather than get it wrong because if you know i i'd rather go through you know repeating myself and saying yes or no just one or two more times than getting sent to a completely different or wrong place or location and that's when i really get upset right so those are the do's and don'ts this is so let's jump into the exercise this is what i'm going to do exercise i'm going to create a dispatcher topic i'm going to create a dispatcher nlu and intent create target topics and connect the dots and test and for this exercise i'm not going to use an it or hr uh situation those uh already in my instance and i may conflict reviewed or may i get it may get conflicted so i'm going to use board games right and this is what my design is going to be look like when i said hey in the very beginning hey sketch out your topics this is what i'm doing so i'm sketching out uh a dispatch topic you know saying learn how to play a board game right this could easily be learn how to use ms teams learn how to fix xyz right you know it's i try to use something that's very analogous right and then my target topics are going to relate to my nouns my different games right and then in each target topic i'm going to have you know uh ask hey do you want to learn basic instructions or advanced strategies right um so let's with that let's jump right in so before we start i am going to show you what i built and i'm going to show you you know how to build it so where is my designer here we go so um i've got a greeting here i'm going to say you know learn to play scrabble okay you can see i've got intent i've got a topic my dispatcher topic and i've got an entity uh board game scrabble and then so you want to switch your words to scrabble it's confirmation yes i do let's play some scrabble do you want instructions or strategies right at this point i'm in the target topic i'm going to say hey i want to just learn simple instructions and i i don't i didn't type it all out but this is that do you want to learn another game what i do is if i click no it just ends the conversation i click yes it switches me back to the dispatcher topic and uh scrabble no it's one another game and then it i'll take me to the menu uh that i skipped earlier because again i've had entity recognition these are my three um things my three three games with more target topics so you know it looks easy and it should be right and now i'll show you how to build it so that i'm going to switch over to a brand new instance so that this is going to be a different instance of what i just showed you and i'm going to show you live how to build this thing so first thing we're going to do is create a dispatcher topic call it board game or learn to play board game this is a san diego instance but you can easily do this in rome as well i think yeah i think i'm in quebec too but certainly rome or san diego um and then yes it's a topic i'll click create and create my topic for me and the first thing i want to do is enter in a static choice now let's i'll call it which game you know what game do you want to learn you know there will be scrabble monopoly and chess right and then um we're gonna bring in a decision and there'll be three branches right one for each game i'm just going to build out the scrabble branch but of course you're going to have a monopoly one and a chess one if you have any questions feel free to put them in the q a while while i'm doing this but this should be relatively straightforward you know i'm going to add another branch called other game i should add that here as well uh well this one i'm actually going to use i'm going to drag in a topic block and just run contextual search right um the context i'll look up later but my query would definitely be other game okay so let me just quickly bring up the conditions here for other it's going to be which game is other if i don't do this if i try to run this flow it's going to send me to a default and i don't know what the default is so i'm just going to eliminate that possibility by using uh configuring all of these where are my chess right yeah monopoly when which game is monopoly right now uh what is next so i've done that so now i'm gonna let's see what i should probably do at this point is add um the nlu intent and i and the reason why i should is because um you know we're going to use that to skip uh utterances so um what should we do so uh we'll go to properties here and under nlu mod i'm going to select an existing nlu model which called vc you know san diego vc model and then what you can do here this is a san diego trick here these are my existing intents i can create an intent directly from a virtual agent topic uh yeah nintendo learn learn how to play game that's completely fine so there we go we tend to be created if i switch over to nlu intent i don't have any utterances i'm going to try to add some so all my utterances are going to be in you know they're going to be like what are the rules to play scrabble how to play scrabble how to play chess you know things like that i'm going to use i'm just going to type some utterances real quickly here i should have at least 10 very least 10 but you should have more generally and i'm using a combination of chess monopoly you know how to play the game scrabble uh you know i'm doing variations uh and then the other thing i should do uh let's see how many do i have i should add some more no instructions i need help on scrabble right [Music] do i learn to play yes what instructions for play chess uh let's go oh am i missing one well before i do that you know i have i mentioned chess scrabble monopoly i want these to be entities two reasons one better better topic discovery if my if nlu knows um you know what the entity is or what entity i'm calling and two allow me to skip the the choice of you know what game do you want to play so if i type i want to learn chess or scramble it'll know oh you want to learn scrabble or you know or chess for example and it'll skip the choice for me and we'll show you how that's done so i'm doing is here is i'm just linking every uh mention of the game to the entity i just created a simple entity doesn't have to be too complicated a board game right there on the edge of the screen okay so i'm going to train this model training training okay i'm gonna try i'm gonna say you know uh learn the rules i don't think that that's in there oh it is learn i want to learn how to play scrabble just as a test and yeah you see i got 97 uh match board game entity scrabble good and good so i'm going to publish this model again in real life you probably want more than uh nine utterances but i'm getting away with it so far which is good so probably successful and let's go back to the to the flow here so once i've done that i can now as you know i'm back here to the which game input select associated entity board game and uh skip confirmation there and i think i want to enable the nlu as well let me just double check uh actually no we don't need to we're not switching topics we're just going to skip confirmation for recognized entity okay the switching we're going to do manually okay so someone's going to type you know i'm going to ask what game do you want to learn or someone's just going to type i want to learn scrabble they're going to recognize scrabble they're going to jump straight to remember we said confirmation right so let's do that i'm going to confirm hey do you want to do you want to learn to play scrabble yes or no bring another static choice here i could use boolean but you know i'm just gonna shoot of course this day of old days is when my g key or f key just decides to fly off my keyboard let's play with words learn to play scrabble now yes no right um and then another decision so if it's yes we're gonna send them to switch to scrabble topic which we're going to create in a moment uh this we'll need to just type in some things here we're going to deal with that in a moment or you know perhaps i should say dispatch scrabble and then we'll send that to end and if it's no so this is yes right if confirm scrabble is yes no is no if it's no we're going to send them all the way back to the very beginning okay oops i meant to click save not test uh let me switch my screenshot to make sure that we are i'm sharing the desktop in case you want to see pop-ups um but i'm just gonna click save here so now i need to create my target dispatcher top a dispatch target topic for scrabble so go into here we're going to create another topic and remember when i said uh you know you want to type in your dispatch topic scrabble target topic it's a topic let's create it and this topic can be much easier it's basically let's bring in a text oh no actually what i wanted to do remember um you know instructions or strats do you want to learn instructions or advanced strategies i'm going to go quickly here now because we're not even in the connected dots part but it's good to see the thought process and then let's just say hopefully the user's types of instructions here are instructions all right so i'm going to publish this topic so it's active but you see on this on this active i have a drop down here i can make this topic discoverable and visible remember i said we don't want to make it discoverable and we don't want it uh visible in the list of show me everything a it cleans it up b it um uh avoids conflicts where if i if someone types learn how to play scrabble they you know and i'll be trying to figure out whether to take you to the dispatch or target topic right so turn those off and then i'm going to go back to my dispatch topic and i'm going to say hey if someone says scrabble dispatch to that topic right so i'm going to go back to my dispatcher topic and under here i'm going to dispatch to that target topic via script and you're going to be like oh no scripts don't worry it's very easy it's just one line it's called va system switch topic by id and that id is going to be you probably guessed it the sis id of that scrabble topic so if i go to my uh sis cs topic table i refresh uh let me try to find my scrabble right there target topic copy the sys id and paste it in you're probably thinking well is this even documented it sure is let me just open up real quick so if i go to docs.servicenow.com and i just search virtual agent scripts the script i'm using i'm just going to scroll down here all the way to all the system methods is in this long list here right here switch topic by 80 tells you how to use it right so that's how you dispatch to the scrabble topic okay once we did that um let's see if i can run this let's see i'm going to save we're going to publish this let's test it so let's see let's see if i can test it here hope you can see my test window as i'm sure desktop i'm gonna i'm gonna include topic discovery right so let you just um show me so notice show me everything i've got the board game topic but i do not have the scrabble topic and it's not discoverable too so i type learn to play scrabble you see it not only takes me to my correct topic it skips this input choice and goes straight to just confirm you know do you want to use and got my board game entity at scrabble do i want to learn to play scrabble yes if i click no it just takes me to the back click yes and voila do i want to learn oh i should have mentioned for scrabble but at this point i'm in my dispatcher i click instructions i think i just ended the topic i forget so that's how you dispatch now how do you return let's show that before our time is over so let's go to back to our scrabble topic and what are we going to do we're going to switch we're going to dispatch right back to the to the dispatcher topic right so we're going to go script action return to dispatch and i should probably put in a choice here learn another do you want to learn another game oops of course again this could be boolean but i'm just going to use choice yes or no right decision of course this is for the yes branch learn another is yes go here if it's no i'm just going to end the conversation obviously this to the end so here from dispatch i'm going to do it again i'm going to switch topics switch oops uh let's see how do i what's my yeah va system lower case sorry topic by id what is this idea of my dispatcher topic let's go take a look something about board this one here if i'm moving too quickly and my apologies just want to show you everything i'm trying to show you in the 30 minutes this probably could have easily been an hour long it kind of if i wanted it to be but if you watch this on youtube at 0.75 speed you'll probably get the gist of it of course you can always replay review as well but okay that's good i should this will take me back to the dispatcher topic anyway no nlu here for this target topic so if i go back to this dispatcher topic so something you may have noticed when i demoed it the very first time when i switched back to the dispatch topic it won't take me to the very very beginning it'll take me back to the point of uh you know i switch to the topic which is probably going to be around here uh let's play with words and learn to play scrabble this is the confirmed scrabble place right and if i click no what's going to happen is it's still going to skip this input choice why because my entity is still saved as scrabble and then it's just going to skip this again and i'm just going to be putting this loop like oh do you want you know i don't want to play scrabble or play scrabble i don't want that so how do i clear the entity so that if i click no then it'll actually ask me legitimately hey what game do you want to play well luckily we have another script that helps me clear or unbind the entity and that's what i want to show you so this is unbind entity and you're going to be like oh my goodness another script is that documented yes it is uh this so this is new in rome and it's an input one because again that input was input board game and i want to input or unbind the entity associated with that input i'm going to use this right here va inputs dot my var in my case board game dot on byte entity so let's do that va inputs you see it's got auto generate or auto fill here uh which game dot i want unbind entity voila save test the top of discovery is turned on learn the rules to scrabble different i'm going to use a different utterance but the experience should be the same you see how entity is confirmed to scrabble that's why i skipped this switch game and if i type no it now effectively takes me back to scrabble because now it doesn't know what i want to learn right i've unbinded the enti the board game entity click scrabble let's learn yes dispatch me to the target topic learn some instructions you want to learn your instructions learn another game yes dispatch me back or return me back to here you know i don't learn want to learn to play scrabble click no just unbind me take me back to oops it should have taken me back to the board game well as you saw in the initial uh experience it should take sure it should have taken me back i don't know why exactly but uh i can figure i can figure that out and post the results or post my findings in the youtuber community but uh yeah that's dispatch topics i know that was a lot but i know this is a very important topic and you can you know i use board games we can apply this to all the other things that you're creating va topics for hardware software etc so i'm going to go ahead and spend the rest of the time answering questions if you're willing to stay on that'd be great if not that's fine i'll see you on youtube or via community um first question why didn't the va system method show on autocomplete that's a good question and it's probably because we just it just wasn't designed that way i think for va inputs there you know we actually know what the variables you are or you're using versus va system methods there's just so many methods like we just you know an auto complete would just you know give you a list of the dozens or so that we've documented there um chris asks we can build this topic switcher on as a custom topic block showing that such a comic but you still have to put in the topic id right so yes we could create a script action uh for for switch topic but it's still gonna be you're still gonna have some bit of configuration so um you know if if if load coding topic switch is interesting then i would say submit an idea but uh you know what we're doing here is pretty straightforward just see just dragging a script action put in one line of code and uh you're done basically if it was more involved and certainly that would have been a good use case to uh to low code it or to productize it but in the meantime we're just gonna you know make it pretty much a straightforward script action and one line of code in there how do i know whether i need to take the sys id from oh that's a good topic or i'm good a good question um that's just cs it's just this cs topic just uh memorize it i suppose but uh yeah it is cs topics ccb topic is used for other reasons um you know other architectural reasons but you definitely do want to just use it from cs topic in this uh situation here uh what is the benefit of this setup versus unit topic block well uh like i mentioned i mentioned this a little earlier uh topic you know nothing here is repeated like i'm not i'm not gonna learn to play scrabble or learn to play monopoly or say webex or teams anywhere else in any other topic so i'm not using um topics i'm a topic blocks here i'm not using setup topics here either these are all topic to topic okay uh is there a script to get entity value in the conversation yes there is if you search in community it's i they've asked that before i forget what the exact variable is or the exact function is but if you uh search them community you you'll find it but there is a way to extract entity value sometimes we are not able to train opponents models what could be reason well um i do have an nlu faq slash troubleshooting article uh so if your nlu isn't training or publishing then uh you know feel free to check that out and uh hopefully that would uh help with you with your issue okay those are all the questions i'm gonna just check chat chat empty that is a first uh thank you for listening everyone i will see you in two weeks uh for another virtual agent academy and enjoy the rest of your day air evening thank you

View original source

https://www.youtube.com/watch?v=ltFthRNsp30