Slide 1

Slide 1 text

Conversational Commerce Infrastructure with Messenger Send API Rizki Romadhoni - Sale Stock Engineering

Slide 2

Slide 2 text

Objective Build a new generation of tools that enable brands to communicate with customers in powerful new ways at reduced cost. Experimenting with chatbots, powered by a combination of machine learning, natural language processing, and live operators, to provide customer service, sales support, and other commerce-related functions.

Slide 3

Slide 3 text

Simply, this is why

Slide 4

Slide 4 text

Simply, this is why

Slide 5

Slide 5 text

Conversational Commerce Pertains to utilizing chat, messaging, or other natural language interfaces (i.e. voice) to interact with people, brands, or services and bots that heretofore have had no real place in the bidirectional, asynchronous messaging context

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Message Flow Architecture @ Sale Stock

Slide 9

Slide 9 text

Clearer Look Conversation Router FB Outbound Inbound Other Outbound FB Inbound FB HOOK Messenger Send API HTTP MQ (Kafka) gRPC Autoreplier Internal API

Slide 10

Slide 10 text

Integration We need to integrate Messenger to have its own inbound and outbound on our system. In advance, we can also have a linking account mechanism. ● Inbound ● Outbound ● Auto Replier - Artificial Intelligence ● Account Linking ● Instant Login

Slide 11

Slide 11 text

Conversation Router FB Outbound Inbound Other Outbound FB Inbound FB HOOK Messenger Send API Autoreplier Inbound Service Internal API

Slide 12

Slide 12 text

messaging: [ { sender: { id: '10206767926253119' }, recipient: { id: '1759085607670907' }, timestamp: 1480056616155, message: { mid: 'mid.1480056616155:f2c5a8c067', seq: 21474, text: 'Bisa bayar di tempat ga sis?' } } ] { senderId: '551e5b22-c1e1-405f-b8aa-bc13fc...', conversationId: '179f8e99-8f85-4beb-a504-...', text: 'Bisa bayar di tempat ga sis?', timestamp: 1480056616155, messageType: 'TEXT', channel: 'FB-MESSAGING', channelKey: '551e5b22-c1e1-405f-b8aa-bc1...', isAgent: false } FB Webhook Gives: Serviam Knows:

Slide 13

Slide 13 text

Inbound Service - Common Tasks Inbound is the place where we translate messenger’s messaging formats to formats that our system understands, there are a lot more things happen here like client-mapping, rule-based replier for transactional conversations, session-management, account linking, etc.

Slide 14

Slide 14 text

Inbound Service - Transaction Design Show Collections Show Product Select Product Variant Done? Shop More Checkout ?

Slide 15

Slide 15 text

Conversation Router FB Outbound Inbound Other Outbound FB Inbound FB HOOK Messenger Send API Autoreplier Replier Service Internal API

Slide 16

Slide 16 text

Replier Service This is the middleware that processes the messages going through our system where bot interacts with customers. On this phase, bot tries to understand the context and figures out what’s the best answer. Bot sends replies it is confident with and leave messages it hesitates with.

Slide 17

Slide 17 text

Conversation Router FB Outbound Inbound Other Outbound FB Inbound FB HOOK Messenger Send API Autoreplier Outbound Service Internal API

Slide 18

Slide 18 text

Outbound Service This is the place where we translate messages back from formats we know to formats that Messenger Send API understands and send these messages to the API. const composeMessagesThenSendToFB = composeP( trackP('8. sendFailedMessagesToInbound'), sendFailedMessagesToInbound, trackP('7. setSentStatusOfMessages'), setSentStatusOfMessages, trackP('6. sendMessagesToFacebook'), sendMessagesToFacebook, trackP('5. getSenderClientIdsOfMessages'), getSenderClientIdsOfMessages, trackP('4. filterSentMessages'), filterSentMessages, trackP('3. getSentStatusesOfMessages'), getSentStatusesOfMessages, trackP('2. getMessages'), getMessages, trackP('1. takeMessages'), takeMessages ); // read: right-to-left

Slide 19

Slide 19 text

Interaction Spectrum Rule-based AI Customer Service Postback Handle transactional conversations: buy, add, checkout Soraya AI Agents Agents

Slide 20

Slide 20 text

Rule-based Replies Replies are generated by the user’s button-action, let’s call it POSTBACK. Each postback has it’s own type and payload. It is where we know the exact reply from. We resolve replies for this message type on Inbound for faster response. buttons: [ { type: 'postback', title: 'Hapus', payload: JSON.stringify({ type: 'DELETE_CART_ITEM', payload: { sku: item.sku, }, }), }, ],

Slide 21

Slide 21 text

Interaction Spectrum Rule-based AI Customer Service Postback Soraya AI Handle natural language conversations known by AI Agents Agents

Slide 22

Slide 22 text

Artificial Intelligence Replies AI is supposed to answer every incoming messages, only if it is confident enough. Otherwise it should be answered by a human.

Slide 23

Slide 23 text

Do we need an AI? Not necessarily

Slide 24

Slide 24 text

Yeah we should, these are advantages from an AI existence in our system: ● Scalability, easy to scale out ● Availability, faster response for lots of general questions ● Productivity, allow agents to handle unique questions and leave general questions for AI Should we have an AI?

Slide 25

Slide 25 text

Interaction Spectrum Rule-based AI Customer Service Postback Soraya AI Agents Handle conversations that AI is not confident to answer yet Agents Correct AI’s answers

Slide 26

Slide 26 text

Agent Replies When an incoming message is not a rule-based message, or AI can’t handle it, then a human intervention is needed to answer this question, this human could be an agent, customer service, customer support, or any other customer-brand communication role.

Slide 27

Slide 27 text

Interaction Spectrum Rule-based AI Customer Service Postback Handle transactional conversations: buy, add, checkout Soraya AI Handle natural language conversations known by AI Agents Handle conversations that AI is not confident to answer yet Agents Correct AI’s answers

Slide 28

Slide 28 text

Account Linking We’ve promised sistas to deliver high-quality clothes with affordable prices. But we think it’s not enough, we can also deliver it in affordable ways. By linking sistas’ account to their messenger account, they can easily browse products in messenger and whenever a they want it, they can buy it directly on messenger.

Slide 29

Slide 29 text

Instant Login Login instantly to our web via secured link. Deprecated from Serviam because we don’t need this since the release of our in-messenger-checkout. But it is no stranger to this =>

Slide 30

Slide 30 text

Thank you Facebook For providing us a better way to deliver these affordable clothes to all women around the Country :)