Chatbots are computer programs that are able to conduct a conversation via auditory or textual methods. Nowadays, chatbots represent a promising, transformative interface method that can enable users to get more engaged in conversations. Considering a chatbot’s ability to reduce user’s effort and error in completing tedious tasks, chatbots should be applied where this kind of technology allows users to communicate more efficiently and enjoyably.

Some researches state that using chatbots instead of survey forms has increased the conversation rates and success rates of acquiring information.

In this blog we will present a chatbot system created with the intention of engaging with users in a more compelling and conversational way. We will also discuss problems which arise when using chatbots instead of web forms.

Use case

Creating the best possible experience for people contacting SmartCat is of great importance for the SmartCat team. Our idea was to collect as much information as possible in order to be able to connect any potential client with the right expert in SmartCat or to assist people interested in SmartCat services..

With that in mind, we decided to replace our contact form with a ChatBot that is able to collect user’s information through an amusing and engaging conversation.


There are many ChatBot solutions already available nowadays. One of them iz Amazon Lex - an AWS service for building conversational interfaces for applications using voice and text. We wanted to compare this out-of-the-box solution with the one built from the ground up. There are many pros and cons to each solution, and here is why we opted for the one we built ourselves.

First, we must state that building a bot using the Amazon Lex service took almost no time and, generally speaking, you don’t even need to be familiar with any programming language in order to build one. What does this mean? Amazon has already done a lot of work for you. Their bots recognize sentences you define and learn to improve on them over time. What’s the downside? Using Lex comes with a price and you’ll need to do some programming in order to prevent the bot from accessing any intent at any given time.

Even though it does take more time to create, being aware of the architecture, functionalities and how to improve them is the advantage of creating your own ChatBot. This is the approach we decided to go with, and it is described in my next section.


Architecture was designed with scalability and interoperability in mind.

ChatBot was implemented as a state machine and therefore it is a number of states that leads the user from the initial state to the final state. States can be easily rearranged, added, removed or modified to suit your needs. The task of each state is to handle the user’s message and to provide feedback. For instance, NAME_STATE handles the user’s message by extracting and storing the user’s name from the message. It is possible for the user to access arbitrary states at any point by requesting information change.

We used a number of algorithms for natural language processing in order to extract useful information from the user’s messages. For the purpose of extracting the user’s name we used the Stanford Named Entity Recognition library and extracted named entities that have the type PERSON. Extracting the user’s location was done similarly by extracting named entities using the Natural Language Toolkit library and then using those entities as an input to the Geopy library for location extraction. With this kind of information, we were able to find the office that is closest to the user. Extracting the user’s email address and phone number was done by matching words to regular expression patterns. The most challenging task focused on finding team members that are able to assist the user. It involved defining keywords for each team member, extracting more information on these keywords by using Wikipedia articles and adding weights to keywords. The last resource for our keyword collection were our blogs. For the purpose of extracting keywords we used the Neural Network. Comparing all collected keywords to keywords extracted from the user’s messages enabled us to detect team members of interest and offer the user the choice of contacting one of them. Each algorithm implies stopwords, punctuation and digits detection and removal.

All conversations are saved as JSON files for future use – improving algorithms or training neural networks.

As for the bot’s questions and feedbacks, we made it pick from a number of predefined ones which added the ‘human component’ to its conversational abilities.


Using the ChatBot instead of filling up a contact form was definitely more fun and engaging for users. However, there are problems that arise when using ChatBots– rare occasions when a bot is not able to extract important information. Having the ability to chat with a bot instead of entering information directly has provided users the opportunity to behave more freely, and opened the door to silly answers and sentence structures that the bot was not able to parse. There is a solution for this – extracting important information such as a user’s email/phone number and message will never fail and there is a default contact person in case the user’s request cannot be matched to anyone in the company.

By using a chatbot in the first stages of conversations, we are able to collect information and forward users’ requests to one of our team members for further help. This way, we are able to assist customers much faster.

Our vision is to move the point of requesting human assistance even further. We work on solutions that would enable our ChatBot to give fast and personalized support to customers and recognize the point when a customer decides to talk to a representative.

We strongly believe that having this fun way of communication would encourage more people to get involved by requesting information or requiring solutions from the SmartCat team.