Almost all the discussion around bots to date has focused on bot-to-human interactions: how bots interact with humans; conversational interfaces; human search and discovery; engagement metrics; spam controls, etc. However, there is a potentially bigger aspect of the bot phenomenon that hasn’t been much discussed or explored: bot-to-bot interactions.

Bots communicating with each other can enable amazing possibilities. Here are a few of them:

  • Bots can negotiate and transact deals with one another, giving rise to bot marketplaces. Shopping bots can procure prices, deals, and discounts from merchant bots, thereby doing comparison-shopping.

  • Bots can collaborate with one another to form groups, hierarchies and other organizations in order to achieve tasks that are more complex than any one bot can. Isn’t that what humans do too? Imagine your “smart home bot”, communicating with the “neighborhood bot”, which communicates with the “city bot”, thus enabling hierarchical coordination with each other.

  • It also makes bot building easier. A developer can string multiple bots together to create a new bot. For example: placing a “pizza bot” together with a translate bot gives you a multilingual pizza bot.

These are just some of the possibilities we can imagine today. And, there are a lot more beyond the horizon.

Introducing the InterBot - a communication channel that enables bot to bot communication  and allows bots to freely communicate with one another. To use InterBot, bots first have to publish themselves on this new channel. Then bots can consume the services of other bots or offer its services to others. Humans, and bots too, can compose other bots endlessly in plug-and-play style by simply connecting them like Lego blocks. Plus, there are APIs to enable more advanced combinations of bots, as described above. Check out some of the examples of bots built on the InterBot channel in the Emulator page. You can play around with building new bots by combining existing bots on our Composer page. You can read our documentation page to publish your bot to InterBot.

function MessageHandler(context, event) { } function EventHandler(context, event) { } function HttpResponseHandler(context, event) { } function DbGetHandler(context, event) { } function DbPutHandler(context, event) { }
function MessageHandler(context, event) { var channelName = event.contextobj.channeltype; var senderName = event.senderobj.channelid; context.console.log("refid : "+refid+" ; senderName : "+senderName); var ibcbots = botmap.split("|"); var position = ibcbots.indexOf("@"+senderName); var nextBot = ibcbots[position+1] var lastBot = ibcbots[ibcbots.length-1].replace(/@/g,""); context.console.log("nextBot : "+nextBot); if(channelName == "ibc"){ var refid = event.contextobj.refid; if(position < 0 && senderName!=botName){ //IBC Init Point if(!context.simpledb.botleveldata[refid]){ context.simpledb.botleveldata[refid]=senderName; context.simpledb.saveData(sendIBCMessage(context,ibcbots[0].replace(/@/g,""),refid,event.message)); }else{ delete(context.simpledb.botleveldata[refid]) return; } }else if(nextBot){ sendIBCMessage(context,nextBot.replace(/@/g,""),refid,event.message); }else{ recBotname = context.simpledb.botleveldata[refid]; try{ var userContext = JSON.parse(recBotname); delete context.simpledb.botleveldata[refid]; context.simpledb.saveData(sendMsg(context,recBotname,event.message)); }catch(err){ delete context.simpledb.botleveldata[refid]; context.simpledb.saveData(sendIBCMessage(context,recBotname,refid,event.message)); } } }else{ var _event = event; var _context = context; generateRefid(function(context,event){ var refid = String(event.getresp); context.simpledb.botleveldata[refid] = JSON.stringify(_event.contextobj); context.simpledb.saveData(sendIBCMessage(context,ibcbots[0].replace(/@/g,""),refid,_event.message)); }); } } function generateRefid(cb){ var url = envurl+botName+'/refid'; var headers = { 'content-type': 'application/x-www-form-urlencoded', 'apikey': apikey } context.simplehttp.makePost(url, "", headers,cb); } function sendIBCMessage(context,recipientName,refid,message) { var url = envurl+botName+'/sendmsg'; var headers = { 'content-type': 'application/x-www-form-urlencoded', 'apikey': apikey } var formData = 'refid=' + refid + '&message=' + message+'&destbotname='+recipientName; context.simplehttp.makePost(url, formData, headers); } function sendMsg(context,userContext,message){ var url = botenvurl+botName+'/msg'; var headers = { 'content-type': 'application/x-www-form-urlencoded', 'apikey': apikey } var formData = 'context=' + userContext + '&message=' + message+"&bypass=true"; context.simplehttp.makePost(url, formData, headers); } /** Functions declared below are required **/ function EventHandler(context, event) {} function HttpResponseHandler(context, event) {} function DbGetHandler(context, event) {} function DbPutHandler(context, event) {}