Agent AI Integration with Genesys Cloud CX using Kore Data Table
Integration of Agent AI in Genesys is a significant enhancement to our solution. Previously limited to a single bot and a department-specific approach, the solution has now been upgraded to support multiple bots and a queue-based functionality. This enhancement enables Genesys Cloud CX to offer a more flexible and scalable solution for businesses seeking to leverage AI to improve agent efficiency and customer satisfaction across multiple departments.
Note
This integration process also works for Genesys Desktop App.
Definitions¶
Section/Group | Key | Definition | Reference |
Generate Oauth ID to enable Kore Services to Connect with Genesys
+ Create an Interaction Widget in Genesys for Agent AI |
Agent AI URL | The domain of the Agent AI. |
|
Client App | To use any Kore.ai Bot SDKs, a client app must be created to get the authentication credentials to communicate between the Kore.ai bot and Agent AI.
Note: Only the default Client App is supported. |
https://developer.kore.ai/docs/bots/channel-enablement/adding-the-webmobile-client-channel | |
Create an Interaction Widget in Genesys for Agent AI | Custom Data / x_passthru_metadata | Use this to pass information to Agent AI Bot. | |
Capture Bot Information in Kore Data Table | Secure Custom Data / KvpConfig | Use this to pass sensitive information to Agent AI Bot. | https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/#JSON_Web_Encryption_JWE |
Create an Interaction Widget in Genesys for Agent AI | Interaction Widget | The Interaction Widget is utilized for displaying the Agent AI iframe within the Genesys Agent Desktop. | https://help.mypurecloud.com/articles/set-up-an-interaction-widget-integration |
Create an Interaction Widget in Genesys for Agent AI | Interaction Widget URL params |
|
x_metadata’s JSON object structure is
|
Capture Bot Information in Kore Data Table | BotId | A unique identifier assigned to a bot. | Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details |
Capture Bot Information in Kore Data Table | ClientId | An identifier provided to a client application. | Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details |
Capture Bot Information in Kore Data Table | ClientSecret | A secret key or password associated with the ClientId. | Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details |
Capture Bot Information in Kore Data Table | AgentAssistWidgetURL | URL that points to the Agent AI widget.
For example, https://agentassist.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html |
Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details |
Capture Bot Information in Kore Data Table | AudiohookEnabled | A setting or flag indicating whether Kore audio processing is enabled for the bot. | “true” if Kore audio processing should be enabled, otherwise “false”. |
Capture Bot Information in Kore Data Table | QueueIdentifier | It’s a unique identifier in the Data Table to fetch bot details at run time. | |
Capture Bot Information in Kore Data Table | KvpConfig | The KVPs (Key value pairs) to be included in SecureCustomData. JSON object containing the necessary keys and xpath (paths to locate the value in Genesys Conversation API result JSON object). https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-conversations--conversationId
Note: Optional Column. Required when you wish to send secure custom data to Agent AI. |
Sample:
|
Capture Bot Information in Kore Data Table | JWEPublicKey | Public key assigned to the Client App. | Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details |
Capture Bot Information in Kore Data Table | RSPrivatePem | The Private Key that corresponds to the Public Key supplied during the creation of a Client App using the RS256 or RS512 algorithm. | RSPrivatePemKey is an optional column and is required when the algorithm used is “RS256” or “RS512”.
(Not supported / Will be supported in future releases) |
Capture Bot Information in Kore Data Table | Algorithm | Algorithm assigned to the Client App. | Currently, “HS256” algorithm is the only supported value. So, the algorithm value will always be “HS256”. |
Install Audiohook for Voice Streaming | Kore Voice Gateway(KVG) | For Saas in US region, value is savg-webserver.kore.ai
For on-prem, refer to corresponding host |
Architecture Diagrams¶
Chat
Voice
Interaction Sequence¶
This document provides detailed, step-by-step instructions for setting up the integration of the Agent AI widget in the Genesys environment.
Activities on Kore Platform¶
- Capture Bot information in Kore Data Table
- Access Custom Data and Secure Custom Data in Agent AI Bot
Activities on Genesys Cloud¶
- Generate Oauth ID to enable Kore Services to Connect with Genesys
- Create an Interaction Widget in Genesys for Agent AI
- Provide Interaction Widget Access to Agents
- Create a Queue in Genesys
Chat Setup¶
- Create/Update Architect Inbound Message Flow in Genesys for the Agent Queue
- Create Messenger Configuration
- Create Messenger Deployment
- Steps to start a Chat Request Simulation
Voice Setup¶
- (Optional) Install Audiohook for Voice Streaming
- Create/Update an Architect Inbound Call Flow in Genesy for the Agent Queue
- Steps to start a Voice Request Simulation
Prerequisites¶
- Genesys Administrator having access to Genesys Cloud account with Admin rights.
- Kore Administrator having access to Kore.ai Agent AI instance.
Capture Bot Information in Kore Data Table¶
Data Tables are used to store agent queue-specific bot credentials. Each record of the Kore Data Table represents a unique Genesys agent queue and its corresponding bot definitions.
If a single bot is used for several queues, create a record and insert the queue names, separated by commas, as the value for the QueueIdentifier, along with the bot details.
Kore.ai matches the third-party queue name with the "QueueIdentifier" credential name in its bot credentials to render the appropriate bot.
- Bot credentials are fetched based on Genesys desktop queue names. If the Genesys queue name is of the “<QUEUEIDENTIFIER><QDELIMITER>XXXXX” format, for example “ALPHAINC_CUSTOMERSERVICE_16092024,” then:
- QueueIdentifier = ALPHAINC and qDelimiter = “_”.
- Update the QueueIdentifier in the Kore datatable.
- Update the qDelimiter in the Create an Interaction Widget in Genesys for Agent AI section.
Note
Multiple records with different bot credentials shouldn't be entered into the Kore Data Table for a single QueueIdentifier.
How to create a New Data Table¶
- Sign in to Kore.ai XO Platform.
- Click Data > Data Tables.
-
Enter the following details in the New Table page:
- Name of the Data Table (any alphanumeric name).
- Description of the Data Table.
-
Columns to be included in the Data Table. Click the “tick” mark to add multiple columns.
Add the following case-sensitive columns with type “string”:
Mandatory Columns:
- QueueIdentifier (unique identifier for the table)
- BotId
- ClientId
- ClientSecret
- AgentAssistWidgetURL
- AudiohookEnabled
- JWEPublicKey
Optional Columns:
- KvpConfig
- Algorithm (HS256)
- RSPrivatePem (Ignore/Not Supported)
-
Indexes for the table.
- Index Name for reference.
- Is Unique flag to define if the index is expected to contain unique values. (Enable “‘is Unique.”)
- Column & Sort Order – List of columns to be included in the index; you can select multiple columns and specify the sort order (ascending or descending) for each of the selected columns. (Select QueueIdentifier with ascending order.)
-
Bot Assignments (not applicable).
-
App Assignments to let apps access data in this table.
-
Select any app from the displayed list, or click Create New App and enter your app name:
-
Select the Read, Write, and Delete permissions, as required.
Note
You can also create new apps by clicking Data > Apps > New App in the home page:
-
-
Process Assignments (not applicable)
- Click Create to create the new data table.
Insert data into Data Table¶
Set up necessary permissions and app assignments and insert bot-specific data into the Data Table.
- Sign in to Kore.ai XO Platform.
- Click Data > Apps.
-
Select the App with “write” access to the Data Table where you want to add information.
-
Copy Client ID and Client Secret of the App.
- Create a JWT Token using the Client ID and Client Secret by following this doc.
-
Insert the following data into the Data Table by following this doc. Use the JWT Token created in the previous step.
API Body Payload Structure:
{ "data": { "QueueIdentifier": <Unique QueueIdentifier>, "BotId": <Kore BotId>, "ClientId": <Kore ClientId>, "ClientSecret": <Kore ClientSecret>, "AudiohookEnabled": "true" / "false", "AgentAssistWidgetURL": <Kore Agent AI Widget URL>, "KvpConfig": <KVPs of SecureCustomData>, "JWEPublicKey": <Public Key assigned to Client App>, "Algorithm": "HS256" } }
Notes
- For a single queue, the QueueIdentifier value contains one queue name (for example, “Kore”). For multiple queues, it includes all the queue names separated by commas (for example, “Kore, KoreSupport”).
- JWEPublicKey and KvpConfig value should be a stringified JSON object.
Generate Oauth ID to enable Kore Services to Connect with Genesys¶
Steps to get Genesys OAuth ID:
- Sign in to Genesys Cloud.
- Go to Admin > Integrations > OAuth.
- Click Add Client.
- Enter the app name, description, and token duration in the App Name, Description, and Token Duration fields.
- Select Token Implicit Grant (Browser) in the Grant Types section.
- Add {Agent AI URL}/koreaiaa-genesys/ in the Authorized redirect URIs field.
- Add the following list of scopes in the Scope section:
- conversations
- conversations:readonly
- integrations
- integrations:readonly
- messaging
- messaging-platform
- messaging-platform:readonly
- messaging:readonly
- notifications
- user-basic-info
- web-chat
- web-chat:readonly
After saving the configuration, you get the Client Id of the created OAuth client. Copy the ID and have it available for Step 3.
Create an Interaction Widget in Genesys for Agent AI¶
Create a new Interaction Widget. This widget is hosted in the Genesys agent desktop and provides the Agent AI solution features to agents.
Steps to create an Interaction Widget:
-
Sign in to Genesys Cloud.
-
Click Admin > Integrations.
-
If you have not created an Interaction Widget for Agent AI, install a new Interaction Widget by clicking the Integrations tab on the right side of the page.
-
Name the Interaction Widget with a meaningful name, such as KoreaiAA Interaction Widget.
- Open the Interaction Widget by clicking the name.
-
In the Application URL field, enter the following structure:
{Agent AI URL}/koreaiaa-genesys/?conversationid={{gcConversationId}}&lang={{gcLangTag}}&environment={{gcHostOrigin}}&genesysid=<genesys-oauth-Id>&multibot=true&x_metadata=<?x=%7B%22datatable%22%xxxxx>&x_passthru_metadata=<Token>
.
Note
x_passthru_metadata is an optional query parameter. This is required when you wish to pass custom data to Agent AI.
The “x_metadata
” value equals the URL
-encoded string
of the JSON object.
-
For the oauthId value, use the OAuth ID from Step 2.
-
Build x_metadata:
-
Sign in to Kore XO Platform.
-
Click Apps, and click one of the app names that has “read” access:
-
Create a JWT Token using the Client ID and Client Secret by following this doc.
-
Generate a JSON object with the specified structure, and then convert it into a URL-encoded string:
Reference:{ "datatable": { "name": <paste datatable name>, "token": <paste token created in previous step>, "qDelimiter": <Paste the special character used in the queue name to distinguish the QueueIdentifier from the remaining part of the queue name> } } Website for url encoding - urlencoder
-
Copy the URL-encoded string and paste it against the x_metadata value.
-
-
Allow all permissions in iFrame Sandbox Options and iFrame Feature/Permission Policy:
iFrame Sandbox Options: allow-forms,allow-modals,allow-popups,allow-presentation,allow-same-origin,allow-scripts,allow-downloads.
iFrame Feature/Permission Policy: camera,microphone,geolocation,clipboard-write,display-capture,fullscreen.
Communication Type Filtering: chat and call.
Provide Interaction Widget access to agents¶
To view the Interaction Widget, agents must have the following accesses:
Group Membership¶
An Interaction Widget uses Group Membership to determine who can view it on the agent desktop.
- Use an existing Group, if your agents are already part of it. Otherwise, create a new Group for Agent AI permission.
- Name the Group as KoreAA-Agents or similar to distinguish it.
- Add any agent to allow them to use the Agent AI functionality. You can utilize more than one Group, if required.
- Go back to the Integrations section and open the Interaction Widget created in Step 2.
- On the Configuration tab, add access using the Group you identified or created for Agent AI in the Group Filtering option.
You may also utilize Queue Filtering (optional).
Custom Role/Permission¶
In addition to the basic agent role, add a new role as given below:
- Sign in to Genesys Cloud.
- Go to Admin > People & Permissions > Roles / Permissions.
- Click Add Role to create a new role.
- Give a distinctive name to the role; for example, KoreaiAA Agent.
-
On the Permission tab, search for Conversation > Transcription > View, and add (select the box):
Note
The Conversation permission is available only in the CX3 license.
-
Once the role is created, click the three dots at the right end of the Permission role, and select Change Membership. Add the appropriate agents to the role.
Create a Queue in Genesys¶
- Sign in to Genesys Pure Cloud.
- Go to Admin > Contact Center > Queues, or enter “queues” in the search bar under the Admin section and press the Enter key.
-
Click Create Queue. An empty page to create a new queue appears on the right side of the page.
-
Enter/select the following details in the Create Queue page:
- Name: Enter a unique name for the new queue.
- Division: Select a division in which you want to place this queue.
- Copy settings and members from (Optional): Select an existing queue name, if you want to copy the settings and members from it.
- Peer Id (optional) : Enter a unique ID that can be used to identify the queue from an external platform.
-
Click Save.
Enabling the Audio Monitoring toggle¶
To stream audio to third-party services, follow the below steps:
- Sign in to Genesys Pure Cloud.
- Go to Admin > Contact Center > Queues, or enter “queues” in the search bar under the Admin section and press the Enter key.
- Click the intended queue name.
- Click the Voice tab.
-
Enable the Audio Monitoring toggle.
Audio Monitoring: Voice settings on a Queue now have an additional Audio Monitoring option, separate from Voice Transcription. This allows granularity in what you turn on. The Audio Monitoring will be enabled in the queue, if Audiohook Monitor is enabled by the organization.
Chat Setup¶
Create/Update Architect Inbound Message Flow in Genesys for the Agent Queue¶
This step is essential for managing incoming messages to the Genesys platform. When a chat is initiated from the web chat messenger, it first gets directed to this inbound message flow.
Steps to create a chat architect flow¶
- Sign in to Genesys Cloud.
- Go to Admin > Architect > Architect.
-
Click the three dots next to Flows: Inbound Call, and select Inbound Message.
-
Click Create Flow. The final architect flow looks like the following screenshot:
-
Click Publish.
Create Messenger Configuration¶
Before using web messaging, you must configure it in Genesys Cloud. To configure Web or Mobile Messaging in your organization, follow these steps:
- Sign in to Genesys Cloud.
- Go to Admin > Message > Messenger Configurations.
-
Click the Appearance tab and complete the following information:
-
Under Select your Supported Languages, click the Select language(s) list and choose the languages that you want to support in the Messenger interface.
Note
The same language should be configured in the Kore Agent AI bot.
-
Under Select Default Language, click the Select language list and choose the default language.
-
Adjust the other settings according to your preferences.
- Click the Apps tab and complete the following steps:
-
Under Clear Conversation, turn on the toggle button. This is required for the Agent AI Conversation Summary feature to work.
-
Adjust the other settings according to your preferences.
- Click Save New Version to create a new version.
Create Messenger Deployment¶
To deploy the Messenger snippet to your website, follow these steps:
- Sign in to Genesys Cloud.
- Go to Admin > Message > Messenger Deployments.
-
Under Select your Configuration, click **Select Configuration **to select a version of a Messenger configuration created in the previous step to assign to this deployment.
- In the Assignment pane, navigate to the Messenger configuration you want to assign to the configuration, and click the name of the Messenger configuration.
- Select the version that you want to assign.
- Click Save.
- Under Restrict domain access, determine whether to allow all domains or restrict the domains on which you want to deploy the snippet.
- To allow all domains, select the Allow all domains option. Use this option for testing and development purposes.
- To restrict domains, enter a domain and click Add Domain. You can add multiple domains to the list. Restrict domains to prevent unauthorized usage of your snippet from unknown domains. If you restrict a domain, Messenger does not run on that website and rejects API requests from that domain.
- Under Select your Architect Flow, select the inbound message flow created in the previous steps.
- Click Save. The Messenger Deployments page now displays the snippet and the deployment key.
-
Copy the Messenger snippet and deploy the Messenger snippet to your website.
- If you are building a custom Messenger, copy the deployment key.
Note
Once the above mentioned website page loads, the messenger window appears.
(Optional) Install Audiohook for Voice Streaming¶
The final step is to install Audiohook for voice streaming, if using Kore-managed Transcriptions.
- Sign in to Genesys Cloud.
- Go to Admin> Integrations > Integrations.
-
Enter “audiohook” in the search bar.
Audiohook integration requires specific configuration values to support Agent AI configuration. 4. Install a new audiohook app by clicking the Integrations button on the top-right corner.
-
Open the Audiohook, and go to the Configuration tab.
- Channel value should be both.
- The Connection URI format should be similar to \ wss://{Kore Voice Gateway(KVG)}/audiosocket/genesys/?sipuri=xxx&token=xxx&botId=xxx&accountId=xxx&agentassist=true, but add “multiBot=true” parameter to it.
Notes
- Configure SIP of any of the bots inserted in the Data Table.
- Kore Voice Gateway(KVG) host name to be referred from corresponding environment being used at Saas or on-prem
-
Get sipuri=sip:<sip-string> from Agent AI > Flows & Channels > Voice Gateway > SIP Numbers > Configure SIP Trunk > Product Selection > Agent AI.
-
Use the following reference from Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details page to fetch Bot ID, Account ID, Client ID, and Client Secret (for token generation).
Follow the steps of Using XO Platform APIs – Kore.ai Documentation to generate the token (token= <token>.)
- Add credentials in the Credentials tab.
-
Use the ClientID and ClientSecret of the bot you have used while configuring the Audiohook. These credentials are used to validate the audiostream signature by Kore.
-
Click Save.
Create/Update Architect Inbound Call Flow in Genesys for the Agent Queue¶
When a call comes to a Genesys number, it passes through an architect flow. If you do not have an ACD architect flow for the queue, create one by following this section.
Steps to create a call architect flow¶
- Sign in to Genesys Cloud.
-
Click Create Flow. The final architect flow looks like the following screenshot:
Notes
- Inside the Transfer to ACD node, select the queue name where you want to transfer the call.
- The Transcription node is optional, if you have already enabled Voice Transcription and Audio Monitoring in the queue level voice configuration.
- Architect flow is required as a mandatory step, as it directs the incoming call to the Genesys agent desktop.
Access Custom Data and Secure Custom Data in Agent AI Bot¶
Custom Data and Secure Custom Data can be accessed in Welcome Events in Agent AI configuration page and in Dialog Tasks in Agent AI automation page.
Custom Data can be accessed as {{context.session.UserContext.customData.internalMetaData.<key>}}.
Follow this doc for the detailed steps on how to access Custom Data.
Secure Custom Data can be accessed as {{context.session.UserContext.secureCustomData.<key>}}.
Follow the same steps of this doc for the detailed information on how to access Secure Custom Data, with the exception of the path being {{context.session.UserContext.secureCustomData.<key>}}.
Note
If a URL-encoded JSON is provided in the “x_passthru_metadata”, you must use the JavaScript option in the Message node. Then, parse the value of context.session.UserContext.customData.internalMetaData before accessing its content.
Example:
var cd = JSON.parse(context.sessiinternalMetaDataon.UserContext.customData.internalMetaData);
print(cd.<key>);
Post Installation Setup¶
Steps to start a Chat Request Simulation¶
-
Sign in to Genesys Developer Applications.
Note
To start chat simulation, you must have access to the Genesys Developer portal (an account with Genesys).
-
Click Web Messenger, select the Deployments, and then click Start Chat to initiate the chat request.
-
Enter a message on the Message Us window, and then click the Send icon.
-
Turn on the On Queue toggle on the top-right corner of the page.
- A new chat notification appears on the Genesys Agent Desktop. Accept the conversation by clicking the Answer button on the left panel.
- Select the Interaction Widget icon to view the Agent AI widget.
Steps to start a Voice Request Simulation¶
-
In Call Routing, assign the Architect flow created in Step-4 to a Genesys Phone Number.
-
Initiate a call using this Genesys Phone Number.
- A new call notification appears on the Genesys Agent Desktop. Accept the conversation by clicking the Answer button on the left panel.
- Select the Interaction Widget icon to view the Agent AI widget.
Set default contextual panel to Kore Agent AI Interaction Widget¶
To streamline call handling and improve efficiency, the Agent AI widget can now be embedded as the primary contextual panel interaction widget.
To enable this:
- Sign in to Genesys Cloud.
- Click Admin.
- Click Panel Manager under the Contact Center section. This opens the Default Contextual Panel.
- Select the interaction widget name in both Voice and Web Messaging field dropdown lists (refer to step-4 of Create an Interaction Widget in Genesys for Agent AI).
- Click Save.
Also, for backward compatibility of the feature, add an additional query param(defaultwidget=true) to the Kore Interaction Widget URL.
Example: https://platform.kore.ai/koreaiaa-genesys/?conversationid={{gcConversationId}}&lang={{gcLangTag}}&environment={{gcHostOrigin}}&genesysid=<genesys-oauth-Id>&defaultwidget=true
Note
Reload the Genesys Agent Desktop before testing this latest change.
Support for Agent Transfer¶
The Agent AI widget supports both Cold and Warm Transfers:
- Cold Transfer: A cold transfer occurs when one agent hands over a conversation to another, applicable across Voice, Chat, and Email channels. A new conversation summary is generated for the receiving agent and added to Agent-1’s Assist tab, along with feedback options. Agent-2 can modify the summary feedback for Voice and Email channels.
- Warm Transfer: A warm transfer is like a conference call between two agents, applicable to Voice and Chat channels. During the transfer, Agent-2 can modify the Summary Feedback. However, the Run, Override, Send, Copy, Terminate, Restart, and List View buttons remain disabled until Agent-1 disconnects from the call.