Building a chat bot
This post is adapted from the Reinventing mobile UX with bots strategy guide, on how brands can use conversational UI to deliver more engaging mobile experiences.
Because many of the largest players in the messaging space also happen to be the largest players in the conversational UI space, there are many technologies that already exist to facilitate building chat bots that integrate with these services. With open-source platforms offering APIs that scale the bot’s conversational logic across multiple messaging services—and even into proprietary brand apps and websites—third-party developers have ample opportunity to experiment with the conversational UI model without having to develop the learning and conversation modeling algorithms for themselves.
While there is a diverse toolset of technologies at developers’ disposal, they share many of the same fundamental components and functionality. Central among these is teaching bots how to learn—helping them parse the unique vocabulary and request types for each distinct application and service. Thankfully, this is particularly what the open-source artificial intelligence platforms are focused on solving for, removing a massive obstacle for developers. All brands need to bring to the table is a handful of key reference data, and in most cases the bots can handle the rest.
Teaching bots to learn
Many of the open-source AI platforms rely on developers to submit reference data or requests to the bot that will help it extrapolate meaning from users’ messages. Here’s an example of how to teach a bot to adapt to varying user requests, in this case for a bot that gives weather forecasts.
- Reference query. First, developers need to provide a sample query that a bot should field. This could be something like, “How will the weather be in Cleveland on Wednesday?”
- Identifying intent. Next, developers should help the bot understand its purpose in this instance, which would be to retrieve a weather forecast. Bots can have several purposes, called users’ “intents” when they submit a message, and these can be identified by a number of different keywords or variables. Identifying the intent for this message helps the bot to understand what kinds of supplementary information it should look for—or ask for—and what kind of data it should ultimately respond with.
- Elaborating with entities. Entities are the variables of the user’s request, which in this instance could include things like cities (“Cleveland” might be substituted for “New York” or “Chicago”), times (“on Wednesday” could just as likely be “this evening” or “next Friday”), or even forecast types (a general request like “weather” could also be more specific values like “precipitation,” “temperature,” or “humidity”). By providing reference entities and some examples of alternatives, bots can begin to parse users’ sentences and better narrow their response options. In particular, platforms like wit.ai offer ready-made entities for common requests like locations or times of day, eliminating the need for third-party developers to volunteer that data themselves and accelerating development.
- Correcting for errors. In instances when the user doesn’t submit all of the entities necessary for the bot to appropriately field their question and address their intent, the bot needs to be able to gracefully handle those errors and ask for more information. In the example given above, if the user doesn’t mention Cleveland or any particular location, the bot might respond with “Where?” or give results for the user’s current location. If the user gives more detail, the bot can then append the request with that new entity value and provide a more accurate response.
- Testing and enhancing. Like any software, the best way to test for bugs is to start using it. Many of the bot AI platforms offer a console-like interface for chatting with the bot and seeing examples of where it responds with appropriate data or where it falls down. Over time, developers can plan for common problems and ensure that conversations progress in an organic, logical way.

Teaching users to interact with your bot during onboarding is a popular best practice in preventing embarrassing errors. For the most part, the leading conversational UI programs offer “what I can answer” sections that help users understand what they should expect of the bot and its capabilities. Giving examples of the requests your bot is equipped to field helps prevent frustrating bugs and gaps in conversation logic from derailing the user experience, but it’s important to remember that no software is perfect—especially bots. For this reason, graceful error handling is imperative for users to trust the technology. Users are more forgiving of a system that’s honest about its faults (“I’m sorry, but I’m not sure I understand. Could you try asking a different way?”) than of flippant and cheeky responses (Siri often says “That’s an interesting question” in response to queries it misunderstands).
The leading bot intelligence platforms have APIs that allow them to interface with many different technologies, including apps on both iOS and Android, within SMS conversations, on a myriad of chat platforms like Slack, Messenger, or Skype, and within websites and web applications. It bears repeating that many of these bot platforms are designed and open-sourced by the stewards of the messaging platforms themselves—Facebook acquired wit.ai, which interfaces nicely with Messenger, while Microsoft’s Bot Framework is designed to fit well into Skype. Most of these platforms are free to use and easy for developers to program, meaning that technology limitations are no longer inhibitive of adding a great conversational UI experience to a third-party app.
Technology is no longer an obstacle to developing a great conversational UI experience for your app—what matters most is finding ways that bots can offer value to users.

In fact, while these technologies have equalized the playing field for developers, the challenge remains to find a worthwhile user experience that bots can facilitate within your apps. Brands need to determine the user experience they want the conversation to deliver before deciding on any one platform or technology, because—like with native development—there are many technology solutions that are better suited for one UX goal over another. However, the right marriage of a conversational UI experience coupled with a compelling value proposition for the brand’s audience can yield a more engaging and interesting mobile product than anything possible with traditional digital tools—which is reason enough to begin exploring.