Bot. You said bot? let build bot then!
A developer introduction to a new world of apps
Laurent Ellerbach
laurelle@microsoft.com
Technical Evangelist Lead
Microsoft Central and Eastern Europe
https://blogs.msdn.com/laurelle
https://github.com/ellerbach
Many thanks to our sponsors & partners!
GOLD
SILVER
PARTNERS
PLATINUM
POWERED BY
What are bots?
Bots are not
Bots are not: Artificial Intelligence (AI)
• Bots can be simple task automation utilities
• Example: Password reset bot. There’s no AI here. Just
ask a couple of security validation questions, then
reset the password
• They may have AI as well, if the scenario applies
Bots are not: Natural language only
• The more your bot depends on natural language, the riskier the user
experience becomes. Typing isn’t always the best option.
• Move away from natural language as quickly as possible in the
navigation.
• “Drive” the user as much as you can (menus, choices, etc)
• Typing a lot on a mobile device: Bad experience
• Example: AzureBot “stop vm1” is a command, not natural language.
Less typing = better
Bots are not: Text interfaces only
• Bot channels are evolving quickly to support richer
experiences: Media, buttons, custom controls. These are
coming. Text is not the best experience for everything,
sometimes all you want is a button, or an image, or a
link…
• Examples:
• Skype allows audio and 3D bots as well.
• Slack, Facebook and Skype have buttons/custom UIs
So… what are bots?
Bots are apps. Really. That’s it.
Bots are apps
• They solve problems, like apps
• They are cross platform, you can run them anywhere, on
any device
• They are actually easier to build and deploy across
platforms than apps
• Very similar capabilities: Push notifications? Check.
• You can publish your bot instantly on Facebook, Skype,
Slack, Kik, email, custom hardware devices, anything.
Where to start?
• https://dev.botframework.com/
• One platform for multiple channels
• Same code, can be specific per
channel as well
• Fully REST API
Demo
Creating my first bot
• Hello world with a bot in C#
Demo
BrickBot: a real Lego bot
https://brickbat.azurewebsites.net
Architecture
How do we build great bots?
1. Start by asking what problem are we trying to solve. Refine until it
looks like a tangible problem and not “magic”
2. Ask how a bot will be a better experience. User experience is
EVERYTHING
3. Avoid too much natural language. Careful with unrealistic
expectations. Natural language recognition is limited. Menus work
great. Commands work great. Buttons, etc.
4. Collect data. Pump it to Azure. Use the same architecture you would
use with IoT scenarios (IoT hub, stream analytics, power BI, etc). You
can only analyze and improve your bot if you’re collecting metrics
for it
5. Iterate, improve
Demo
What about authentication?
• Every channel generate a unique encrypted ID per
user (for web, context lost when browser closed)
• Authentication can be done thru any method using
external webpage and calling back the bot thru web
API
– Example available on Github
• Objects are serialized so context data stored per user
A concrete example: my house
A raspberry in the garden
• RPi v2 running Linux with Mono +
Atmega328
• Posting info on a Windows Gateway
• Connected to Azure IoT Hub
The Sprinkler board v3
• Raspberry Pi 2
• Windows IoT Core
• Code ported from
.NetMF
• Not that straight forward
(web server, UWP concept)
• Offer much simpler and
modern development
• Added connection to
Azure IoT Hub
Overall architecture of the garden
433MHz
receiver
ATmega328
sensors
SQL
Azure
Azure
Event
Hub +
Stream
Analytics Web App
+
Javascript
Browser
sprinkler
Netduino running .NET Microframework
Gateway
App
IaC – Azure Resource Manager json
deployment
Recommen-
dation
workflow
Automation and
Machine Learning
APIs
The bot architecture: example with email
Raspberry PI running
Linux and node.js
Azure IoT Hub
Message
(picture)
SQL Azure
Blob storage
Web App, Bot framework
Bot providers
Natural language recognition
• Part of Azure Cognitive
services
• Natural language
recognition
• Few native languages
supported so far
• http://www.luis.ai
Integration of external services
• Magic of API
• Netatmo connected thermostat, getting temperature,
programs, changing presence mode
• Endless possibilities of integration (my next steps: wine cellar
inventory, weight…)
Demo
http://blogs.msdn.com/laurelle
http://github.com/ellerbach
http://dev.botframework.com
www.InternetofYourThings.com

Bot. You said bot? Let build bot then! - Laurent Ellerbach

  • 1.
    Bot. You saidbot? let build bot then! A developer introduction to a new world of apps Laurent Ellerbach laurelle@microsoft.com Technical Evangelist Lead Microsoft Central and Eastern Europe https://blogs.msdn.com/laurelle https://github.com/ellerbach
  • 2.
    Many thanks toour sponsors & partners! GOLD SILVER PARTNERS PLATINUM POWERED BY
  • 3.
  • 4.
  • 5.
    Bots are not:Artificial Intelligence (AI) • Bots can be simple task automation utilities • Example: Password reset bot. There’s no AI here. Just ask a couple of security validation questions, then reset the password • They may have AI as well, if the scenario applies
  • 6.
    Bots are not:Natural language only • The more your bot depends on natural language, the riskier the user experience becomes. Typing isn’t always the best option. • Move away from natural language as quickly as possible in the navigation. • “Drive” the user as much as you can (menus, choices, etc) • Typing a lot on a mobile device: Bad experience • Example: AzureBot “stop vm1” is a command, not natural language. Less typing = better
  • 7.
    Bots are not:Text interfaces only • Bot channels are evolving quickly to support richer experiences: Media, buttons, custom controls. These are coming. Text is not the best experience for everything, sometimes all you want is a button, or an image, or a link… • Examples: • Skype allows audio and 3D bots as well. • Slack, Facebook and Skype have buttons/custom UIs
  • 8.
  • 9.
    Bots are apps.Really. That’s it.
  • 10.
    Bots are apps •They solve problems, like apps • They are cross platform, you can run them anywhere, on any device • They are actually easier to build and deploy across platforms than apps • Very similar capabilities: Push notifications? Check. • You can publish your bot instantly on Facebook, Skype, Slack, Kik, email, custom hardware devices, anything.
  • 11.
    Where to start? •https://dev.botframework.com/ • One platform for multiple channels • Same code, can be specific per channel as well • Fully REST API
  • 12.
  • 13.
    Creating my firstbot • Hello world with a bot in C#
  • 14.
  • 15.
    BrickBot: a realLego bot https://brickbat.azurewebsites.net
  • 16.
  • 17.
    How do webuild great bots? 1. Start by asking what problem are we trying to solve. Refine until it looks like a tangible problem and not “magic” 2. Ask how a bot will be a better experience. User experience is EVERYTHING 3. Avoid too much natural language. Careful with unrealistic expectations. Natural language recognition is limited. Menus work great. Commands work great. Buttons, etc. 4. Collect data. Pump it to Azure. Use the same architecture you would use with IoT scenarios (IoT hub, stream analytics, power BI, etc). You can only analyze and improve your bot if you’re collecting metrics for it 5. Iterate, improve
  • 18.
  • 19.
    What about authentication? •Every channel generate a unique encrypted ID per user (for web, context lost when browser closed) • Authentication can be done thru any method using external webpage and calling back the bot thru web API – Example available on Github • Objects are serialized so context data stored per user
  • 20.
  • 21.
    A raspberry inthe garden • RPi v2 running Linux with Mono + Atmega328 • Posting info on a Windows Gateway • Connected to Azure IoT Hub
  • 22.
    The Sprinkler boardv3 • Raspberry Pi 2 • Windows IoT Core • Code ported from .NetMF • Not that straight forward (web server, UWP concept) • Offer much simpler and modern development • Added connection to Azure IoT Hub
  • 23.
    Overall architecture ofthe garden 433MHz receiver ATmega328 sensors SQL Azure Azure Event Hub + Stream Analytics Web App + Javascript Browser sprinkler Netduino running .NET Microframework Gateway App IaC – Azure Resource Manager json deployment Recommen- dation workflow Automation and Machine Learning APIs
  • 24.
    The bot architecture:example with email Raspberry PI running Linux and node.js Azure IoT Hub Message (picture) SQL Azure Blob storage Web App, Bot framework Bot providers
  • 25.
    Natural language recognition •Part of Azure Cognitive services • Natural language recognition • Few native languages supported so far • http://www.luis.ai
  • 26.
    Integration of externalservices • Magic of API • Netatmo connected thermostat, getting temperature, programs, changing presence mode • Endless possibilities of integration (my next steps: wine cellar inventory, weight…)
  • 27.
  • 28.
  • 29.