Building a SMS chatbot the easy way with Bandwidth and Google Dialogflow or Amazon Lex
Simply put, a chatbot is a computer program designed to simulate conversation with human users. Think Google Assistant, Amazon’s Alexa, and Apple’s Siri. But, it doesn’t stop there, as the underlying algorithms powering those technologies are becoming more and more commonplace in our society. Van Baker, research vice president at Gartner, stated that, “By 2020, over 50% of medium to large enterprises will have deployed product chatbots.”
How does a Chatbot work?
Within the Artificial Intelligence umbrella, there is a field of study known as Natural Language Processing (NLP). NLP is a wide ranging field focused on helping computers understand, interpret and manipulate human language. Within that field lies Natural Language Understanding (NLU), which is the backbone of chatbots. As you may have guessed, NLU is solely focused on understanding and interpreting natural language.
Today, you can find several services that provide an API for real time communication with their NLU algorithm. Google’s Dialogflow and Amazon’s Lex are two examples.
The way most of these services work is that there is an initial training aspect, where you provide examples of phrases that may correspond to the same intent. You would also point out which pieces of the phrase are parameters that would be needed to answer the question. An example would be asking for the weather for a time and location. Once trained, the phrase, “What’s the weather like in Raleigh June 20th?” would return that the topic of the phrase is weather, and that the location is Raleigh and date is June 20th. With a now structured data set, you could answer this question if you had access to future weather data.
What can a Chatbot do for your messaging strategy?
The goal of a chatbot, and really anything using Artificial Intelligence, should be to automate the simple and mundane, freeing up your employees to focus on higher priority tasks. You could use a chatbot to answer something simple and general to your business like “What are your business hours?” or to provide a personal answer to something like “When will my package be delivered?”. Another equally major aspect chatbots bring to the table is speed. In an age where time to response is critical, chatbots can deliver instant responses at any time of the day.
How can you create a Chatbot using Bandwidth?
The key to turning your messaging application into a chatbot comes from the combination of Bandwidth’s Messaging API and the NLU API of your choice. When an incoming message is received by a Bandwidth number, a notification will be sent your application via a callback or webhook. Your application can then take the text from the body of that message and communicate with the NLU API of your choice to have a response created. From there, your application would take that response and send it in a message back to your customer. It’s as easy as that!
If you’d like to take a look under the hood at what this would look like using Bandwidth’s Ruby SDK and Google’s Dialogflow or Amazon’s Lex, head here.