Google Dialog Flow (API.AI) And SalesForce Chatter Integration via APEX triggers


Salesforce chatter is an application used by CSRs on the CRM to solve any issues interactively. If one CSR or any person on community has a doubt or issue, he types in the problem and is assisted by the other members by usual comment, feed or a chat.

Business Benefit of Adding AI to Salesforce chatter.
Business benefit is not to wait for humans to reply and configure some answers based on past feeds/answers, instead of waiting for someone to type manually. So AI will have the data to reply the questions automatically and hence improving the overall performance and CSR/customer satisfaction. AI can also help in finding the relevant documents to answer the question posted on the feed.

Benefit of Using Dialog Flow with Salesforce.
** Salesforce has their own AI platform and can be integrated.
This article is to integrate with Dialog Flow and is more relevant if you are using Dialog Flow for other platforms like FB, Skype, Telegram etc. and want to have a central AI for Salesforce Chatter too.

Pre-requisite to understand this article
You should have a little hands on for Salesforce chatter application and conversant with the GUI/App for it. Read a little about APEX.

Steps - How to do it?
Before we understand on how to do it. Let us see the components in whole flow.
1. User will start a feed with his question.
2. Feed in step 1 should trigger a call to Dialog Flow ( to check the AI database for an answer )
3. If there is an answer from AI, there should be a comment posted automatically.

Now lets map these steps to a technical flow.
1. User types the question as starting a new feed
2. Initiate a FeedItem trigger (with the feed id as each feed as unique Id)  and call the web service for DialogFlow with the "Feed text".
3. As a response of webservice, call a Feed Comment insert with the "Feed Id" from step 1, to reply it as a comment on the same feed.
4. To handle futher comments/questions on AI response, we will need to handle it as another trigger i.e. FeedComment trigger (feed id will be the link for all questions and responses).

So what all do we need?
1. Write and APEX trigger for Feeditem (insert) event.
2. Write a trigger for FeedComment Insert event. ( in case user asks another question on the response of first call)
3. Write an APEX class, to call the DialogFlow webservice with the relevant parameters, and handling the posting the response as a new Feed Comment on the same feed automatically.

For implementation  assistance or consultancy - Please send an email.


Comments

  1. I have to fund about the information Heroku vs Aws in order to respond the actual queries instantly and therefore enhancing the entire overall performance as well as CSR/customer fulfillment. AI may also assist in locating the appropriate paperwork in order to solution the actual query submitted about the give food to.

    ReplyDelete

Post a Comment