How to get an AtBot with a dash of LUIS

Mick Herres
AtBot
Published in
10 min readJan 26, 2018

This is the first article in a two-part series. When finished, read Part 2.

The simplest way to get started with AtBot is to use basic keywords or phrases to trigger skills. Create a simple Skill with the trigger New Ticket that then asks the user for a description of the problem and submits a ticket. Leveraging Power Automate, that ticket can then be submitted to a management system such as ServiceNow to be processed. Nice and simple for sure.

But the down side is your users are responsible for knowing the keywords that will trigger your processes. As the number of Skills grows, everyone will have to effectively learn a dictionary of prescribed commands.

So let’s look at how you can give some extra smarts and create a more natural, intelligent experience for your users. We’ll use LUIS to achieve this goal.

Wait, what’s LUIS?

LUIS, Language Understanding Intelligent Service, is part of the Cognitive Services family within Azure. If you are an Azure customer, you can work with LUIS. It’s super easy to get set up (more on that below) and very fun to use. LUIS lets you define Intents — or things your users want to do — and allows you to train LUIS how your users will ask for those things.

As it relates to AtBot, this means you can be more flexible in identifying what your user wants to do. They don’t need to be trained to say exactly New Ticket, but can rather communicate with the bot more naturally. All of these will work:

  • “I need a new ticket.”
  • “I need to submit an issue.”
  • “Can I create new ticket?”
  • Even, “My mouse stopped working.”

Check out demo video below, which uses LUIS to triage IT trouble tickets based on whether the user wants to create, update, or close a ticket in ServiceNow.

Getting started with LUIS

Let’s dive into LUIS and create some smarts. First, navigate to the LUIS homepage https://www.luis.ai. Log in with a Microsoft account tied to your Azure tenant.

If this is your first time ever logging into LUIS, you will start at a more general getting started screen. Scroll to the bottom and click Create LUIS app.

The LUIS home page.

Select your country, review and agree to the terms of the service, and click Continue.

I hope you read the terms of service completely!

You will then be taken to the My Apps screen. If you haven’t done anything with LUIS previously, you should see an empty listing.

A blank canvas can be beautiful.

There’s an app for that

I mentioned Intents earlier. In LUIS, Intents live inside Apps. The importance of this will be clear later, but for now just know you need to create an App and you then create your Intents in the App.

We’re going to create a LUIS App that contains all Intents related to help desk support. Initially we will train the App to understand requests to create new tickets, but we could also train it to understand inquiries about existing tickets and/or requests to update/close tickets.

When you interface with LUIS, you are interfacing with a specific App. All Intents in that App will be checked against the text you send to LUIS and LUIS will tell you which Intent it thinks the text is a best match for; it’s basically translating human language into computer commands.

It’s worth noting now that the App construct is where we define the context of what we want LUIS to do. Each App is akin to a specific area of expertise. If I wanted LUIS to help with HR-related questions in addition to IT help desk questions, I would most likely want to create a separate App for the HR interactions.

From the My Apps page, click Create new app and give it a name and description. Our HelpDesk app has the following values.

Create a new App in LUIS.

Now that we’ve got our app, let’s look around a bit. We’ve got a left navigation with some links around creating Intents, Entities, and improving performance of the App.

There’s lots of stuff we can do in our App.

Within App Assets, we mostly work with Intents and Entities when creating our App. We will not be going into Entities during this article. (A future article will expand upon this one and include Entity usage to further improve the user experience.) You can explore the app performance links as well. For this article, we will be focusing exclusively on Intents.

Continuing our tour, looking across the top, we can see some higher-level actions to take against the App. In this article, we’ll be looking at most of them: Build, Train, Test, and Publish.

Introducing your App toolbar.

The Build tab is where we define our Intent. We then train the App (which trains all defined Intents), test it, and when we’re ready we can publish the App. Once we’ve published it, AtBot can use it!

For all Intents and purposes

Under the Build tab and with the Intents App Asset section selected, we should be looking at a listing of Intents with a button to Create new intent or Add prebuilt intent. You’ll note there is an Intent named None already listed. This is the one built-in Intent all Apps will have that is the catch-all for when text from a user does not match any of the defined Intents.

The text users send to the App are call Utterances. Going forward in this article we will use that term to represent data coming from users.

‘None’ is the default Intent that LUIS uses if it doesn’t understand an Utterance.

Let’s create a new Intent. You only need to provide a name for your Intent to create it.

Create your new Intent.

Click Done and you’ll be asked to provide five example Utterances to initialize the Intent. Type these in the text box provided and hit Enter after each one to add it.

Provide your example Utterances so you can train your App.

Now you need to train your App. Click Train to train your App to recognize the NewTicket Intent. You’ll know you need to train your app when the Train button has a red dot on it; when you mouse over the button you also get the message you have untrained changes. Once trained, you will see that your Labeled intent column now contains a score of 1 for the five Utterances whereas before it was a score of -1.

Once you’ve trained your App, your Utterances get a positive score.

Now let’s try out the App. Click Test and try some Utterances. If we try a phrase we trained the App on, we see that it gave us a score of ‘1’ for the NewTicket Intent. Let’s also try something similar but not exact. For example, instead of “I need to create a new ticket,” let’s say, “Can I have a new ticket created?” You should see the second phrase was also matched to the NewTicket Intent with a score of ‘1’. This means the LUIS App was 100% positive the utterance maps to the NewTicket Intent.

Test alternative phrasing to see what LUIS understands.

Congratulations! You’ve just trained your first LUIS App to recognize when a user wants to create a new help desk ticket.

Putting your App out there

Let’s publish this trained App and tie it into AtBot to show how we can now use it.

Click the Publish tab and for this first go-around plan to keep all settings default. Feel free to change the time zone, though. As with most Microsoft products, it defaults to Pacific Standard Time (US). I set mine to Eastern Standard Time.

Under Resources and Keys, make sure you’ve got a key listed. You should at least have access to the free key that gives you 10,000 LUIS calls per month for free. If you don’t see anything listed, you will want to click Add Key and get a key created.

Once you have a key, click Publish. By default, it publishes to “Production”. For now, since LUIS is not being used for anything else, let’s leave it that way. Click Publish to production slot. You should see a publish date near the top.

You’ve published your first LUIS App!

You now have a published App! Now let’s try it out in the browser before connecting it to AtBot. From the listing of Resources and Keys, click on the link in the Endpoint column. That will take you to a page where you can see the JSON output from LUIS when accessing your App programmatically. The initial output looks like this:

{“query”:null,”intents”:[],”entities”:[]}

The reason for that is the default Endpoint link from that Publish tab does not include any sample utterance. You are essentially making a call against your newly trained LUIS App and sending nothing as your utterance. Put your cursor in the address bar of the page and put it at the end of the URL. You’ll see the following which represents your empty utterance.

The ‘q’ stands for query. This is your empty query.

Now, let’s add our utterance to the end of that. It should read something like this. You can use normal spaces (as opposed to %20) when typing it out. The browser will encode it.

&q=I need to create a ticket

Hit Enter and now you should get back something like this:

Your in-browser LUIS response.

We now have a working LUIS App that we can send utterances to and get Intents back based on score.

Time to get AtBot

Now let’s wire this up to AtBot to show how much more flexible an AtBot Skill can be when integrated with LUIS.

First, you need your API key. From LUIS, click on your name in the upper right corner and select Settings. You’ll see a Programmatic Key listed. Copy that value. We will be using that in Power Automate when setting up the AtBot Skill.

Next, navigate to Power Automate and start the creation of a new Flow with the AtBot When an Intent is used trigger as the starting point. If you aren’t sure how to do this, take a look at our getting started page. A basic setup before LUIS integration would look like this.

Creating your first Flow step for the new Skill.

During testing (i.e., before rolling this Skill out to everyone), make sure to set the Bot Trigger Type to Personal so only you can use it. When you are ready, you can switch that to Shared to allow other users to use it. Just don’t forget.

Next, click Show advanced options. You should see three new fields. First, supply your Programmatic Key you copied from LUIS earlier in the LUIS API Key field. You should then be able to select from the LUIS App dropdown the App you published. If you named it HelpDesk, you should see that option. Otherwise you will see the name you gave to the App. Once you’ve selected the App, you can now select the Intent. The trigger will look like this.

You’ve successfully connected LUIS to AtBot.

Now, let’s add a simple response from AtBot so we know the Skill was initiated based on the message sent to the bot from the user. Click Create Flow to save the flow as an AtBot Skill.

Simplest skill to test your new LUIS App in AtBot.

Now, let’s bring up AtBot in Microsoft Teams, and try out our new Skill. Type “I need to create a new ticket” and you should get back the message you put in the Send reply action above.

AtBot’s learning!

Try other utterances and see how your users can now interact with AtBot much more naturally!

I can say I need a new ticket in many different ways with the same outcome.

Wrap up

So there you have it: you’ve successfully integrated AtBot with LUIS and made it much easier for your users to interact with the bot.

Now that you’ve wired up the LUIS App to the AtBot Skill, you can apply additional training by providing more example Utterances for the Intent used in the Skill. This will optimize AtBot’s understanding. Once you publish the updated LUIS App, the AtBot Skill immediately incorporates the LUIS changes.

You can continuously improve the LUIS App smarts and AtBot will use it. In future articles, we will show how you can work with multiple intents from LUIS and Entities as well.

LUIS is a very powerful tool which, when paired with AtBot, empowers your organization with intelligent, easy-to-use automation. There’s a lot more you can do with LUIS, so move on to Part 2 of this series when you’re ready.

Now it’s time to get AtBot

AtBot is the premiere bot-as-a-service solution for the Microsoft cloud. Built completely within Azure, AtBot is your out-of-the-box, easy-to-configure bot for Teams, SharePoint, or the web. Teach AtBot tasks using Power Automate, make him your corporate source of knowledge with QnA Maker, help him understand almost anything your colleagues could ask thanks to LUIS, and manage his features with the AtBot Admin Portal. Get going with AtBot Free or start your 30-day free trial of AtBot Enterprise today.

--

--