This video series is for you if you're new to Cognigy.AI and would like a quick tour: It will provide you step-by-step guidance from finding your way into Cognigy.AI, getting help, understanding the UI up to successfully rolling out your first Virtual Agent. Enjoy the training!
Trainer: Derek Roberti
Playtime: 27 minutes
Version: Cognigy.AI v4.0
Captions: English, 日本語
Chapter 1: Getting Help
Learn about Cognigy's resources and documentation.
As you work with Cognigy, you'll need help and the best place to get started is on the "Agent Dashboard". If you look under the "Get Started" category, you'll see a number of helpful options to help you get started. And you'll also see a link to our Help Center.
In the Help Center, you're presented with four options: First, you can explore Cognigy and learn how to get started. Next, you can view our step-by-step How To's and Tutorials. You can ask questions of the Cognigy community, or you can file a support request.
To see more detailed documentation, you can click on "documentation" at the top of the page. And you'll be taken to our documentation site at "docs.cognigy.com".
To view API documentation, click "Guides" and then "API Reference". And you can choose the API version that you're looking for to view our OpenAPI Viewer.
Chapter 2: Where Do I Click?
Familiarize yourself with the Cognigy.AI user interface.
- Not available for this chapter
How do you make your way around the Cognigy user interface? This video is all about clicking. So get your mouse or trackpad ready while we take a tour of Cognigy.AI. Let's start on the Agent overview screen. The screen, you see when you first log in. On the left side of the Dashboard, you'll see your Agents. I currently have none, some News, and some Getting Started resources. Be sure to click here on the "Help Center" for some great step-by-step tutorials. I'll create an Agent by clicking "Create Agent" and making my way through the wizard. I'll use the "Restaurant" template as our example when exploring the User Interface.
On the Agent Dashboard, I'll see some analytics. There's no data now, but more will show up once I go live. And I can click on this arrow to see more. Let's focus first on the left bar. Hover over it to see some top-level navigation categories. And click on a category to see the resources there. The first place I'll go is under Build. We'll open up Flows. Here, you'll see all of the Flows I have in this Agent and I'll click on my "Main" Flow. You can move around the Flow Editor by dragging and scrolling, pinching, and zooming. And you can also control the zoom in the lower right corner. To add a Node to your Chart, you can click any plus sign. There, you'll see a searchable list of Node Types.
I'll add a Say Node to the top of the tree. Notice that I can "control click" to see useful options like Copy, Paste, and Delete. And I can even expand and collapse whole branches of the tree by choosing that option in the "Context Menu". Or just double-clicking on the Node. Lastly, I can drag and drop to move Nodes around the tree. At the top, I can click on NLU to go to the Intent Editor. We'll review the Intent Editor in greater detail in another video. But for now, you'll see the existing Intents on the left side. At the top of the Intent Editor, you'll see the other options, such as attached Flows and attached Lexicons.
I'll switch back to Chart View.
To interact with my Flow. I can access the Interaction Panel by clicking the bubble icon on the top right corner of the page.
I can type in a message to start the Flow.
Within the Interaction Panel, I can click Chat, Info, or Settings to see more information and configuration options. When I click on Info, I see a submenu to view the Input, the Context, the State, or the Profile. To clear out the Chat, press "Control-B "on your keyboard. You can also click on the vertical ellipses, and select "Clear Chat". Back at the top, I can also click on the profile icon to see My Profile, set Access Controls, and other options. Finally, to return to Agent Dashboard, click on the Name of the Agent. To return to the Agent overview, click on AI.
Chapter 3: Let's Learn More About NLU
Get to know Cognigy's Natural Language Understanding and make your Virtual Agent smart.
Let's learn more about Cognigy NLU or Natural Language Understanding. I'll click on NLU at the top of my Flow Editor to look at the Intent Editor. I can upload or download Intents by clicking here. To create a new Intent in the Intent Editor, just click Create Intent. And enter a name.
Once you save your Intent, you'll see the Intent listed along with the option to enter example sentences. Enter five example sentences, and click Save to create your Intent. Intents have other interesting configuration options, such as the ability to create "Default Replies". A Default Reply allows you to respond to the user without adding any Nodes to your Flow. This can be valuable for cases where you're just giving a simple output and there's no real logic to execute. You can also enter a confirmation sentence. If the user's input doesn't quite meet a confidence threshold, but it's close enough, you can ask the user a question to confirm that this Intent is exactly what they're looking for. And you can also choose an Intent entry point. By default, Intents will go to whatever was the last entry point in your Flow. But you can specify this if you want the Intent to start off on a different part of your Chart. Annotations provide a user interface for annotating your example sentences. So, for example here, if I choose a location, I can double click. And then click the plus sign.
I can specify which Slot match or Lexicon match this word is associated with. What this means is I can enter fewer example sentences because I don't have to enter one example sentence for any potential Slot match I might be looking for. After you train your Intents, Cognigy provides Intent feedback. The system shows red, yellow, or green dots on each example sentence, each Intent, and the model as a whole. And this feedback can help you identify overlapping example sentences, and sentences whose uniqueness could be improved. Your objective isn't to have all green lights. But it gives you useful feedback in case you're not getting the Intent accuracy you're looking for. Cognigy.AI also provides multi-step Intent detection and Flows using hierarchical Intents. To create a hierarchical Intent: first, create a Parent Intent then you can create Child Intents. Finally, go back to your Parent Intent and select Inherit Example Sentences from Child Intents. Save and train, and now your model will be able to be even more accurate in detecting a user's Intent. In addition to providing a more efficient and accurate approach to Intent detection, hierarchical Intents make it easy to organize Intents. Under attached Lexicons, you'll choose whatever Lexicon you want to attach to this Flow. I want to talk for a moment about "Slot Fillers". In normal human interactions, we sometimes convey information all at once. And at other times we convey information one piece at a time. For example, I might say "I want to travel with three people to San Francisco next week". Or I might say it one at a time:
"I want to travel ... to San Francisco ... with three people ... next week."
In Cognigy, we can understand users, regardless of which approach they take. We do this with what we call the "Missing Pattern". You can deploy the Missing Pattern by using Slot Fillers. Slot Fillers keep an eye out for Slot matches and store those matches in the Cognigy Context. Used in combination with Question Nodes, you can achieve the Missing Pattern in a more straightforward fashion without writing code. To learn more about Slot Fillers, take a look at the documentation in the Help Center. While your model is training, you can look at the activity monitor to see how things are going.
Chapter 4: Let's Build Something!
Build a Virtual Agent that flexibly responds to user input.
Let's build something! Let's start from scratch and create a simple Flow that asks about dietary preferences. Our requirements will be threefold: The user will ask if we have offerings that meet their dietary needs, then the bot will respond with menu recommendations based on the user's preference. We'll give a static example where we just output some content that we store in the bot itself. And we'll do a dynamic example where we pull in data from an external system and give an answer. To realize these requirements we'll need a Lexicon with different dietary restrictions, an Intent that will match inputs related to dietary requirements, and a Flow that will process the user input and respond back. We'll also use an Extension to query dietary information in an external database. First, I'll create a new Lexicon and call it "Diet". I could create Key Phrases manually in the UI, but instead, I'll just upload a Lexicon I already created. You'll see the Lexicon includes Key Phrases, Tags, which are just categories for the Key Phrases, and Synonyms, which are different words that could point to the same Key Phrase. Now we'll create a new Flow called Diet. I'll click on the NLU tab at the top and create my Intent. I can enter these Intents into the UI, but I'll go ahead and just upload these as well.
I want to add some annotations, I'm going to first associate the Lexicon I just created with this Flow. Now we'll go through each dietary restriction and annotate it. This saves me from having to create example sentences for each diet type. I'll save and I'll train.
The last step is to build the Flow in the Chart View. I'll create a Once Node and paste in the nice welcome message we saw earlier. I'll say to the user, "How may I help you today"? I'll handle the response by adding a Lookup Node. This lets me respond differently based on the user's Intent. I'll change one of the Case Nodes to use the Intent I created earlier. Finally, I'll respond by telling the user that we support a variety of dietary restrictions.
If they mentioned a specific one, we'll let them know something specific about their preference using another LookUp Node. I'll use CognigyScript here to check for the Slot match.
Alright, let's test it out. I'll create a Playbook so we can reuse this script in the future. As a final step, I want to retrieve data from an external system to give an example. To do this, I'll use a Cognigy Extension I created for this training.
I'll add the Extension Node to my Chart and I'll send a request for an option that matches the user's dietary preference. We can imagine that this is coming from a list in order management system or a content management system. I'll pass in the user's dietary preferences and return a result. Now let's run our Playbook again.
And that's how to get started building a simple bot using Cognigy.AI.
Bonus Episode: Let's Build Something More!
In this chapter we'll go much deeper and look at Lexicons, Intents, Slot Fillers, Flows, Extensions, Question nodes, Context, Copy Data to Context, Extensions, Webchat Plugins, Endpoints, CSS customization and Embedding on a website. Have fun!
This video is a follow-on to the basic training videos, and provides some inspiration on how to use more Cognigy features. I'm going to visit an imaginary site that lets me check flight status across multiple airlines. If I linger on the page, the bot asks me if I need help, and I do. I'll start by asking about my flight status. I'll give the chatbot some answers, one by one. I get my results back from the Aviation Stack API. And now I'll click on a result to see the flight details. Let's do another search. But this time I want to take more of a natural language approach. I'll say "I need to check my flight from ORD to SFO on United". Note that the bot skips all of the questions it asked before because it has identified the airports in the airline automatically.
I can switch up my word order and use city names instead of airport codes. So, I can say "I need to check my flight arriving in San Francisco from Chicago on American". The bot understands, regardless of how I express myself. If I leave out a detail, the bot will make sure it asks me. So, I'll say I need to check my flight arriving at LAX from Chicago.
Alright! So let's take this apart one by one and see how it's built in Cognigy. Let's start with looking at how Cognigy recognizes cities and airport names. I'll go to my Agent and look at my Lexicons. Out of the box, Cognigy ships with Lexicon for airport codes. So that gave me a head start in creating this Agent. I also created a Lexicon for airlines that are common in the US. Note a couple of things here. I've added Synonyms to a number of the airlines to reflect the ways that users might refer to these terms. I've also given each of them a Slot name. You might remember from other videos that you can upload and download Lexicon as a CSV file if it's easier to edit them in Excel. I've also created a Miscellaneous icon for different entities that I might want to track in a conversation. In this case, I want Cognigy to recognize different ways of specifying an arrival destination and a departure destination. Ok! My Lexicons are all set up.
Now let's switch over to the Flow and look at the NLU configuration. We're tackling a simple use case here, "Checking flight status". So I've just set up one Flow. In a normal scenario, you'll have numerous different use cases. And you'll likely build them in separate Flows. This allows you to create your conversations modularly, making it easy to organize and reuse Flows. I'll click on NLU at the top of the screen. And I have just two Intents: A flight status Intent and a Search Again Intent. With just two Intents, I don't need to create any Intent hierarchy. So let's just click on flight status. To recap our earlier video, to create an Intent in Cognigy, you add example sentences that teach the system how to recognize and predict user Intent. I've done that here with examples like "What's the status of my flight" and "Checking on my flight status". I've also added annotations to my sentences. So in the case of, Is my flight from SFO to ORD on time?, I've associated SFO and ORD to the Slots that I defined in my airport code Lexicon. Here, I also add an example of specifying the airline name. The point of this is to reduce the number of example sentences you need to create manually. Essentially having placeholders that stand in for Slot matches. The Search Again Intent is a little different. This is just to reset the flight details when the user wants to search for another flight. I gave it a special casing to note that this Intent is typically triggered by a Quick Reply button. But I also added some example sentences in case a user writes a sentence instead of clicking on a button.
Let's quickly look at attached Lexicons. And you can see that I've turned on the airline's airport codes and Misc Lexicon so that I can use them with my Flow. Finally, I created a Slot Filler. Slot Fillers are helpful when you want the NLU to keep an eye out for a specific Slot match. I wanted to watch out for airline names. So they don't have to ask the user which airline they're on if they've already shared that information. Alright! Now let's look at the Flow. I'll open the Interaction Panel and say "Hi". You'll see that we immediately hit the Once Node, which then leads to the On First Time branch. This is where you can put any messages to the user that should only be output once in a conversation.
Now, I'll say "I want to check on my flight from SFO to ORD on United". Let's see what's going on.
In the Chart, you'll see a couple of Nodes that we'll talk about later. Copy Data to Context and the If Node. For now, let's go to the Lookup Node where we check the user's Intent. We get a match for the flight status Intent, and then we hit the Fill Aviation Slots Node. What's this? It's a special node created as a Cognigy Extension. Cognigy Extensions are Nodes you can create using the same pattern. Cognigy uses to build out our out-of-box Nodes. If I click on the plus sign and go to Extension's, I can see all of the Aviation-oriented Extensions I created for this project. In many cases, you don't have to create Extensions. Cognigy gives a lot of flexibility in the Standard Nodes and Code Nodes and for retrieving external data HTTP Request Nodes. But it can be nice to package more complex logic up into Extensions just to make life easier for Flow Developers. The Fill Aviation Slots is how I approached mapping the right Slot matched to the departure or destination city. A user can say, "I'm leaving San Francisco", "I'm departing San Francisco", "My flight is from San Francisco". And they can say these things before or after they specify what their destination is. The logic for this isn't too complicated. But it's even simpler if I put it into its own Node type.
Next, we hit this Question Node. What airline are you flying on? Now, We didn't hit this Node in the example I just showed. Why? Because if I go to context, you'll see I turned on "Skip if answer exists in context". Because I set up a Slot filler for this already, Cognigy is always on the lookout for the Slot match. If it's already in the Context, it will skip this question. A similar logic applies for the subsequent questions, if the answer is already in the Context, Cognigy isn't going to ask the question. Imagine if I said I want to check on my flight from SFO to ORD on United. And the next question about "Ask me" was where you flying from? Well, it wouldn't be the best experience and the bot wouldn't be acting intelligently.
Alright, Now clear the Interaction Panel using my favorite shortcut, "Control-B"or "Command-B". I'll show you what happens if I leave out one piece of information. I'll say I want to check my flight from SFO on United. Now it asks me for my departure city. Once I provide all the information it needs, it gives me a confirmation message. Here we use some CognigyScript to output the Context Variables I've collected so far. I get these values from the Cognigy Context, which you can see here.
The next step is I run another Cognigy Extension called "Get Schedule". Get Schedule passes the Departure City, Arrival City, and airline to the Aviation Stack API and returns results. Behind the scenes, I'm just making an HTTP Request to the Aviation Stack API. And passing it the API key that I defined my connection here. I could have done the same thing using an HTTP Request Node. But it's cleaner and easier for a non-technical user to do it this way. And to make it even easier, I've defined Tokens that hide the underlying CognigyScript, I used to get to the Context Variables.
Finally, I use a Show Scheduled Results Node to output the results. The reason I do this, rather than using a Say Node, is that I want to use a Webchat plugin to output that nice table we saw in the Chat Interface. I could achieve this in a Say Node just using a data payload. But using Extensions makes it less error-prone and it's simple for a non-technical user. So at this point, we've output the table of results, which you see here. And this is using one of our out-of-the-box Webchat plugins that you'll find on GitHub. When you click on a row in the table, it passes some data back to you. This is why I added the copy data to Context Node at the beginning of my Flow. In the If, I check to see if I have table data pass back to me. That's the data from the table of flight results. And if so, I render that nice visual of the flight details.
To do this, I'm using our Adaptive Cards plugin that lets me create some nice visualizations in the chatbot. Again, you can find this plugin on GitHub. If the user wants to search for another flight, I want to clear out all of the data we've collected so far. I present a button that says search for another flight. And I use this 'cIntent' notation to tell Cognigy that when the user clicks this button, I want to trigger the Search Again Intent. Let's look at that here. You can see I'm removing each Context Element from the Cognigy Context, using a Remove from Context Node. And finally, I let the user know they can search again.
How can we preview this? There's a quick way you can use for testing, and then there's the approach you'll actually use to embed the Chat on the website. The simple way to preview is go to Deploy Endpoints, and create a Webchat Endpoint, as I've done here.
If you look at my configuration, I've put links to the plugins I'm using. One for the Table Display and the other for Adaptive Cards. I've also had a nice background image. To preview, just click open Webchat. To embed the Webchat on your website, you can use our simple Embed Codes. You'll find them on GitHub in the documentation for our Webchat Widget. I'll walk you through what I've done. In my HTML, I've linked to my Webchat Widget and my plugins, just like I did in the configuration in the UI.
To start my Webchat. I've executed the "initWebchat" method. More on that in a moment. One of the things I've done is add some styling to my Webchat Widget. Cognigy makes it easy to customize any aspect of the Webchat. I wanted to make mine a little bit wider. So it would be comfortable for users to see the table of scheduled results. You can see full documentation on customizing the Webchat Widget here.
Let's take a quick look at options for the Embed Code. If I go to GitHub, I can see all of the options available to me and quickly see some examples on Code Sandbox. For example, see this one of embedding the Webchat using Webchat plugins. You can use Code Sandbox as a quick way to test your Embed Code. Just save and you can preview the change immediately. I hope you enjoyed learning about Cognigy from this video and got a little deeper into the possibilities of what you can build.