Chat systems are ubiquitous in social networks, and are increasingly in the enterprise. Slack, Hipchat, Yammer, Salesforce, and others, are rapidly adding the kind of channel based group-chat that has been familiar to IRC users for years, and it is increasingly replacing email. Bots offer a completely new way of making content and services available to users of these tools. Would an ‘FT Bot’ be useful to our readers?
Working with Evan Smith in our B2B team, on a timeboxed, 4 week project, we used Github’s excellent Hubot as a base to build a generic chat engine that we could connect to multiple different chat networks. The success of the concept depends on the ability for a single ‘brain’ to be able to bridge itself into whatever chat technology the end user is connected to.
The project quickly split into several distinct areas: integration between the bot and various networks; adding ‘skills’ to the bot so that it can do useful things; and finally, one of the most important research areas that we discovered along the way, considering generic interaction patterns that improve the user experience of talking to the bot.
We attempted integration with Yammer, Salesforce, Skype, Google Talk, Slack and, at the last moment, Web client (via socket.io). Slack was a doddle, Google talk was also relatively straightforward, Web client likewise, but support for the others was patchy, awkward to integrate, or broken in the various existing hubot adapters, and we didn’t have enough time to fix them.
We brainstormed possible skills, and rated them based on ease of implementation vs how excited Evan and his customers were about using them. We ended up with:
- Near real time equity price lookup (eg.
- Article search (eg.
- Topic exploration (eg.
- Financial dictionary (eg.
- Aggregated analyst buy/sell recommendations (eg.
- A snapshot of the current news zeitgeist (
Hubot is excellent for services that require a simple response to a well formed request. We didn’t have any grand ambitions to reinvent Siri, but we did try to improve on Hubot’s basic interaction model.
Hear in group chat, respond on DM
For example, people who have never used the bot before need some hints to get them started, what’s often called onboarding. We implemented this so that if you address the bot for the first time and say something we don’t recognise in a group chat, we’ll sent you a DM to welcome you and give you some hints. That way, you hit the ground running (and avoid looking like an idiot in the group channel too!):
Remember the context
There are also times that you want to do things using items of data you’ve already interacted with the bot about. Storing conversation state and enabling complex multi-step interactions is particularly hard, but it turns out you can get most of the benefit with minimal effort. Enter context lists (analogous to bash history). Every time the bot discovers an item of data for you, it assigns it a shortcode and adds it to a history, so you can easily reuse it with other commands and services that can accept that kind of data:
We also knew that our readers would often challenge the bot with things it couldn’t do, and although we are logging those interactions to help improve the bot in future, we thought it would be nice if we could avoid failing that first time. What if, when the automated engine wasn’t good enough, the bot could suddenly become human? We built a feature we call operator interjection to do this. When the user types a message we can’t recognise, a human operator is offered 10 seconds to intervene. If they begin typing a response the bot indicates that to the user so they know to wait for the delayed response:
Live demo Try it for yourself using the web client version of the bot, powered by socket.io (or if you like, add email@example.com to your Google hangouts chat list):
Evan worked with some of our business customers, mostly people who talked to the bot over Google Talk, to assess how it was received as we were going along. There were some interesting findings:
- Usability is a very big deal (yes, this is not news. Chat interactions are a standard part of a techies’ working day, but to most ‘normal’ people it is not)
- Help, to be helpful, needs to be very concise
- Users get very impatient with irrelevance, e.g. in search results
- The ability to share articles was requested repeatedly
Initially users were confused by the bot but the team simplified the design and now new users understand what it can do for them after 1 or 2 interactions.
This project is not open source so the following links will work only for FT staff