BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Facebook Wants to Replace Apps with Bots

Facebook Wants to Replace Apps with Bots

This item in japanese

Bookmarks

Facebook has opened up the Messenger Platform to be integrated with chatbots performing various tasks.

The Wit.ai team within Facebook has released to the public their Bot Engine (beta), an AI platform meant to parse human language and transform it into structured and actionable data. Facebook is using it to create a personal digital assistant embedded within Messenger, understanding and completing tasks for users. Facebook wants to extend its reach beyond the simple tasks Google Now and Siri perform - voice dictation, setting an appointment or calling someone. With Facebook M an user will be able to make purchases, book hotel rooms or interact with IoT devices by talking to their assistant.

But Facebook sees this as too broad for a single company to handle, so they have opened up the Bot Engine for anyone who would like to create a chatbot for Messenger. While such bots have existed before, they are mostly based on rules, understanding a limited set of voice commands and responding with corresponding messages. Wit.ai’s engine is initially trained with Stories, which contain a set of probable conversations between a human and a bot. Stories also include actions for the bot to take at some points during the conversation, and, unlike rules, stories do not exclude one another. These stories are the starting point and the developer can begin testing the bot and add new conversations that are automatically transformed by the engine in new stories, gradually creating a model used by the Wit.ai’s machine learning engine to process and understand real conversations with users.

The idea behind chatbots is to eventually replace applications. Instead of having multiple applications installed on their devices, users will use Messenger to interact with various chatbots to perform the tasks currently executed through applications with a touch-based interface. Chatbots will rely mostly on voice messages and AI to interpret and execute commands.

A chatbot built for Messenger uses an HTTP API to access the Bot Engine. There are wrappers for Node.JS, Python and Ruby. The engine responds with data structured as JSON. An example of a request to process the message “Turn on the lights in the living room“, along with the response from the engine looks like this:

// request
$.ajax({
  url: 'https://api.wit.ai/message',
  data: {
    'q': 'Turn on the lights in the living room',
    'access_token' : 'MY_WIT_TOKEN'
  },
  dataType: 'jsonp',
  method: 'GET',
  success: function(response) {
      console.log(response);
  }
});
// response
{
 "_text": "Turn on the lights in the living room",
 "confidence": 1,
 "intent": "lights",
 "entities": {
   "room": [ { "value": "living room" } ], 
   "on_off": [ { "value": "on" } ] 
 } 
}

The Wit.ai demo application shows how  one could control various appliances within a house by issuing voice commands.

Microsoft has announced a similar service during //BUILD 2016, called Bot Framework. Currently a preview technology, it will be made available at the end of the year. It includes support for C# and Node.js.

Rate this Article

Adoption
Style

BT