What is a bot - on the inside?

In this blog we try to give you an idea of what a bot is made of i.e. the components used in making a bot. Obviously the exact components required for a given bot will depend on the type of bot you are building, but this will give you some idea of the components available.

Connectors

Every bot must be capable of connecting to and interacting with one or more messaging platforms, such as Facebook Messenger, Slack or web chat. The chat platforms is the user interface for the bot.

Natural Language Processing

Natural language processing (NLP) engines are able to the identify the intentions behind phrases in natural language. For example the following phrases all have the same intent, which is BOOK_FLIGHT:

I want to book a flight
I want to go from Dubai to Moscow
I need a flight

Bots that need to be able to understand text or speech in natural language need to access NLP engines to do so.

To fully engage in a conversation, a bot also needs a dialog manager (which keeps track of the information state of the bot and generates responses or actions in response to intents and the information state) and a natural language generator (which takes parameterized responses and converts them into understandable natural language phrases).

It’s worth noting that AI driven bots are very far away from being able to participate in conversations in a human-like way.

User and Usage Analytics

Analytics is needed to monitor and measure the bots’ performance. They provide metrics on the bot such as the number of users and the type of engagement. It’s obviously critical for bot developers to gather these types of metrics on the bot to understand if engagement with the bot and the interactions with different conversational or graphical features is as expected.

Conversational Logic

The conversation flow are the rules that govern the action the bot takes in response to different inputs. The actions could be a text response, a multimedia response or a graphical widget response where the user is presented with graphical options to choose from.

These rules are usually built by a developer and determine the behaviour of the the bot. The rules can be scripted, i.e. the user has to choose from limited options at each step of the conversation, or open, in which case the user can say anything (normally within a narrow context like customer service for a company, or purchasing a product on Alexa) and the bot determines what to do from the intent (as determined by the NLP engine).

Content Management

The content such as text in the user’s language and media files needs to be managed independently from the conversation flow. The language, the media files and implementation may change depending on who the user is, the context, and the messaging platform that the message is being shown on.

Content like code needs to be professionally maintained and source controlled which is why Botpress created UMM.

Marketing and Campaigns Management

Even if they are not used specifically for marketing purposes, many chatbots need marketing and campaign like features. This can include the ability to tag users according to segmentations and then use the segmentations to determine the messages that they get sent. This can also include the ability to do A/B testing. And this is in addition to the opportunities to do native and affiliate marketing for chatbots.

Subscriptions, Broadcasts and Newsfeeds

Chatbots need the ability to manage subscriptions, broadcasts and newsfeeds. Most chatbots will have some information that they provide their subscribers with on a regular basis and managing these subscriptions is therefore necessary. Apart from sending automated messages to subscribers they also may need to offer the ability for human agents to send messages to subscribers manually.

Human in the Loop

Human in the loop is the ability of the human to take control of the bot. There are many reasons why a human might want to manually take over the bot conversation, the most common being that the bot did not understand what the end user said.

Role based security

Security is a concern for any software creator. A chatbot creator not only needs to ensure that the messages to and from the users are suitability encrypted and private, but they also have to ensure that the roles of the internal staff assigned to manage and monitor the chatbot are suitably permissioned.

Architecture

While architecture is not a component, like any software, every chatbot has an architecture. If the software architecture is not of a high standard the chatbot will not be extensible and easily maintainable.

Although Botpress is essentially middleware that connects all the chatbot components to each other, it provides a best practice architecture that makes the chatbot easy to maintain and highly extensible.

Botpress also offers components out of the box for all the major categories above. It allows and encourages developers to use third party components or services available in the ecosystem alongside or instead of its own components.

The above hopefully gives you a basic idea of the components that a chatbot is composed of and how to program bots for your own personal or business needs. It is important to note that individual bots are customized by developers coding their own modules that they add to the chatbot and by developers customizing the off the shelf modules by editing the source code.