Chatbot Architecture: A Guide to Understanding The Structure of Chatbots

Contents:

– What exactly is a chatbot?
– How do chatbots work?
– What is chatbot architecture?
– What architecture is needed for the most basic chatbot?
– Enterprise-level architecture
– How the architecture of a chatbot works
Other Considerations for Enterprise-Level Architecture
Why it’s important to get to grips with chatbot architecture

Increasingly, we’re shifting away from voice calls in favor of text and graphics. 

Communicating through a chatbot is gaining in popularity for two main reasons. It’s simple and instantaneous. 

Here we’ll examine how chatbots work, how to make a bot and everything you need to know to understand the structure of chatbot architecture. 

But before we dive in, let’s get down to the basics.

What exactly is a chatbot?

A chatbot is a software program that simulates a conversation between a human and a computer. When asked a question, a chatbot responds using a knowledge database. 

Artificial intelligence (AI) software is used to simulate a conversation or a chat in natural language. This is carried out through a messaging platform on a website, a mobile app or through the telephone. 

Chatbots enable communication between a human and a machine. They are designed to work independently from human assistance and respond to questions using natural language processing (NLP). This is a branch of artificial intelligence that provides computers with the ability to understand text and spoken words in much the same way that a human being can.

Chatbots come in different shapes and forms. 

Image Source

How do chatbots work?

Chatbots make it easy for a user to find answers to questions and requests through text, audio, or both – without the need for human intervention.

Bots are an automated solution that allows your business to handle multiple customer queries at the same time. According to the statistics, business absolutely needs to be available 24/7

Chatbots have quickly integrated more rules and natural language processing and the latest types are able to learn as they’re steadily exposed to more human language.

Today’s AI chatbots use advanced AI tools to establish what the user is trying to achieve.

There are mainly two categories of chatbots, as listed below.

Rule-based chatbots

These bots can only understand a limited number of choices they have been programmed with. They offer the following benefits: 

  • They are simpler to build because they work on a true-false algorithm to understand a customer’s query and come up with a relevant answer.
  • They are easier to implement since they don’t need extensive training.
  • It’s easier to control the answers they output, as they are set up by the brand/company.

However, they have serious downsides:

  • They rely on predefined rules and can’t understand meaning
  • They work based on buttons. This means the chatbot shows a series of options the user needs to choose from, which makes it really difficult to really know the true intent of the user, as it might not be represented on the options.

AI-based chatbots

These chatbots are sophisticated because they are equipped with artificial intelligence (AI). Using Natural Language Processing (NLP) and semantics, they respond to open-ended queries. AI chatbots can identify language, context, and intent and respond accordingly. They are a far more complex type of chatbot.

Within this realm, we find two different approaches:

Probabilistic chatbots

This type of bot uses end-to-end machine learning to create models based on historical conversation logs, rather than via intent detection and looking up a relevant response in a knowledge base. Despite the fact that they don’t stick to a fixed script and they can be quite natural to interact with, they have several downsides:

  • As they learn from experience and data from conversations, a lot of biases can be introduced. There is limited control over the output conversations, and the brands can be liable in case of inappropriate behavior of the bot.
  • A lot of training data is needed to implement and launch a probabilistic chatbot, as the more data it gets, the better it tends to perform, which makes implementations long and painful.
  • The decisions made by the chatbot happen in what is known as a ‘black box’ which means there is no transparency whatsoever regarding how the chatbot came to a decision, and it’s hard to modify or tweak its behavior.   

Deterministic chatbots

This type of chatbot uses a different kind of AI, and leverages Natural Language Processing to calculate the weight of every word, to analyze the context and the meaning behind them in order to output a result or answer. 

These chatbots are able to match the intents to an answer based on meaning.

They have their benefits and downsides:

  • They only output content populated by the brand, which makes it easier to control the tone of voice and the brand image of the company.
  • They don’t learn based on probability but can give hints on new hot topics to be included.
  • They follow a deterministic decision tree to guide customers to the desired outcome. This tree can be very complex but is overseen and controlled by the company, and not open to wild, unwanted answers. 
  • Whenever there isn’t a relevant piece of content in the knowledge base to respond to the user, they will ask them to reformulate or they will escalate the case to a live agent, creating a smooth transition and reducing friction. 

If you’re thinking of introducing your own chatbot, it’s essential to understand chatbot architecture to see how everything fits together. You’ll also of course need to become very familiar with testing automation.

What is chatbot architecture?

To understand the structure of chatbots, we need to look at the architecture used to build them. The type of architecture you’ll need for your chatbot depends on what you need it for. 

Whichever chatbot you use, the communication flow is basically the same.

Programmers use Java, Python, PHP, and other software to create a bot that responds to queries. Most conversations start with a greeting or a question before the user is guided through a series of options to the point where they receive their answer.

Basic chatbot architecture is detailed below.

Natural language understanding engine

This is the first step of the process. A user types in a message and the NLU reads this to understand the user’s intent. The rules engine then kicks in to figure out the best response.

You’ll need to spend some time thinking about your narrative and in particular the qa testing strategy.

Knowledge base

This is a library of information about a product, service, topic, or whatever else your business requires. It can include FAQs, troubleshooting guides, information about canceling a service, or how to request a replacement. 

The knowledge and database both feed the chatbot with the information it requires to give a suitable response to the user.

Image Source

Data storage 

This is where the analytics and conversation logs are stored. As your chatbot gains experience, you will want to develop more specific and advanced analytics for actionable insights. 

At every stage, it is essential to systemize your business to establish the purpose of the chatbot. 

What architecture is needed for the most basic chatbot?

Small businesses and marketing campaigns generally start off with a level one chatbot. These can typically be built on just one platform. They are great at handling simple questions that makeup 70 – 80% of common questions. These sorts of chatbots answer simple questions such as “What time do you open?”

When the user requires more sophisticated information, such as a diagnosis of a problem, the chatbot will need to scale up. 

If someone asks for example: “What is wrong with my bicycle brakes?”

This would require a higher level of chatbot.

Things start to get a lot more complicated as the capability of the chatbot starts to take off, which is why it pays to plan carefully – especially with wireframing

HTTP and chat interfaces

Level 2 chatbots are semi-scripted and feature a live chat widget. This is where you can talk directly to a customer support team from the front page. 

Message broker

This is where the publisher, such as the chat interface, adds a message to the queue. Customers access the chatbot through messaging platforms such as Messenger, Slack, Whatsapp, and Livechat.

Live agent platform

If a bot fails to identify a user’s intent correctly, the human agent is able to seamlessly step in. In some cases, they will solve the problem and hand the end of the conversation back to the bot.

The bot can also recall customers’ details from the Customer Relationship Management (CRM), for example, to change a password or to look up an order.

Image Source

Enterprise-level architecture

If you want to take your chatbot game to the next level, you’ll need to use techniques to enable complex conversation. You’ll also need to establish how to scale up your software capability.  

Of course, every business is different. Here we’ve brought together some of the common technology, workflows, and patterns required to build a bot with enterprise-level architecture.

There are many design considerations beyond the core functionality. It is essential to build a program of software testing planning into whatever chatbot you choose.

A conversational bot can be divided into the ‘brain’ and a set of surrounding requirements or “the body”.

How the architecture of a chatbot works

Chatbots work by using three classification methods:

  • Pattern matching
  • Algorithms
  • Artificial Neural Networks

Pattern matchers

Bots use pattern matching to analyze the text and produce a suitable response. The standard structure of these patterns is Artificial Intelligence Markup Language (AIML)

For example:

<pattern> Who is Joe Biden? <pattern>

<template> Joe Biden is the President of the United States <template> 

Chatbot knows the answer because his or her name is part of an associated pattern. But for more advanced information, which is beyond the related pattern, the chatbot will need to use algorithms. 

Algorithms

Algorithms reduce the number of classifiers and create a more manageable structure. In the following example, each class is assigned a score.

Input: “Hello, good morning.”

Term: “Hello” (no matches)

Term: “Good” (class: Greetings)

Term: “morning” (class: Greetings)

Classification: Greetings (score=2) 

With the help of an equation, word matches are found for the given sentence and this identifies the class with the highest match.

NLP engine

 This engine calculates the output from the input using weighted connections. Each step used in the training data amends the weights to bring up higher accuracy. Sentences are broken down into individual words and then each word is used as input to match the contents of the database for the network. These words are then continuously tested.

Image Source

Other Considerations for Enterprise-Level Architecture

In addition, chatbot architecture also has to take into consideration the following elements.

Security 

Security, governance, and data protection should be given high priority. This is especially crucial for businesses that store the confidential details of millions of customers.

You should consider how the user can stay anonymous if they don’t wish their personal details to be revealed. If they want to access personal information, they should be able to do this in a secure way.

It is also essential to build safeguards so that no one can hack sensitive systems without authority.

Quality

This is where testing really has to be thorough. Any small mistake, such as a typo or a broken hyperlink is likely to be seen by thousands of users a month. 

A tiny error can have a huge impact on the reputation of your business.

Why it’s important to get to grips with chatbot architecture 

Chatbots streamline interactions between people and services and therefore, enhance the customer experience. They also offer brands an opportunity to improve the engagement process and at the same time, reduce the cost of customer service.


Kate Priestman – Head Of Marketing, Global App Testing

Kate Priestman is the Head of Marketing at Global App Testing, a trusted and leading end-to-end software application testing solution for QA challenges. Kate has over 8 years of experience in the field of marketing, helping brands achieve exceptional growth. She has extensive knowledge of brand development, lead and demand generation, and marketing strategy — driving business impact at its best. You can connect with her on LinkedIn.

Check out our similar articles