Building an Office 365 Connected Bot
with the Microsoft Bot Framework
Jared Matfess, Slalom Consulting
Jared Matfess
Solution Principal, Slalom Consulting
Microsoft MVP
Technology Consultant
Craft Beer Snob
2
@jaredmatfess https://meetup.com/ctspug [email protected]
Extending your bot
Bots Getting started with Cognitive Next Steps
Services
Agenda
01 03 05 07
02 04 06
What is the bot Creating a Bot Design + Monitoring
framework? service in Azure
Bots
Bots to Virtual
Assistants
What is the bot framework?
Bot Framework is a Microsoft-operated service & includes an SDK
What is the Bot It’s one of many tools that Microsoft provides for building chat
Framework? bots / virtual assistants
Microsoft’s Cognititive Services
Language Understanding Intelligence Service
Face API
QnA Maker API
Speech API’s
Emotion API’s
Etc.
Texas Occupations Code §257.002
License Renewal
7
An x-ray of a typical bot
Conversation Canvas/Channels
Web Chat
Your bot code goes here Bot Connector Service Email
Facebook
Bot web service Message input <> output
State Management GroupMe
Bot Builder SDK
Your bot code Kik
Skype
Bot Builder SDK Slack
+ Microsoft Cognitive Services Telegram
Natural Twilio (SMS)
Other services, APIs, Translation Vision/Face Emotion
Databases, Azure Machine
Language
… Direct Line…
Learning, Azure Search, Entity Knowledge
Speech Search
etc… Extraction API ……
…
Core Bot Channel – connection between Bot Framework &
communications application such as Skype, Teams, Web, etc.
Concepts
Bot Connector – connects a bot to one or more channels and
handles the message exchange between them
Activity – object exchange between the bot & channel (example
is a Message)
Dialog – organizes the conversation flow
Texas Occupations Code §257.002
License Renewal
9
Example:
Traditional
Application vs
Bot
https://docs.microsoft.com/en-us/bot-framework/bot-design-conversation-flow#dialog-stack
10
Value of the Bot Framework
Tooling
• Tools for building REST Web Sites Customer’s
Business Logic &
• Services to enrich Bot Connector Data
• Mechanisms for receive events
C#
• Data to debug and analyze
Connectors, Services, all the best interoperability
• Implements standard protocols Bot Controls
• Modeling conversations is hard. Tools help!
• UI across multiple canvases is hard. Cards rock!
• Language Understanding is hard
• Common and well understood patterns Form
LUIS QnA
Filling
Direct Line
Goals Query over database via Azure
Search
• Start Simple. Add Complexity. No dead-ends.
• Bot adapts to the user, based on context 3rd Party
• Composable and intelligent controls to manage
complexity
Getting started
Microsoft Azure Account
Getting LUIS account*
Started with Bot Framework Account*
the Bot QnA Maker Account*
Framework Office 365 Tenant
Developers
Node.js + NPM
Visual Studio/VSCode
More Bot Utterances – the sentence that the speaker relays to the
Example: “Turn on the office light.”
Concepts
Intent – what is the speaker trying to do?
“Have the light in the office turn on.”
Entity – what ‘things’ are the speaker referring to?
“Light” & “Office”
Hello World
Bot
Getting
stated Visit the Microsoft Bot Framework site - https://dev.botframework.com/
(NodeJS) Download the bot emulator - http://emulator.botframework.com/
npm install botbuilder
npm install --save-dev restify (dependency for web development)
Create your .js file
Node yourfile.js to run it
“Echo Bot”
Creating the Azure
Bot Service
Steps we’ll
take Login to Azure
Create new Bot Service
Pick Node + QnA Maker template
Train the QnA maker model
Publish the model
Test the bot
Deploy bot to Teams, Skype, SharePoint
Extending your bot with
Cognitive Services
The Challenge with
Utterances
Please turn the light on in the office
Please turn the office light on
Please light up the office
Turn the lights on in the office
Lights on in the office
Switch the light on in the office
Can you turn the light on in the office
Introducing Microsoft
LUIS
Language Understanding Intelligence Service (LUIS)
Provide the Utterance and receive back Intent + Entities
Define the Model + Train it
LUIS Pricing Details
https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/
Design + Monitoring
Analytics
Retirement Sale, Transfer Termination of employment
Designing Your Bots
Remember the goal is to easily complete a task / answer a question
• Throwing lots of technology at your bot won’t always simplify things
When writing your dialogs, consider a “human voice”
Open ended questions do not work for all applications
Retirement• Consider presenting Sale,
yourTransfer
users with dialogues vs “open ended
Termination questions”
of employment
Language vs Menus
Design 1
Teams
Retirement Sale, Transfer Termination of employment
Wictor Wilén
http://www.wictorwilen.se/yo-teams-a-full-microsoft-teams-extensibility-yeoman-generator
Resources
Bot Samples
• https://github.com/Microsoft/BotBuilder-Samples
Great article on utterances
• https://blogs.msdn.microsoft.com/benjaminperkins/2016/12/13/1000-must-have-utterances-
for-your-chatbot-using-luis/
• https://tutorials.botsfloor.com/opening-up-a-dialog-with-my-chatbot-4b653fe7ffcc
LUIS Bot (looking for a hotel)
• https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/intelligence-LUIS
THANK YOU