Chatbot Development

Building Bots with Botkit

Explore what’s involved in building bots with Botkit, a Node-based chatbot development framework that makes it easy to build bots for a variety of communication channels. Part of the Microsoft Bot Framework, Botkit works with Microsoft LUIS AI or any natural language processing (NLP) engine you choose to integrate.

July 23, 2019
tools building chatbot on botkit framework

For anyone curious about the origins of the Botkit framework, look no further than Slack. Botkit first launched in 2015 for the express purpose of helping developers build sophisticated Slack chatbots.

Although Botkit remains a popular framework for developers building productivity and work-centric bots for the Slack platform, much has changed. Today, developers can—and do—use Botkit to build chatbots for multiple communication channels. And, since Botkit was acquired by Microsoft in 2018, the framework has experienced changes intended to (hopefully) improve the bot-building experience for everyone.

What is the Botkit framework?

Botkit is an open source chatbot framework powered by an active and enthusiastic community of developers. It’s also now powered by Microsoft.

Not long after the Microsoft acquisition of XOXCO, the company behind Botkit, the framework billed itself as part of the Microsoft Bot Framework. Although some changes immediately impacted Botkit following the acquisition (we look those changes here), the full effects remain to be seen.

You might compare the Microsoft Botkit acquisition with the Facebook acquisition of Wit.ai. In both cases, a tech giant purchased an open source chatbot development framework. The difference, however, lies in each framework’s capabilities. Wit.ai, like many chatbot frameworks, includes a natural language processing (NLP) component, but Botkit doesn’t. With Botkit, you have the option to integrate the NLP service of your choice.

So, if Botkit is a framework that doesn’t offer NLP, what does it offer? Flexibility, for starters. Counterintuitively, not having its own NLP is an advantage because Botkit lets you use whichever NLP engine you want. Today, it stresses the ability to integrate with the Microsoft LUIS service for NLP, but you don’t have to use LUIS.

Botkit chatbot examples

You can use Botkit to build any sort of bot for any platform. For developers who focus on Slack bots, Botkit has been a go-to development tool for quite a while. However, with several channel-specific Botkit adaptors to work with and total integration with Microsoft Bot Framework, you can build and publish your bot practically anywhere you choose. Let’s look at a few use cases for Botkit bots.

Content-sharing chatbots

The Harvard Business Review HBR bot lives on Slack, which makes sense, given that most Slack users are professionals interacting in a workplace setting. They’re exactly the audience that’s likely to read, enjoy, and share HBR content—tasks which are facilitated by the HBR bot.

Built with Botkit, the HBR bot draws from more than two hundred articles on the HBR website that discuss career issues. Specifically, the bot pulls career advice from these articles and sends that advice to users, who choose the frequency with which they’d like to receive this information.

Productivity chatbots

For human resources professionals working in an office that uses Slack, there’s the HR bot. This Botkit-built chatbot handles all core HR tasks for small businesses, including onboarding, connecting people around the office, and sending reminders and company announcements.

Gaming chatbots

As Botkit has evolved, it has become relevant for use cases beyond Slack bots. One developer even used Botkit to build a dice-rolling bot for Facebook Messenger. The bot can “roll dice,” which is just a way of saying that it generates random numbers.

This capability could be useful for gaming scenarios, for example, if you want to hold a raffle for a giveaway or a prize. The dice-rolling functionality could also be applied to a chatbot-led tabletop game.

Why use Botkit? The pros and cons

As with any chatbot framework, Botkit comes with advantages and potential stumbling blocks. Let’s take a look at some pros and cons of the Botkit framework.

Botkit pros

This is a great framework to use if you want the benefits of an open source product. There’s a large community around Botkit, and you can benefit by accessing the components that power the product and the people who are working on it.

Botkit is also easy to use if you’re eager to get up and running. Just take it from ActiveWizards, a machine learning company:

[Botkit] is designed to help busy people build bots for their needs fast and easy, without having to dig deeply into the gears that roll under the hood. It provides a unified interface for sending and receiving messages. Initially intended for Slack, it now has extended functionality to support connection to various messaging platforms. The framework has intuitive workflows organized in a clear and concise manner.

Since Botkit (as its name indicates) is a kit complete with platform-specific bot-building tools, you also get to work on bots for different platforms in isolation. This is a plus if you like having granular control over your Facebook Messenger bot, your Slack bot, and the bot you launch on your website.

For example, you can build a bot just for your website using the Botkit starter kit for websites and apps. Then you can deploy your bot to a dedicated domain name in the .BOT top-level domain, so you can control user access to your bot regardless of platform.

Another advantage is the freedom to use any NLP engine you want. Botkit offers middleware for all of the big ones, including Amazon Lex, IBM Watson Assistant, Wit.ai, and, of course, Microsoft LUIS.

Botkit cons

If you want to keep everything in a single vendor’s ecosystem, you might want to use a different platform. For example, Amazon Lex includes bot-building tools, NLP, hosting (through Amazon Web Services [AWS]), and a suite of integrations with messaging channels. The same is true for frameworks like Dialogflow and IBM Watson Assistant. You might want to handle everything through one vendor, and you can’t really do that with Botkit unless you use it only in conjunction with other Microsoft services.

Speaking of Microsoft, it appears that Botkit is gradually being absorbed into the Microsoft Bot Framework, which is a very large suite of tools. If your organization doesn’t use Microsoft enterprise technologies and doesn’t plan to, keep in mind that using Botkit might bring you into the fold of the Microsoft stack.

That’s not necessarily a bad thing, and Botkit remains an open source product that works with any NLP. Just be aware that things are changing for Botkit.

Another potential stumbling block is the lack of options for developers who don’t work in Node.js. Many chatbot frameworks offer libraries—official or unofficial—for various programming languages, allowing you to build your bot in whichever one you prefer. Not so with Botkit. It’s a Node-based framework, so that’s what developers must use.

Botkit features and integrations

Although you can use any NLP engine with Botkit, the home page for the framework now lists “Integrated NLP from LUIS.ai” as a core feature. Since Botkit is being assimilated into the Microsoft Bot Framework, it’s reasonable to assume that using LUIS may soon become the most straightforward way to bring NLP to your bot.

When it comes to fundamental features, the Botkit core library provides a platform-independent way to build bots for any communication channel. That’s in addition to several platform-specific adaptors that allow you to build bots for an individual platform. The result is that you have tons of flexibility to build the kind of bot you want—for the platform or platforms you want—using the machine learning service of your choice.

As for messaging app integrations, Botkit provides several. Just use the adaptor that communicates with the API for a given platform. The documentation offers straightforward instructions for integrating your bot with all of the following:

  • Slack
  • Cisco Webex
  • Cisco Jabber
  • Microsoft Teams
  • Facebook Messenger
  • Twilio SMS
  • Twilio IPM
  • Google Hangouts

In a section on Botkit and Microsoft Bot Framework, the Botkit documentation notes that it’s also easy to integrate your bot with Skype, Telegram, and Kik. When using Botkit within the context of Microsoft AI and bot-building tools, you can easily publish your bot to these platforms.

Botkit pricing model

Until early 2019, Botkit had free and paid versions. The paid version was Botkit Studio, which is now Botkit CMS. Unlike Botkit Studio, Botkit CMS is free for anyone to use.

However, since Botkit doesn’t actually host your bot, be sure to check pricing information for the company that hosts it. Most charge a fee when a certain amount of data is exchanged. Microsoft Azure Bot Service, for example, charges 50 cents per 1,000 messages to your bot when users communicate with it on your own website or app.

If you just want to build a simple Botkit bot to get a feel for the framework, you can always do that for free.

How machine learning works in Botkit

Since the Botkit mission is to make it easy to build great chatbots, the organization doesn’t burden developers with machine learning.

This distinguishes Botkit from a framework like Pandorabots, which takes pride in exposing developers to all of the underlying code and throwing them into the thick of things. Botkit doesn’t include machine learning or AI because that’s not what it is about. Instead, you have the option to easily integrate any NLP service you want into your bot’s core functionality.

How to get started with Botkit

Review the Botkit documentation, and follow the instructions for installing Botkit. Brief tutorials show you how to build a bot from scratch and how to enable it to “hear” messages and respond to events. Others discuss scripted dialog control (known as conversation management) in Botkit and how to extend the framework with middleware.

Another good resource is the Bot Developer Hangout, where you can chat with developers who are using the framework. Get tips from Botkit veterans, and take advantage of the community that revolves around this framework.