1. Conversations as Platforms
Have you ever had the experience of ordering pizza using an application that remembers your favorite pizza and orders to your current location automatically? Or have you ever booked a cab just by typing in a chat window or by using voice inputs and had a cab show up at your door step? If you have seen either of those, what you have experienced is the new generation of smart applications called bots (a short form of robots). Bots provide richer and more personalized experiences in our day-to-day activities, thereby making our lives much better. If you have not experienced this firsthand, you have yet to witness the next revolution in IT after the worldwide web, mobile, and data. Bots are much smarter than mobile applications; in some cases they can be smarter than you. Bots are designed to perform human-like interactions and exhibit human-like intelligence. Chat bots are not new; we have had platforms that help build chat-based applications for quite a few years (like Skype SDK), but what makes the new generation of bots special is their integration with artificial intelligence.
Over the years, smart devices and smart phones have become such an integral part of our life that they now hold lots of useful personalized information, like your favorite color, calendar, contacts, favorite restaurants, and so on. New-generation bots are designed to use the data and context surrounding the data with machine-learning (ML) and deep-learning technologies to give you a richer experience. A few decades ago, using ML or deep-learning technologies in a commercial application was highly complicated because they involve lots of new learnings and come with heavy computing and memory requirements. With the advent of cloud and serverless computing, the use of machine learning, data analytics, and advanced algorithms like facial recognition, voice recognition, and search is just a click away. The focus of this chapter will be on introducing the benefits of building conversations as a platform for all kinds of business needs; the Microsoft Bot framework, one of the top-class, end-to-end suites for building smarter, richer bots; and the various bot intelligence services and platforms available.
The following topics will be discussed in this chapter:
Types of user interfaces
Drawbacks of conventional user interface
Conversations as platform
Introduction to Microsoft Bot framework
Meet a few bots
Azure Bot Service
Direct Line
IOT and bot scenarios
Other bot frameworks
Bot abuse
Types of User Interfaces
User interfaces represent the face of any application. They should describe what the application can do and should be easy to use. It can be as simple as a command line where the customer interacts via commands or much more sophisticated, like a mobile application that can accept voice inputs from the user. Historically, user interfaces were more command-line or custom-input devices with a pre-defined set of commands printed on them; they could only perform a limited set of operations, like the interface shown in Figure . These types of interfaces had a limited set of responses and were not designed with the intelligence to respond to an unexpected random request. Some of them do not even retain any context of the users previous conversations, which could be used to improve conversations with the returning user.
Figure 1-1.
WarGames: David Lightman talking with Joshua
The most common user interface that we see today is called a graphical user interface (GUI), which was popularized by Xerox, Apple, and Microsoft during the 1980s.
Figure shows the first GUI with a bitmapped screen. It was developed by Xerox in the year 1973 and was called Xerox PARC. In 1981, Xerox introduced Star and Workstation, which adapted Xerox PARC and influenced future innovations.
Figure 1-2.
Xerox Star user interface
GUIs have evolved over the past few decades and are more sophisticated and easy to develop today. Modern applications are based on GUI, which are designed for desktop operating systems, web browsers, mobile, or kiosks. This, so far, is the easiest and most user-friendly form of interface, where the user interacts via button clicks (or touch) on a clickable element and uses an alpha-numeric keyboard , which can be used to input text, numbers, or symbols. Users are accustomed to these types of user interfaces, but havent they become monotonous? Why would you want to ask the user to enter personal information like address, phone number, or favorite color every time; why would you need a call-center operator to answer the same questions from different customers? Why would you want to ask the user to install a mobile application or log in to your web application to perform a daily task like booking a cab, ordering your favorite food etc? Bots help you bring in a customized experience with natural language recognition and artificial intelligencelike voice-, image-, or video-based communicationto an application you are already using.
Drawbacks of Conventional UI
There was a reason we moved away from command-based interfaces to GUI, but what made us shift back to the old way? GUIs have their own shortcomings, and it is a challenge to build an effective user interface, be it for mobile or desktop. Not every GUI-based application makes optimum use of the screen space. For example, the GUIs in Figure try to show all the available features or options on one screen, and for a first time user this can be overwhelming. It takes a while to figure out where to click and how to get the work done. These types of user interfaces force the business to include a readme document or 24/7 customer service, which can help users with queries about the portals usage.
Figure 1-3.
Example of suboptimal screen design in a web and mobile application
Mobile applications are constrained by screen space. The small screen size poses a challenge to building an effective application that is self-explanatory and covers all the operational aspects of the business. This restriction forces the stakeholders to design the application with only a few features on mobile and in parallel run a web version with a full feature set. It is also difficult to go through 20 clicks and a form-filling process on mobile for a few kinds of businesses. Web-based GUIs also have their limitations. Normally, the team involved in building these applications is huge and involves a UX designer, who works on the HTML + CSS, a development team, which builds the application logic, and database teams, which design the database schema. Bots, on the other hand, gel into existing chat interfaces like Skype, Slack, or Facebook chat, thus reducing the effort put into the application UI design so that the team can focus on building the application logic. For desktop applications, there is the additional challenge of the underlying software; this could be Java runtime, .NET, or node.js, which needs to be installed on the users machine for the application to run. Desktop applications always target a specific operating system and version of runtime. It is highly difficult to build an application that works across a multitude of operating systems. Also, in a typical GUI application, the user moves from one screen to another; sometimes this makes it difficult for the user to understand and accept the flow and structure of the application (Figure ). The infrastructure costs that are incurred when setting up the machines that run these applications or backend support systems is also huge. Chat bots do not need an enormous machine that hosts the interface; they can be designed to use existing applications to interact with business, reducing the applications running costs.