Bots Bots Bots...

Although bots exist almost since the internet was invented, seems like recently it became something everyone is excited about. But bots are just apps, running somewhere on the internet. Just like a web service- it gets input, do some processing, and returns the result.


When I just started using the internet, when browsers didn’t exist and we used telnet to connect to a remote unix shell (yeah- I'm old), I remember the bots that played the cops keeping the order in the IRC channels. If someone flooded the channel with messages or misbehaved- the bot kicked him and blocked him from the channel.


One of the main technologies that are responsible for the hype around bots and its increased use, is the recent development of Machine Learning and Neural Networks technologies. These technologies powers new cognitive services that enable making bots much smarter, and even more "sensitive". Think of a bot that analyses a user's post or email and uses sentiment analysis services to "understand" if the user is happy, sad, angry or satisfied- just by "reading between the lines". The bot can then react and provide its response considering the user's' mood.


Another thing that might be connected to this hype- is the variety of platforms from which we can connect to the bot: Skype, Facebook Chat, Slack, email, SMS, and more. Basically you can connect your bot to any platform. The problem is that if you implement your bot independently and want users to be able to access it from different platforms, you'll have to implement each of these connections yourself.


To help overcome this problem, several Bot Frameworks were released recently, such as Microsoft Bot Framework. The main benefit of using such framework, in addition to the designated SDK and the different features, is the ability to connect your bot to different channels very easily by just going through a few simple on-boarding steps. The framework is responsible to route the messages from the various channels to your bot, and is also responsible to deliver the bot's response in the optimal way each channel supports, releasing the developer from the responsibility of handling the differences between the platforms. For example, in a web chat the bot can ask you to click a button while in a text channel it will present a list of options for you to choose from.


Bots are not the solution to all humanity problems. We should think very carefully whether the scenario that we're thinking to implement truly makes sense. We should ask ourselves whether the bot is going to provide a better experience than other alternatives.


If you decide to provide bot experience to your platform, keep the following in mind:


Add analytics to your bot- One of the most important thing to do when creating your bot, is to understand how well it performs. Recently I worked with a partner on creating his Q&A bot. In this case, it was very important to understand whether the bot provided the right answer, and whether the answer actually helped the user. Since the user types free text questions, we needed to be able to map a specific answer to various versions of the same question. We used simple search techniques to search for the question, and provided a confidence level for each answer. If the confidence level was lower than a specific threshold, we provided a disclaimer that we're not sure, asking whether the answer was helpful. The user could then provide his feedback. This way, we could improve the bot accordingly. It was easy for us to understand where the bot was performing well, and where we needed to invest more in the logics.


Create domain specific bots- Natural language understanding services help your bot understand what the user meant by extracting the user's intention from the text. But, in order to perform well, these services should be trained on a variety of examples, since each intent might be linked to a lot of different ways the user can express it. For this reason, if you use a Natural Language service to extract intents, it is very important to narrow down the number of different intents your bot supports. If you try to support too many intents, the language understanding service will return results with a relatively low confidence since the probability to do mistakes is higher.


Guide the user of what he can do at each step- It is a good practice to guide the user what the bot expects at each step, by providing examples and controls (such as buttons instead of expecting free text), so that the probability of understanding the user and being able to complete the task increases. For example, instead of asking "What would you like to buy?" you can ask "In which category are you interested today?" and provide a list to choose from. Instead of asking "Are you sure?" and expecting a yes/no response, you can provide buttons the user can just click. This way- step by step, you can guide the user what's next, and complete a successful scenario. 


Have fun with your bot!