Making SUSI.AI reach more users through messenger bots

SUSI.AI learns from the queries asked to it by the users. More are the number of queries asked, the better is the learning by SUSI.AI. More are the number of users involved with SUSI.AI, better is the amount of content available to SUSI to learn from. Now, the challenge in front of us is to indulge more users with SUSI.AI. In this blog post, SUSI Tweetbot and SUSI FBbot are used as examples to show how we increase our user base through messenger bots. Twitter: Twitter has a 328 million user base according to this article’s data. Integration of SUSI.AI to just Twitter makes it available to around 300 million users. Even if some percentage of these users start using SUSI.AI, increase in the user base of SUSI.AI could be exponential. Increasing the user base is advantageous as it provides with more training data for SUSI.AI to learn from. Sharing by public tweet: Integrating to it is just the first step towards increasing SUSI.AI’s user base. Next step is to reach the users and indulge them into chatting with SUSI.AI. Suppose a user asked something to SUSI.AI and really liked the reply from it. He/she wants to share it with his/her followers. This can prove to be a golden opportunity for us, to increase the reach of SUSI.AI. This way we can indulge their friends to try SUSI.AI and have an amazing time with it. It becomes clear that sharing messages is an indispensable feature and can help us a lot. Twitter doesn’t provide sharing with friends through direct messages but with a feature much better than it. We can share that message as a public tweet and cover more users including the followers of the user.   To show this button we use Call to action support by twitter: "message_data": { "text": txt, "ctas": [{ "type": "web_url", "label": "Share with your followers", "url": "" }] } The url key in the above code must have a value that redirects to a U.I. that allows to publicly tweet this reply by SUSI.AI. Using this “https://twitter.com/intent/tweet?text=" as the url value shows a new page with an empty tweet message, as the text query in the url has no value. We set the text field with a value such that we end up like this: and after tweeting it: Sending a direct message link with the tweet: Twitter provides with a lot of features when sending direct messages. Shifting a user from tweets to direct messages is beneficial in a way that we can efficiently tell the user about the capabilities of SUSI.AI and show important links to him/her like of its repository, web chat client etc. When a user tweets to the SUSI.AI page with a query, we reply with a tweet back to the user. Along with that, we provide a link to privately message SUSI.AI account if the user wants to. This way if user ends up visiting SUSI.AI in a chat window: To achieve this in SUSI Tweetbot,…

Continue ReadingMaking SUSI.AI reach more users through messenger bots

Advanced functionality in SUSI FBbot

SUSI AI is integrated to Facebook (blog). During the initial phase, SUSI FBbot had basic UI and functionalities like just “plain text” replies. Facebook provides many more features like replies enclosed in templates (blog link), sharing the replies by SUSI A.I. with friends, get started button or a persistent menu to show quick reply options to the user etc. All these features to enhance the user experience with SUSI AI chatbot. This blog post walks you through on adding these functionalities to the SUSI FBbot: Adding Get Started button A Get Started button is added to the SUSI FBbot to give the user a brief introduction about SUSI AI and what the user can try next. Clicking on the get started button , will send the message as “Get Started” to the SUSI FBbot: The reply message, provides the user with options to visit SUSI A.I. repository or to just start chatting. To have this button in our bot, we use this code snippet: // Add a get started button to the messenger request({ url: 'https://graph.facebook.com/v2.6/me/messenger_profile', qs: {access_token:token}, method: 'POST', json: { "get_started":{ "payload":"GET_STARTED_PAYLOAD" } } }, function(error, response, body) { // handle errors and response here }) When a user clicks this button, a postback is sent to the webhook of SUSI FBbot with payload as “GET_STARTED_PAYLOAD”. When we receive such postback, we reply with a message as shown above using generic template. Adding a persistent menu to the bot If not at the start, while chatting with SUSI AI for sometime, it is quite possible that the user becomes curious to visit the repository of SUSI A.I. . So we need a quick access to the “Visit repository” button all the time. Persistent menu, helps us with this feature: This way it is accessible at each point of time. Some other buttons can also be added to the menu like “Latest News” as shown in the image above. To have a persistent menu for the SUSI FBbot, the following code snippet is used: request({ url: 'https://graph.facebook.com/v2.6/me/messenger_profile', qs: {access_token:token}, method: 'POST', json: { "persistent_menu":[{ "locale":"default", "composer_input_disabled":false, "call_to_actions":[{ "type":"web_url", "title":"Visit Repository", "url":"https://github.com/fossasia/susi_server", "webview_height_ratio":"full" }] }] } }, function(error, response, body) { // handle errors and response }) We can add more buttons to the menu. JSON object having the required properties of that button can be appended to the key “call_to_actions” to do so. Adding a messenger code to join SUSI FBbot To enable Facebook users to chat with SUSI AI by scanning a code through messenger. This feature is added to the bot by making the following POST request: request({ url: 'https://graph.facebook.com/v2.6/me/messenger_codes', qs: {access_token:token}, method: 'POST', json: { type: "standard", image_size: 1000 } }, function(error, response, body) { // handle errors and response. }); Adding message sharing feature To increase the reach of SUSI A.I. to more users on Facebook, message sharing proves to be a big boon. The reply by SUSI A.I. to users can be shared with their friends. Along with the message we can also send…

Continue ReadingAdvanced functionality in SUSI FBbot