Giving a watermelon a mind... In an attempt to make Pip sentient, we've been exploring chatbots in this weeks innovation project. Read on to find out about the process of building a chatbot using Botkit and Wit.ai.
Siri, Alexa, Ultron…
Okay so maybe that last one was a little extreme, but you have to admit it would be a whole lot more interesting than talking about bots and coding.
We’ve been thinking about this a lot (not building a super-evil AI), wouldn’t it be handy to have a system in place that the team could go to for their questions and queries, such as booking a meeting room, understanding an acronym, or adding things to the office shopping list.
There are so many ways an AI could benefit the team (besides being great fun to build), but in typical CUBE fashion, we don’t just want to create an internal search engine. We want a conversational member of the team who can reciprocate what it means to be a CUBE, and everything this entails.
You probably haven’t met Pip, but you may have seen one of her appearances on Twitter or Instagram, we don’t like to think of her as a mascot (she gets offended). More like a member of the team, so it makes sense that when discussing the potential of a CUBE AI, her name would pop-up.
Essentially Pip represents CUBE culture and the personality of our brand, so why wouldn’t we want to give her a mind of her own that goes beyond understanding sentences and delivering information?
I spent a week of my time making a sentient watermelon slack chatbot for internal communication. Making a chatbot can be complex and the world of AI means that a lot is possible. To help me I worked out all the features of a chatbot that I would like. Why? Find out below.
We’ve had a bunch of new starters over the past few months, and something that keeps coming up are questions regarding the terminology and acronyms that people are unfamiliar with.
A new member joining the CUBE team might want to know something and feel uncomfortable asking; ‘Should I already know what this means?’ Instead of constantly having to ask someone, they could just ask Pip. But this isn’t the only problem we think Pip can solve:
Feedback Friday – a form submitted by each member of our team talking about everything good and bad that’s happened during our week, and things we would like to see happen in the future.
Or more importantly, how would Pip think?
To meet our needs Pip will need the ability to search databases based on topics and tags as well as understand the intent of questions in order to take relevant actions; Pip needs to follow a process to deliver information:
But we don’t just want another chatbot, we want Pip to be bursting with personality by communicating in our tone of voice and recognising rudeness. Using sentiment analysis so that responses could differ depending on how rude you are, even leading to Pip refusing to answer questions if you’re consistently impolite.
Pip needs (metaphorical) ears to listen…
Botkit can be just that; listening and maintaining all the conversations that Pip is having.
Botkit sells itself as a framework for handling the conversation between the end user and the developer. It helps the developer maintain conversations and act on what the user is asking.
We could talk for hours about why this bit of kit so fantastic, go check out their Github for some awesome starter projects.
Wit.ai is a Natural Language Processor (NLP) that creates understanding by taking what we say as humans and translating it into an intent that machines can digest more easily.
Here’s a handy diagram from Wit explaining how it works:
The best thing about Wit is its ease of training, you can feed in sentences that a user might say into Wit’s handy online tool and select the intent it’s supposed to match up to.
This eventually trains your app to detect things you haven’t even told it about.
Here we’ve asked, “Who are the American Red Cross?” – Wit has been trained to realise we want to know who someone is (the intent) and what the thing is (American Red Cross).
We look at Wit as being the brains of the operation. It takes what Botkit has listened to and makes sense of it so that the correct actions/responses can be taken.
The CUBE search engine.
The glossary API can be seen as Pip’s library; Pip goes and checks for the term before feeding back with the answer.
One of the original reasons for building Pip was so we can easily ask, “Hey what does x mean?” or “Who are the xyz?”.
It could even be a member of the team asking what a technical term means because a client has mentioned it and they need to quickly look it up.
To store and access the cumulative acronym, client and term knowledge of every member of the team, we needed to collect this information and then store it somewhere; this is where the API comes in. We quizzed all the CUBE team for their favourite terms, clients and acronyms before throwing them all into a big old spreadsheet.
The API uses a tasty cocktail of node.js, express and elastic search. This allows an application to request client, term and acronym information.
Separating this from Pip was a good choice, it means that in the future we can integrate this API with other services we may wish to write… *cough* Alexa *cough*.
So, we’ve mentioned all these different parts of Pip, but how does it all come together to form the best watermelon ever?
The following diagram should help!
You can see how Pip uses Botkit to handle conversations, Wit.ai to figure out the intent of what a message is saying, and a glossary API to retrieve the relevant content.
Another sweet feature we’re including solves a long time problem at CUBE – quickly finding out if a meeting room is free. Now we can ask Pip, ‘Hey, is the Snazzy Chair Lair free?’ and she will use Google Calendar API to see if it’s in use or not.
No longer just a mascot, Pip encompasses CUBE culture in a way which we have never experienced before, it’s not just a gimmick designed to make us smile, the AI is going to add real value to the team and the way we work internally.
We have tonnes of plans for Pip, here are a few of the other things we’re going to add in the not-to-distant future:
Published on November 8, 2017, last updated on March 15, 2023