1 of 25

The Journey to Conversational Interfaces

Romin Irani | Xoriant | @iRomin

2 of 25

Agenda

  • Chatbot Ecosystem
  • Our Story
    • Help Desk Bots
    • Initial Target Platform - Slack
    • NLP + ML + API.AI
    • Go Language

3 of 25

Chatbots! Chatbots! Chatbots!

  • It is usually another way to interact with your Web Application, API or Mobile Application
  • Multiple Messaging Platforms
  • “Chatbots” are expected to be “The Thing” to do in 2017 ;-)

4 of 25

Rule-based v/s AI

  • /find * contains=`xyz`
  • /find pdf since=2d
  • I’d like all documents that contain “xyz”
  • Get me all PDF documents created in the last 2 days

5 of 25

Why Slack ?

  • Popular Messaging Platform
  • Integrates with Popular Applications
  • APIs for Custom Integration
  • Good Documentation
  • App Store
  • Starting point to learn more

6 of 25

Respond to Questions

Notifications

Customized Bot

Analyze

7 of 25

Slack API - Go Language packages

  • You can do everything with standard Go packages
  • Alternately, here are a couple of packages to consider:
  • https://github.com/nlopes/slack
  • https://github.com/bluele/slack
  • Skills needed
    • Basic Go Syntax (Struct, Dealing with JSON)
    • HTTP Basics + Go Language http packages

8 of 25

  • Respond
  • Notify
  • Analyze

9 of 25

Respond

/ticket list

10 of 25

Reporting Issue - Slash Command

  • Slash Command → Messages that start with a slash (/)
  • For e.g. /ticket or /report or /search

/ticket listlist

11 of 25

Handling a Request from Slack

http.HandleFunc("/ticket", MyTicketHandler)

func MyTicketHandler(w http.ResponseWriter, r *http.Request) {

//Extract out multiple params from Request

//Validate if the request is coming from Slack and your team

//Perform business logic

//Compose the Response Struct

json.NewEncoder(w).Encode(/* Slack Response Struct */)

}

12 of 25

Slack Incoming POST parameters

token=oyIQ0AjzcBNgxGMcIsEumUpQ�team_id=T0001�team_domain=example�channel_id=C2147483705�channel_name=general�user_id=U2147483697�user_name=romin�command=/ticket�text=list�response_url=https://hooks.slack.com/commands/1234/5678�

13 of 25

Slack Message Formats - 1

{

"username": "Server Monitor"

"text": "Cloud Storage Service is facing intermittent � issues.\nhttp://status.cloud.google.com",

}

14 of 25

Slack Message Formats - 2

{

"attachments": [

{

"title": "New Ticket: Printer is not working",

"title_link": "https://api.slack.com/",

"text": "The Printer is not functioning….",

"fields": [

{

"title": "Priority",

"value": "High"� },

{

"title": "Reported by",

"value": "romin",

}

],

"footer": "My Help Desk system",

"ts": 1395676789

}

]

}

15 of 25

Notify

16 of 25

Sending Notifications - Incoming Webhook

  • A mechanism to post a message to a Channel or a specific user
  • New Tickets are routed as Notifications to respective Channels (Teams)
  • Updates to Tickets are routed to the specific Users

v := url.Values{"payload": {string(b)}}

http.PostForm(WebhookURL, v)

17 of 25

Analyze

18 of 25

Analytics - Outgoing Webhook

  • Calls your Webhook based on messages sent in a Channel
  • Any message or specific Trigger Words
  • Track Command Usage , Sentiment Analysis and more

19 of 25

Explosion of Commands

/ticket list�/ticket create <title> <details> <priority> <department>�/ticket update <status> <comment>�/ticket close <id>�/ticket view <id>�/ticket help

….

20 of 25

Can we do better?

21 of 25

General AI Agents

Messaging Platforms

NLP , AI as a Service �Platforms

Frameworks & Deployment

Platforms

22 of 25

Our current architecture

Messaging Platforms

NLP

Integrations

Machine Learning

Domains

Bot Endpoint + Logic

23 of 25

How it works?

Diagram inspired from : https://rasa.ai/

Which tickets are assigned to me?

User input in Natural Language

1

NLP Tool

2

intent : tickets_search,

entities:� status : open,� user : romin,� Max_count : 5,

Structured Data

3

Here are your tickets:

1….

2…

3….

Bot output in Natural Language

5

Tickets�API / Database

4

24 of 25

Lessons Learnt

  • Go + Slack is a powerful combination to get going with your Bots.
  • Need to target most popular Chat platforms.
  • Build v/s Buying a Machine Learning Engine. Good Alternatives out there but choose carefully.
  • Voice Interfaces.
  • It is a journey.

25 of 25

Thank You