Chatbot architecture is the heart of chatbot development. Based on the usability and context of business operations the architecture involved in building a chatbot changes dramatically. So, based on client requirements we need to alter different elements; but the basic communication flow remains the same. Learn how to choose the right chatbot architecture and various aspects of the Conversational Chatbot.
Choosing the Right Chatbot Architecture
Choosing the correct architecture depends on what type of domain the chatbot will have. For example, you might ask a chatbot something and the chatbot replies to that. Maybe in mid-conversation, you leave the conversation, only to pick the conversation up later. Based on the type of chatbot you choose to build, the chatbot may or may not save the conversation history. For narrow domains a pattern matching architecture would be the ideal choice. However, for chatbots that deal with multiple domains or multiple services, broader domain. In these cases, sophisticated, state-of-the-art neural network architectures, such as Long Short-Term Memory (LSTMs) and reinforcement learning agents are your best bet. Due to the varying nature of chatbot usage, the architecture will change upon the unique needs of the chatbot.
Understanding The Chatbot Architecture
Figure: Architecture of a Conversational Chatbot
Following are the key components of a conversational chatbot architecture:
- Question and Answer System
- Node Server / Traffic Server
- Front-end Systems
This is where the core Natural Learning Process (NLP) engine and context interpretation happens.
NLP Engine is the core component that interprets what users say at any given time and converts the language to structured inputs that system can further process. Since the chatbot is domain specific, it must support so many features. NLP engine contains advanced machine learning algorithms to identify the user’s intent and further matches them to the list of available intents the bot supports.
NLP Engine further has two components:
- Intent Classifier: Intent classifier takes user’s input identifies its meaning and relates back to one of the intents that the chatbot supports.
- Entity Extractor: Entity extractor is what extracts key information from the user’s query.
(Learn in detail about NLP engines and which NLP engine to choose)
Agent for Dialogue Management
It manages the actual context of the dialogue. For example, the user might say “He needs to order ice cream” and the bot might take the order. Then the user might say “Change it to coffee”, here the user refers to the order he has placed earlier, the bot must correctly interpret this and make changes to the order he has placed earlier before confirming with the user. Dialog management plugin enables us to do this.
Dialogue management further has following key plugins:
- Feedback Mechanism: Here the agent takes the feedback from user time to time to learn if the bot is doing fine with the conversation and the user is satisfied with the bot’s response. This reinforces the bot to learn from mistakes and corrects itself in future conversations.
- Policy Learning: Policy learning is a higher-level framework that teaches the bot to take more of happy paths during the conversation to improve overall end-user satisfaction.
- Broadly it creates the network of happy paths and routes the conversation to end-user satisfaction.
- The bot then tries to learn from the interactions and follows the interaction flow about the conversation it had with similar users in the past.
2. Question and Answer System
This is the key component in answering users’ frequently asked questions. Q & A system interprets the question and responds with relevant answers from the knowledge base. It has the following components
- Manual Training: Manual training involves the domain expert creating the list of frequently asked users queries and map its answers. This helps the bot quickly identify the answers to the most important questions.
- Automated Training: Automated training involves submitting the company’s documents like policy documents and other Q&A type of documents to the bot and ask it to train itself. The engine comes up with a list of question and answers from these documents. The bot then can answer with confidence.
4. Node Server / Traffic Server
The server that handles the traffic requests from users and routes them to appropriate components. The traffic server also routes the response from internal components back to the front-end systems.
5. Front-End Systems
Front-end systems can be any client-facing platforms. They can be the actual chatbot interfaces that reside in various platforms like:
- Google Hangouts
- Skype for Business
- Microsoft Teams