Building chatbots using botkit

Building chatbots using botkit

I have been reading about botkit at https://github.com/howdyai/botkit. It promises a great framework to quickly build your bots for multiple platforms. Built on NODE.js its developer friendly and has recently come out with botkit studio to build your bots visually.

When building a chatbot there are at least 3 layers that you need to work on

  • Clients - You will have one of more clients that you use to interact with chatbot. Common examples of clients are chat window on web site, a mobile app that supports chat, slack, facebook messenger, Skype and more
  • bot - This is the core part which listens or hears the messages coming from clients. It understand message and invoke appropriate handler to process the message and send a response back to the client. Depending on what type of client you have, the bot can receive a variety of messages and events. The bot may optionally enrich the response by talking to the third layer which is "integration"
  • Integration - The integration layer provides various level of integrations for your bot. For example, bot can use machine learning/cognitive service to understand the intent and entity in the message and build a response accordingly. The bot can enrich the response content by fetching additional data from external/internal data sources, services or enterprise apps and systems.

botkit provides multiple platforms support ("clients" in above terminology) so that you don't have to understand APIs and integration aspects for variety of clients you want to support.

In terms of message processing, botkit provides an ability to define regular expressions or events and attach corresponding functions where you can process message and build response. It also supports conversations where a multiple messages can be exchanged between bot and client as part of same conversation. However this requires that you script all your conversations and represent that via regular expressions or conversation threads in botkit.

A better approach is to use natural language understanding to understand intent and identify entities and action from the message. botkit supports this through the use of middlewares. It supports IBM Watson conversation service, Microsoft LUIS, API.AI, Recast.AI and wit.AI. As a first step you need to train these services/tools for a specific domain or skill so that it can understand the message and extract intent, entity and action from the message. Once you train and configure these middlewares in your bot, every message that arrives at the bot is first sent to these middlewares and what you get back is a structured response that contains intent, entity and other meta data provided by the middleware. botkit calls these as "plugins" and its possible to write your own plugins.

The other important aspect is to enrich your response before it gets sent out. Enriching the response means adding relevant content to response either text, media, image so that it appeals more to user and helps anwer his queries. Although this is not identified as a separate component in botkit, it is an important part of conversations. I feel this should be supported and handled in a uniform way that will help you to add new integrations easily. A few suggestions

  • Similar to middlewares, provide support for pluggable components. There would be a common set of components viz HTTP endpoints, REST endpoints, databases etc
  • A workflow manager which can orchastrate between calling appropriate integration endpoint / service for enriching the response

Your suggestions, comments and views are welcome!

To view or add a comment, sign in

More articles by Jaydeep Ayachit

Others also viewed

Explore content categories