Facebook Bots: A Technical Analysis on Its Usability and Potential

author-photo
Latest Articles

Authored by: Igor Shubovych, Andrew Makarenko, Aaron McLean

Overview

This post is meant to provide some insight into using Facebook’s simple Send/Receive bots API, as well as Facebook’s more complex AI engine, Wit.AI. We’ll reference these two as Simple Bot and Complex Bot throughout the post.

———

How Approachable is Facebook Messenger Simple Bot?

The Simple Bot API is comprised of 2 parts:

  1. A webhook to listen for user notifications (messages from the user)
  2. A basic Send API to respond back to the user (responses)

For Facebook Simple Bots, neither is required. Each part operates mutually exclusive of the other. You can have bots which just listen. Or the opposite. You can build a bot which will send the user messages (for example: news updates) after conversation is initiated. In this case, a webhook for listening is required only once, after which, the Send API takes over for responding.

The most interesting case, obviously, is a bot that has conversations with the user, as it uses both the webhook for listening and the Send API together in logical sequences (or “Expressions”). To write such a bot, you usually need some AI. Facebook proposed using its own wit.ai, however there are other potentially superior options. For example, recently released Microsoft Luis, a natural text processing service, can be integrated with Facebook Messenger API, among others.

Per Facebook’s typical technology strategy, when opening up APIs to external developers, they attempt to make it as simple as possible. Configuration and creation of the Messenger bot follows suit and is very simple.


What Can a Bot Do?

When the listener receives a message from a user, or when some business logic is written to automate a Send API response, Facebook Messenger can send a message to the user which may contain text, images, links and buttons. And in the not-so-distant future, we predict bots will have sophisticated tools for video.  

Important to note: Facebook Messenger API does not support group chats at this time. However, as bots mature and AI becomes more intelligent, imagine having a group of people all interacting with a bot at the same time.


How Flexible/Extensible is Facebook’s Bot?

As a Simple Bot bot is just one webhook, we can add whatever we want to it. For example, different AI processors could be used to handle different contextual and conversational situations and become Complex Bots. By providing this simple and open interface, Facebook has already made its bot platform quite extensible.


How Can Engineers Leverage wit.ai for Complex Bots?

Wit.ai is not considered a full AI solution. It cannot learn to play chess. It cannot itself recognize patterns in data and change its own programming, predicting or proposing better outcomes for interacting with its engine. It is rather a framework for natural text processing and bot building.

Natural text processing is hard. It requires the developer to anticipate a huge variety of Expressions and physically code in logic to accommodate user responses.

Let’s review this scenario from Wit.ai’s quickstart guide:

The user asks “What is the weather?” and the bot tries to clarify “Where is the user exactly?” The trick here is that if the user asks “What’s the weather in Philadelphia?” the wit.ai will understand that the user has provided both intent and location parameter and can reply that “It is always sunny in Philadelphia.”

Now think about all possible cases which can happen while dealing with real user interaction for just these 2 simple questions. If every programmer were to implement natural language processing themselves, the amount of potential logic, expressions, and issues will be huge. Wit.ai provides a simple framework which we configure with expressions, intents, bot replies and function calls. It simplifies building sophisticated bots.

Wit.ai chat bot can talk to different channels, and Facebook Messenger API can be just one of them. We can use wit.ai together with Microsoft Bot Framework, Slack API, HipChat API and other chat APIs to extend the user experience and connected channels.


What are the Perceived Technical Challenges?

Complex Bots with many stories may be hard to debug. Facebook does not allow us to install AI software locally for configuration and debugging. AI framework lives only in Facebook. We have to make changes in two places. One is within our own code and the other is in the bot configuration inside wit.ai. This adds a level of complexity that could be alleviated if Facebook provided wit.ai to run locally with at least some minimal level of access to how their algorithms work.

Wit.ai is like a black box: really hard to understand yet it seems to work like magic. Wit.ai does not explain how their algorithms work in their documentation. As such, we are sending data into the black box and getting responses, but we do not know how the machine is thinking. We have a framework to configure it and fill it with our known pieces, and then somehow it just works. It is difficult to understand what it will return and why it returns what it does.

Also, whenever we start working with any AI like this (wit.ai or Luis), we are in a vendor-lock. We completely depend on the vendor, their AI, and their server. If the vendor upgrades or changes the API, our bots could stop working. And to boot, wit.ai is not very well documented. They provide only a few examples as a starting point.


Where is Stuzo with Facebook Bots?

We are excited by the potential of Facebook Bots. With 900+ million Facebook Messenger users, the network is huge. As such, we are already building our first prototype bots to automate some of our own business processes. Look for a new blog post to announce them in the near future.

———

Is a Bot in Your Future?

If you’re considering a bot for your organization, or would like to learn more about how Stuzo builds on top of Facebook platforms, please Contact Us today.

Share this story

Latest Articles

Don't Miss These...

Contact Us

Please let us know if you’re interested in our software services and Open Commerce platform, in scheduling an Insights briefing, or establishing a partnership.

    By submitting the form you agree to receive
    future periodic email communication from Stuzo.

    We use cookies

    We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. By browsing our website, you consent to our use of cookies and other tracking technologies.