Introduction
AgentAssist is an AI-powered virtual assistant that optimizes contact center agent performance. It offers seamless assistance, promoting enhanced productivity and improved customer satisfaction. Its user-friendly interface and real-time support capabilities let agents effortlessly solve complex customer interactions. To learn more about the AgentAssist widget, follow this link.
This document details the steps for integrating the AgentAssist widget with third-party applications.
Integration Architectures
Chat Integration with Client-Side Communication
Chat Integration with Server-Side Communication
Voice Integration with Client-Side Transcript Sharing
Voice Integration with Server-Side Communication
Steps to Integrate AgentAssist into any Third-Party Application
This section gives an overview of the required steps to integrate Kore.ai AgentAssist into any third-party application, including telephony or CRM systems.
- Store Bot credentials within the third-party platform.
- Generate a URL for the AgentAssist widget.
- Fetch the stored bot details.
- Get the unique ID of the current ongoing conversation.
- Generate JSON Web Token and build the URL.
- Enable inter-communication between the Kore.ai AgentAssist widget and the third-party platform.
- Trigger a summary on the AgentAssist widget at the end of a conversation.
Store Bot credentials within the third-party platform
- Store the Kore.ai Bot credentials in the third-party for integration. Refer to this article and this one on how to access your bot credentials.
- Examples on how to store:
Platform | Storage Method |
Genesys | Data Tables |
NiceCX | Studio Scripts |
Salesforce | Custom Objects |
Talkdesk | Script Variables |
Amazon Connect | Lambda Environment, Flow Context Variables |
Generate a URL for the AgentAssist widget
- Fetch the Kore.ai Bot credentials stored on the platform.
- Get the unique ID of the ongoing conversation:
- The process varies depending on the third-party platform.
- The Conversation ID is usually accessible within the flow variables on the third-party platform.
- Generate JSON Web Token and build the URL:
The URL follows this structure:- Host: https://agentassist.kore.ai
- Path: koreagentassist-sdk-v3/UI/agentassist-iframe.html
- Query Parameters:
- botId: Bot ID of the bot you want to use (for example, st-xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx)
- conversationid: Unique identifier for the ongoing conversation.
- source: Name of the third-party platform. Only used for tracking on the AgentAssist console.
- agentassisturl: https://smartassist.kore.ai or https://agentassist.kore.ai
- isCall: Boolean value indicating if the current conversation is a call.
- customdata: Optional – customData with URL encoded JSON format.
- channel: Optional – for experience purposes and can be email, voice, or chat.
- token: JSON Web Token encrypted with the client secret of the bot with the following payload.
{ "iss": "cs-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Client ID of the Bot "sub": "number", "aud": "https://idproxy.kore.com/authorize", "botId": "st-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // Bot ID "isAnonymous": false }
Towards the end, the URL should look like this:
https://agentassist.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html?token=<jwt-token>&botid=<bot-id>&agentassisturl=https://smartassist.kore.ai&conversationid=<conversation-id>&source=<source>&isCall=true&customData=<url-encoded-json>&channel=<channel>
Enable inter-communication between the Kore.ai AgentAssist widget and the third-party platform
- For correct functioning of the Kore.ai AgentAssist widget, ensure communication is facilitated between the AgentAssist widget and the third-party desktop.
- The communication can be one-way or two-way based on the medium of conversation (voice or a chat).
Third-party platform to the AgentAssist widget
Client-side Approach – Recommended for Chat
- This approach is used if the Agent Desktop (client) exposes the events like incoming and outgoing Chat Messages or Voice Transcripts to the window. In this case, you put the AgentAssist widget in a wrapper to capture the messages coming from the window (Agent Desktop).
- You can post messages to the AgentAssist widget with the postMessage API. You can read more about it here.
- The payload of messages required to be posted to the AgentAssist widget are as follows:
- Post all messages (Customer and Agent) to the AgentAssist widget for conversation logs.
{ "author": { "name": "<Customer Name>", // or Agent Name, or a placeholder name "id": "<Customer ID>", // or Agent ID "type": "USER" // or AGENT }, "botId": "<Bot ID>", "type": "USER", // or AGENT "conversationId": "<conversationId>", "userId": "<customerId>", "message": "<message>" }
- Post all messages (Customer and Agent) to the AgentAssist widget for conversation logs.
- Post Customer messages to the AgentAssist widget for intent identification.
{ "author": { "Id": "<author id>", // optional, send blank string if not available "type": "USER", "firstName": "<first name>", "lastName": "<last name>" }, "conversationid": "<Conversation ID>", "name": "agentAssist.CustomerMessage", "value": "<Message sent by customer>" }
Server-side Approach – Recommended for Voice
Chat Channel
- This approach is used when the client does not expose Chat message events to the window, but allows the messages to be sent to an external webhook via either from within a flow or an explicit configuration within the third-party desktop.
- The message payload needs to be in a specific JSON format as it is sent to Kore.ai AgentAssist Webhook.
- If the third-party does not let you specify and/or customize the message format it sends to webhook, you need to write a service in the middle to be used as a proxy for the Kore.ai AgentAssist webhook. The proxy changes the data format from the third-party to the one specified by Kore.ai.
- Here is the cURL command for sending messages to Kore.ai AgentAssist that is adaptable to your specific use case.
// Add curl to send message via webhook to AgentAssist curl --location --request POST \ 'https://agentassist.kore.ai/agentassist/api/v1/hooks/<Bot ID>' \ --header 'token: <token>' \ --header 'Content-Type: application/json' \ --data-raw '{ \ "conversationId": "<Third Party Conversation ID>", \ "query": "show balance", \ "botId": "st-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", \ "agentId": "xxxxx", \ "experience": "voice", \ "entities": [], \ "sendUserMessage": true, \ "sendAgentMessage": false, \ "language": "en-IN" \ }'
Voice Channel
- This is the main approach used with Kore.ai AgentAssist voice channels.
- Both the voice streams (agent and customer) are sent to Kore.ai AgentAssist. Based on the feasibility of the third-party contact center, there are two implementations for this process – Voice Streaming over SIP & Voice Streaming over WSS.
AgentAssist widget to third-party platform
Note: Applicable only for Chat conversations.
For both the approaches (client-side and server-side), we add a wrapper on top of the AgentAssist widget. The wrapper functions as an event listener for the Javascript postMessage API. The wrapper can then use either the client-side or the server-side approach to send a message to the customer, impersonating the agent.
Events
The AgentAssist widget emits events structured as the following:
// "Send" button event { "method": "send", "name": "agentAssist.SendMessage", "conversationId": "<conversation-id>", // Conversation ID "payload": "Hi there. How can I help you today?" // Message Content } |
// "Copy" button event. You can copy to the agent text input or clipboard { "method": "copy", "name": "agentAssist.SendMessage", "conversationId": "<conversation-id>", // Conversation ID "payload": "Hi there. How can I help you today?" // Message Content } |
Client-Side Approach – Recommended
- Applicable when you can programmatically send messages directly via the agent desktop, by either triggering events or any alternative.
Server-Side Approach
- Use this approach if the client-side approach isn’t feasible and the third-party contact center allows for pushing messages to the current conversation via a webhook.
- Similarly, if the third-party does not allow you to invoke the webhook from a browser (due to CORS restrictions or credentials being exposed in the client), you must write a service in the middle to be used as a proxy for the third-party webhook. The proxy is responsible for sending the data to the third-party contact center in the data format accepted by their endpoints.
Trigger summary on the AgentAssist widget at the end of the conversation
When the conversation ends, you can trigger the AgentAssist Summary functionality by sending the following event to the AgentAssist widget:
{ "payload": { "chatHistory": [] }, "conversationId": "<Conversation ID>", "name": "agentAssist.endOfConversation", "botId": "<Bot ID>" } |