We’ve done a little recoding. Introducing IBM Developer. The next level of coding, content, and community.Learn more
Finding patterns in data to derive information.
By Michael Yuan | Last updated September 19, 2018
Artificial IntelligenceSpeech and Empathy
Watson Conversation is now Watson Assistant. Although some illustrations in this tutorial may show the service as Watson Conversation, the steps and processes will still work.
The very first chatbot, ELIZA, was developed 50 years ago at the Massachusetts Institute of Technology. It simulated a Rogerian psychotherapist, someone who just repeats the human user’s words back to the human; it is not very good. In the following decades, chatbots were mostly of academic interest. But in recent years, smartphone-based chatbots have gained wide interest from the industry with high profile products such as the Apple Siri, Amazon Echo, and China’s WeChat.
IBM Cloud allows you to combine high-performance infrastructure with a broad range of Watson™ and machine learning APIs, including Watson Assistant. Get started today.
In 2016, chatbots are one of the hottest trends in technology. IBM has Watson Assistant to help you quickly create a chatbot. Messaging platforms, such as Facebook Messenger and Skype, announced developer programs to support chatbot applications. At the same time, smaller messaging platforms, such as Slack and Telegram, launched “bot stores” and investment funds to attract developers. Google is betting directly on a chatbot application (Allo) powered by its artificial intelligence (AI) and big data. As a developer, right now is the best time to jump in and surf the big wave of the “next big thing” in technology.
The rise of chatbots is the direct result of changing user behavior in the post-app mobile world and the maturing of key enabling technologies.
In short, chatbots are used in human users’ preferred environments (messaging apps), converse with users in natural language, understand what users want, and do the humans’ bidding through a large network of connected services.
Now let’s look at some messaging platforms where you can build bots.
Facebook Messenger is one of the most popular messaging platforms with more than 1 billion monthly active users. Within a few months of Facebook opening its bot platform to developers, over 23,000 developers were building bots. They have launched over 18,000 bots so far. Facebook Messenger bots are closely associated with Facebook pages, which is quite ubiquitous among businesses.
Kik is a popular messaging application with over 200 million monthly active users. A key feature of Kik is its anonymity, which is also controversial given the large number of teenagers on the platform. Kik launched a bot store to promote bots on its platform in April 2016.
Telegram is a relatively new messaging application. It was launched in 2013 and now has 100 million monthly active users. A key differentiator of Telegram is its advanced security and encryption features. Telegram has supported bots since June 2015. Similar to Facebook Messenger, its bots display rich UI elements such as buttons and formatted cards.
Skype is a messaging platform with over 300 million monthly active users. Besides text messaging, Skype’s traditional focus is on voice and video calls.
Twitter is a public messaging platform with approximately 300 million monthly active users. Bots have always been a part of Twitter as “non-human” users. By using the Twitter API, a bot can follow people and send out Tweets.
WeChat is the dominant mobile messaging platform in China and has over 700 million monthly active users. WeChat is a pioneer in chatbots, with a wildly successful bot platform. In China, businesses often have a WeChat bot long before they set up a website.
SMS and email are traditional messaging platforms with the greatest user reach. That said, the number of messages that are sent by using mobile apps such as Facebook Messenger has far exceeded SMS in recent years. You can use telecom APIs such as Twilio to build SMS bots, and email bots can be built on the open email protocols of the Internet or by using specialty API providers such as lonelybots. The email platform already has useful chatbots, for example, the smart scheduling assistant x.ai bot.
Slack is a group messaging platform for work-related teams. As of February 2016, it had 2.3 million monthly active users, and it’s growing fast. Slack is one the pioneers in the current wave of chatbot renaissance. Slack provides one of the first “bot stores” in the industry so that teams can discover and install bots easily. As expected, most Slack bots are work- and productivity-related.
Beyond mobile messaging applications, numerous messaging service providers also exist. Mobile apps integrate their services to provide in-app messaging capabilities that app users can use to message each other. Because those messaging services are API-driven, it is possible to develop bots to interact directly with those APIs and chat with application users. Examples of such in-app messaging libraries and SDKs include EaseMob, Layer, Tiger Connect, and others.
As a chatbot developer, it can feel overwhelming to develop and target so many messaging SDKs at the same time. Bot frameworks are software frameworks that abstract away much of the manual work that is involved in building chatbots. Many such offerings are on the market.
However, although many bot frameworks boast “write once deploy anywhere,” you are more likely to create a separate chatbot for each of your target messaging platforms. This is because one-size-fits-all solutions must conform to the lowest common denominator of all the bot platforms they support. That often creates a less optimal user experience, especially in the early days of the ecosystem when the native bot platforms themselves are fast evolving and constantly adding new features.
Furthermore, framework solutions are not great for beginners to learn about chatbot development. They try to automate too much and obscure the underlying mechanism for starters. They constrain you to the UI features they support, but their innovation is at least one step behind the native messaging platforms. Finally, the existing frameworks are mostly based on Node.js, while a vast majority of server-side developers are in more mature programming environments such as Java™ programming and PHP.
For effective learning, I propose an “open source lightweight framework” approach. It establishes a simple request- and response-based programming convention for all bots. The goal is to have “similar” code for each bot platform, not identical code to run everywhere. This way, you have the flexibility to add features specific to each bot platform, while the framework still abstracts away common boilerplate code such as security, logging, analytics, caching, and API integration. You can download and learn about my own lightweight framework in both the Java language and PHP from GitHub.
As discussed earlier in this article, advancement of natural language AI services is a key enabling factor of chatbots. AI enables modern chatbots to escape the trap of a “telephone tree,” and become partners of human users. Four important types of AI services are related to natural language.
Note: The IBM Watson Developer Cloud has a comprehensive collection of ready-to-use AI and NLP services for chatbot development and many other applications. For instance, Watson Assistant combines NLP intent classification, entity detection, and scripted conversation management.
This article explained chatbot development platforms, developer frameworks, and AI services. To get started with chatbot development, I recommend starting with a popular messaging platform, and then download the lightweight framework source code from GitHub to play with it yourself.
If you want to go further and learn how to extend a chatbot to return weather information by using expanded entities from Watson Natural Language Understanding, see Build your chatbot with Watson Assistant.
August 28, 2018
October 13, 2018
May 2, 2018
Back to top