We will be creating an assistant to take coffee orders.
- Go to this link and create an account: https://console.bluemix.net/registration/
- Or, go to https://console.bluemix.net/ and login if you have an account already and login
- Once logged in, click on
Catalogin the upper right corner of the screen - Search for
Assistant - Under the
AICategory, click onWatson Assistant - A service name is generated for you, but you can chagne it if you like
- Scroll down and make sure
LitePlan is selected for the free plan - Click
Create - Click on
Launch tool
- Once in the tooling, navigate to the
Skillstab and clickCreate new - Name it something like
Coffee-assistantand select the desired language
- Click
Add intent - Name the new intent
order-drink - Add a description of what the intent will do. For this, let's use "User wants to order a drink."
- Hit
Enterto create the intent - Start adding a few exaxmples of how a user would order a drink (at least 5 examples are recommended). Let's use the following:
- i would like to order a drink please
- I need some caffeine
- order espresso
- a cappuccino would be lovely
- a latte please
- Open the
Try itpanel by clicking the button in the upper right corner. This allows you to test how your assistant will respond - Wait for the assistant to finish training, then type
can I order a coffee. It should classify the intent as#order-drink. Even though you didn't train the intent on this exact sentence, Watson can still understand it. - Add a few more intents to make your assistant more robust. Try creating the following intents and adding a few examples to each:
- #see-menu (User wants to see what's on the menu)
- #greetings (User greets the assistant)
- #thanks (User thanks the assistant)
Here are the finished intents:

- Click on the
Entitiestab at the top of the page - Click
Add entityand add the namedrink - Turn
Fuzzy Matchingon if you want Watson to understand misspellings - Add a value
coffeewith the synonym ofcafe. - Click
Add valueto create the first value for this entity type - Add some additional values that you allow your users to order and any synonyms, for example:
- espresso
- cappuccino
- latte
- tea
- Click
show recommendationsto see some common synonyms for these entity values - Exit the page, and click on
System entitiesunderneath theEntitiestab - Turn on
@sys-number
Here is how your finished entity @drink should look:

- Click on the
Dialogtab at the top of the page - Click
Create - Click on the
Welcomenode if you would like to change the intro message - Click
Add nodein the upper left, and name itGreetings - Add your
#greetingsintent in the field forIf assistant recognizes. Use the drop down suggestions for easier navigation - Fill in a response that says something like "Hi! How can I help you today?"
- Create two more nodes for
#thanksand#see-menuand add responses - Make sure they are at the
rootlevel, equal to the other 3 nodes you already have - You can add response variatons so that the assistant will respond differently each time your users reach this node
- You can also add additional response bubbles by click
+Add response typeso that Watson will respond with two messages at the same time. - Note that if desired, you can create clickable buttons/drop down menu using the
Optionresponse type, you can use theImageresponse type to display an image from a URL, and you can ask Watson to pause if you want want a delay before the message shows. - Create another node and name it
Order Drink - To the right of the name, click on
Customize - Turn on
Slotsand hitApply - Add the intent
#order-drinktoIf assistant recognizes: - Under
Check for, add the entity@drink, notice that Watson automatically creates a context variable for you - Under
If not present, askadd a question like "What would you like to drink?" - Click
Add slot, and add a condition and prompt for@sys-number: "How many cups of $drink would you like?" (Note: the syntax$variableis short hand for accessing Context variables. Context variables allow you to pass information between your application and Watson Assistant, as well as reuse information throughout the conversation.) - Add in the response, "Ok, I have $number $drink coming right up!"
- Try it out! Try asking questions related to the dialog you have just created. Witness the power of slots by giving different amounts of information each time. "I would like a drink", "I want coffee", and "I want two coffees"
Finished dialog tree with Order Drink open:

- Click the blue arrow in the upper left to navigate back to the
Homescreen - Click the
Assistantstab in the top left - Click
Create newto create a new Assistant, give it a name likeCoffee Virtual Assistant - Add your Coffee Dialog Skill to your Coffee Assistant
- You will see the
Preview Linkis already enabled as an Integration, you can also add Slack or Facebook if you are an admiin of a Slack team (or want to create a free one) or are a Facebook Page Admin (or want to create a free one) - You can test your new assistant at the
Preview Linkand share the link with your friends and coworkers for testing and to gather data.
Any messages received from outside of the Try it panel will show up in the Improve tab
- Re-enter your
Coffee assistantDialog Skill, and on the left, click the tab on the far left navigation bar in the shape of a graph, just below theBuildtab that is highlighted - See how many total conversations your assistant has had, as well as some of the top statistics here
- Navigate to the
User conversationstab to see all the messages the assistant has received lately - Before making any changes, you will want to save the state of your current workspace so that your users do not interact with something that may be in progress or untested
- Navigate back to the
Buildtab on the left had nav bar - Click
Save new versionin the upper right - Give it a
DescriptionlikeFirst release of coffee ordering virtual assistant - Navigate to the
Version Historytab to see your newly saved version, click the three dots to the right of your new version and chooseAssign to assistant...to connect this new, static version to your live coffee assistant. Your Development version can remain unlinked - Navigate back to the
Improvetab,User conversationspage, and new data based on what was input into yourPreview Linkor other integrations - Click the pencil to the right of an input to add new intent data, or the pencil further to the right to add new entities. Adding new data can make Watson more confident in something you already taught, or add new intents and entities all together
- If you added brand new intents or entities, go back to the Dialog tab and create new nodes to give them responses
- Once you've added new data, test it in the
Try itpanel. If everything works as you expect, save a second new version back on theBuildtab, give it a description likeImproved confidence of first releaseand link it to your coffee assistant. If things did not go as expected or you broke something you had built before, you can always go back to yourVersion Historyand choose to copy your first version back to your development environment to continue from the original state
Did you finish the above and want to learn more? Try some of the following methods to bolster your Coffee Assistant.
If your user orders a drink and completes the flow, and they try to make another order, the values found from the first flow will still be there so they will not be able to order something else. To fix this, we need to clear the context after a successful order so the values are not stored for the next order.
- Create a node above the Slots node
Order DrinkcalledOrder Drink - Clear Context - Set the condition to
#order-drink - In the response section, click on the three button menu on the right and click on
Open context editor - Fill in both of the variables (
drinkandnumber) and set the values tonull - Click on the three dot menu on the right side of original Slots node
Order Drink, and selectMove. Then, click the new context clearing node and move toAs Child Node(So, the parent node is the context clearing node, and the slots node is the child) - Go to the section called
And finallyat the bottom of the context clearing node. SelectJump toand click the slots node, thenIf assistant recognizes condition - Change the condition of the slots node from
#order-drinktotrue(Use this condition if you want the node to always fire) - Try it out! Without clearing the try it out panel, order a drink. Once finished, try ordering another drink and it should prompt you for the two needed variables again. Here's what the finished context clearing node will look like:

Sometimes, you will want an intent to be handled no matter where the user is in their flow. Digressions allow you to respond to an intent even if a user is in the middle of a process flow, and then it allows them to return to their prior flow without losing their progress.
- Create a
#helpintent with examples like: "I need help" - Create a node below your
Order Drinknode - Add the condition of
#helpwith a response like: "I can help you order a drink from my coffee shop. Just say order drink to get started!" - Go into the
Customizeportion of the node by clicking in the upper right - Click on the
Digressionstab - Enable
Return after digression(Digressions should be on by default, this setting allows you to handle the intent and then return back to the flow) - Now to test this out, we need to get in the middle of our order drink flow. But first, since it is a slot, we need to go into the
Digressionstab in theOrder Drinkslots node - Turn on
Allow digressions away while slot fillingand click the button that only allows nodes with returns enabled. This will help you to control which nodes you want to allow to digress to - Try it out by saying "order drink", then when asked for what kind of drink you want, say "help". You should see a response from your help node with another follow up message for the next slot filling question