> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent AI Integration with Genesys Cloud CX

Agent AI integration in Genesys supports multiple bots and queue-based functionality, improving on the earlier single AI Agent and department-specific approach. This enables Genesys Cloud CX to offer a 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.</Note>

## Definitions

| **Section/Group**                                                                                                                  | **Key**                             | **Definition**                                                                                                                                                                                                                                                                                                                                                                                                      | **Reference**                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Generate Oauth ID to enable Kore Services to Connect with Genesys<br />+<br />Create an Interaction Widget in Genesys for Agent AI | Agent AI URL                        | The domain of the Agent AI.                                                                                                                                                                                                                                                                                                                                                                                         | - If it is legacy Agent AI, URL is [https://agentassist.kore.ai](https://agentassist.kore.ai)<br />- If it's AI for Service, URL is `https://platform.kore.ai`<br />- If it's on-prem, the URL is the origin where your Agent AI is hosted. |
|                                                                                                                                    | Client App                          | To use any Kore AI Agent SDKs, a client app must be created to get the authentication credentials to communicate between the Kore AI Agent and Agent AI.<br />**Note:** Only the default Client App is supported.                                                                                                                                                                                                   | [adding-the-webmobile-client-channel](/ai-for-service/channels/add-web-mobile-client#adding-the-web-mobile-client-channel)                                                                                                                  |
| Create an Interaction Widget in Genesys for Agent AI                                                                               | Custom Data / x\_passthru\_metadata | Use this to pass information to Kore AI Agent.                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                             |
| Capture AI Agent Information in Kore Data Table                                                                                    | Secure Custom Data / KvpConfig      | Use this to pass sensitive information to Kore AI Agent.                                                                                                                                                                                                                                                                                                                                                            | [json-web-encryption-jwe](/ai-for-service/sdk/sdk-security#json-web-encryption-jwe)                                                                                                                                                         |
| Create an Interaction Widget in Genesys for Agent AI                                                                               | Interaction Widget                  | The Interaction Widget displays the Agent AI iframe within the Genesys Agent Desktop.                                                                                                                                                                                                                                                                                                                               | [set-up-an-interaction-widget-integration](https://help.mypurecloud.com/articles/set-up-an-interaction-widget-integration)                                                                                                                  |
| Create an Interaction Widget in Genesys for Agent AI                                                                               | Interaction Widget URL params       | - **"multibot=true"** represents usage of new version of Agent AI integration that supports agent specific AI Agent<br />- **"x\_metadata"** - URL-encoded JSON containing data required by Kore Middleware service<br />- **"x\_passthru\_metadata"** - Optional, can be JWE/JWT/base64/URL-encoded JSON stored as custom data                                                                                     | **x\_metadata** JSON object structure:<br />`{`<br />`"datatable":{`<br />`"name":<datatable name>,`<br />`"token":<jwt token>,`<br />`"qDelimiter":<Paste the special character used in the queue name>`<br />`}}`                         |
| Capture AI Agent Information in Kore Data Table                                                                                    | BotId                               | A unique identifier assigned to an AI Agent.                                                                                                                                                                                                                                                                                                                                                                        | Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details                                                                                                                                                                 |
| Capture AI Agent 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 AI Agent 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 AI Agent Information in Kore Data Table                                                                                    | AgentAssistWidgetURL                | URL that points to the Agent AI widget.<br />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 AI Agent Information in Kore Data Table                                                                                    | AudiohookEnabled                    | A setting or flag indicating whether Kore audio processing is enabled for the AI Agent.                                                                                                                                                                                                                                                                                                                             | **true** if Kore audio processing should be enabled, otherwise **false**.                                                                                                                                                                   |
| Capture AI Agent Information in Kore Data Table                                                                                    | QueueIdentifier                     | A unique identifier in the Data Table to fetch AI Agent details at run time.                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                             |
| Capture AI Agent 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). [Genesys API Explorer](https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-conversations--conversationId)<br />**Note:** Optional column. Required when you wish to send secure custom data to Agent AI. | **Sample:**<br />`{`<br />`"queueName": "participants[0].queueName",`<br />`"callStatus": "participants[0].calls[0].state"`<br />`}`                                                                                                        |
| Capture AI Agent 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 AI Agent 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**.<br />(Not supported / Will be supported in future releases)                                                                |
| Capture AI Agent 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`.<br />For on-prem, refer to corresponding host.                                                                                                                                                                                                                                                                                                            |                                                                                                                                                                                                                                             |

## Architecture Diagrams

**Chat**

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/architecture-diagram-chat-1.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=65f0e47f17930ac6bb2d14652879722d" alt="architecture-diagram-chat" width="694" height="813" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/architecture-diagram-chat-1.png" />

**Voice**

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/architecture-diagram-voice-2.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=79628e03d6b43266a5a5055404a37203" alt="architecture-diagram-voice" width="727" height="829" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/architecture-diagram-voice-2.png" />

## Interaction Sequence

<img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/interaction-sequence-3.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=7cdb92f641e10f46646cf648984ca686" alt="interaction-sequence" width="1201" height="481" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/interaction-sequence-3.png" />

This document provides detailed, step-by-step instructions for setting up the integration of the Agent AI widget in the Genesys environment.

## Activities on Platform

* [Capture AI Agent information in Kore Data Table](#capture-ai-agent-information)
* [Access Custom Data and Secure Custom Data in AI Agent](#access-custom-data-and-secure-custom-data-in-ai-agent)

## Activities on Genesys Cloud

* [Generate Oauth ID to enable Kore Services to Connect with Genesys](#generate-oauth-id-to-enable-kore-services-to-connect-with-genesys)
* [Create an Interaction Widget in Genesys for Agent AI](#create-an-interaction-widget-in-genesys-for-agent-ai)
* [Provide Interaction Widget Access to Agents](#provide-interaction-widget-access-to-agents)
* [Create a Queue in Genesys](#create-a-queue-in-genesys)

## Chat Setup

* [Create/Update Architect Inbound Message Flow in Genesys for the Agent Queue](#createupdate-architect-inbound-message-flow-in-genesys-for-the-agent-queue)
* [Create Messenger Configuration](#create-messenger-configuration)
* [Create Messenger Deployment](#create-messenger-deployment)
* [Steps to start a Chat Request Simulation](#steps-to-start-a-chat-request-simulation)

## Voice Setup

* [(Optional) Install Audiohook for Voice Streaming](#optional-install-audiohook-for-voice-streaming)
* [Create/Update an Architect Inbound Call Flow in Genesys for the Agent Queue](#createupdate-architect-inbound-call-flow-in-genesys-for-the-agent-queue)
* [Steps to start a Voice Request Simulation](#steps-to-start-a-voice-request-simulation)

## Prerequisites

* Genesys Administrator with access to a Genesys Cloud account with Admin rights.
* Platform Administrator with access to Agent AI instance.

## Capture AI Agent Information

### Genesys Data Table

This step involves creating a Genesys Data Table with Agent AI bot details.

<Note>The configuration data is stored directly in the Custom Fields of the Data Table, not in a Data Table row. A single Data Table represents a configuration of AgentAssist. The Default Values of the Custom Fields contain the necessary configuration data to load the AgentAssist widget.</Note>

1. Sign in to **Genesys Cloud**.

2. Go to **Admin** > **Architect** > **Data Tables**.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/architect-data-tables.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=531f05b53f241cd2839267f2ebc65240" alt="architect-data-tables" width="1919" height="485" data-path="ai-for-service/agentai/integration/genesys/images/architect-data-tables.png" />

3. Create a new Data Table by clicking the **+ Add** button, as highlighted on the following screenshot:
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/add-data-table.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=5addbff1279ff5a2147f6ddc26d5354c" alt="add-data-table" width="2482" height="1072" data-path="ai-for-service/agentai/integration/genesys/images/add-data-table.png" />

4. Provide a relevant name, such as KoreaiAA-configuration, and then click **Save**.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/create-data-table.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=f83c3a5a49b0633b84e4dc59ac665108" alt="create-data-table" width="1190" height="1092" data-path="ai-for-service/agentai/integration/genesys/images/create-data-table.png" />

   <Note>**Reference Key** label must be set to "agentAssist". This is the value used by the Interaction Widget to load the configuration data.</Note>

   5. Click the 'pencil' icon to edit a data table.

      <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/pencil-icon.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=94f6317ded27fe2a8c0ba52ba51df74d" alt="pencil-icon" width="2065" height="445" data-path="ai-for-service/agentai/integration/genesys/images/pencil-icon.png" />

      <Note>Do not click on the data table name.</Note>

5. Click the **Add Field** button under **Custom Fields** to create five custom fields to provide the AgentAssist configuration. Set the data type for all custom fields as **String** while adding.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/custom-fields-add-field.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=a76c2fa9ab5f603cac5b3104e5865adc" alt="custom-fields-add-field" width="1708" height="896" data-path="ai-for-service/agentai/integration/genesys/images/custom-fields-add-field.png" />

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/add-field-string.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=8181f94fba4afb19bcc3876a15da7bc8" alt="add-field-string" width="695" height="661" data-path="ai-for-service/agentai/integration/genesys/images/add-field-string.png" />

6. Add the custom fields with Bot details.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/bot-details.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=00b784bc1d4e051cb23a29cc7def680b" alt="bot-details" width="387" height="397" data-path="ai-for-service/agentai/integration/genesys/images/bot-details.png" />

7. Follow the below conventions for other custom fields. Use the exact names, including upper/lower case.

These values are found in the **Agent AI** > **Flows & Channels** > **Channels** > **Digital** > **Web/Mobile Client** > **JWT App Details** section.

|                      |                                           |
| -------------------- | ----------------------------------------- |
| **Field Label**      | **Default Value**                         |
| AgentAssist URL      | Agent AI URL                              |
| Bot Id               | `st-8cb94691-xxxx-xxxx-xxxx-xxxxxxxx`     |
| Client Id            | `cs-b60f544d-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
| Client Secret        | \<secret-key from AgentAssist>            |
| is Audiohook Enabled | true / false                              |

<Note>
  1. All the custom fields should be of the **string** type.
  2. If the **is Audiohook Enabled** option is false, the application tries to utilize the Genesys native transcriptions using the Transcriptions API.
</Note>

To change the values, click the gray box surrounding each Custom Field, not directly on the text box.

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/enable-audiohook.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=19439a1a05cf6e73bf09d5250fc2251e" alt="enable-audiohook" width="1291" height="128" data-path="ai-for-service/agentai/integration/genesys/images/enable-audiohook.png" />

### Third-Party Configuration

[Third-Party Configuration](/ai-for-service/agentai/configuration/third-party-configuration) maps Agent AI bots to specific queues. Within this configuration, you can define the bot's language, custom data configuration, or secure custom data configuration.

For example, if you want to associate Agent AI Bot1 with Queue1, and Agent AI Bot2 with Queue2, you need to:

* Create a record in Third Party Configuration for Agent AI Bot1, setting the Queue Identifier as Queue1.
* Create a record in Third Party Configuration for Agent AI Bot2, setting the Queue Identifier as Queue2.

This setup ensures that the correct Agent AI widget renders for conversations routed through the defined queues.

<Note>
  * Custom Data is currently not supported.
  * One queue can not be mapped to multiple Agent AI bots.
</Note>

Refer to [this doc](/ai-for-service/agentai/configuration/third-party-configuration) for instructions on creating records in Third-Party Configuration for an Agent AI Bot.

**Example**:

You have a queue named **Chat\_Skill** that handles incoming chat requests, and you want the Agent AI widget to render to this queue. You must create the following details of the Third-Party Configuration record in your Agent AI account:

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/create-record.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=1e480ef603630e5d3475591a249ec6f7" alt="create-record" width="639" height="933" data-path="ai-for-service/agentai/integration/genesys/images/create-record.png" />

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/add-value.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=9a6695b97b88a368b27914083f4f3ec8" alt="add-value" width="638" height="932" data-path="ai-for-service/agentai/integration/genesys/images/add-value.png" />

<Note>The **Values** should be **base64 encoded**.</Note>

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/third-party-configuration.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=46f465f98c223fe1373365e3db03d6f6" alt="third-party-configuration" width="1602" height="474" data-path="ai-for-service/agentai/integration/genesys/images/third-party-configuration.png" />

<Note>Ensure the **Third Party Configuration** setting is enabled in **Widget Settings** > **Agent AI General Settings**.</Note>

### Kore Data Table

Data Tables store agent queue-specific AI Agent credentials. Each record in the Kore Data Table represents a unique Genesys agent queue and its corresponding AI Agent definitions.

If a single AI Agent 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 AI Agent details.

Kore.ai matches the third-party queue name with the "QueueIdentifier" credential name in its AI Agent credentials to render the appropriate AI Agent.

* AI Agent 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](#create-an-interaction-widget-in-genesys-for-agent-ai) section.

<Note>Multiple records with different AI Agent credentials shouldn't be entered into the Kore Data Table for a single QueueIdentifier.</Note>

### How to create a New Data Table

1. Sign in to Platform.

2. Click **Data** > **Data Tables**.

3. Click **New Table**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/new-table-4.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=2451a5db21fd702b878b2bd0a8a16793" alt="new-table" width="1907" height="628" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/new-table-4.png" />

4. Enter the following details in the **New Table** page:
   1. **Name** of the Data Table (any alphanumeric name).

   2. **Description** of the Data Table.

   3. **Columns** to be included in the Data Table. Click the "tick" mark to add multiple columns.

      <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/multiple-columns-5.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=f7610cd9631079abdf6f331730753b8e" alt="multiple-columns" width="1399" height="430" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/multiple-columns-5.png" />

      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)
      * isAgentAISDK

   4. **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.)
        <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/queue-finder-6.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=a67c6f9ab0660df77b8ec39cfbd87b6c" alt="queue-finder" width="1464" height="410" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/queue-finder-6.png" />

   5. **AI Agent Assignments** (not applicable).

   6. **App Assignments** to let apps access data in this table.
      1. Select any app from the displayed list, or click **Create New App** and enter your app name:
         <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/create-new-app-7.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=dad9aa791424cb371ccfdf5f38b65e8a" alt="create-new-app" width="1233" height="289" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-new-app-7.png" />

      2. 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:</Note>

         <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/apps-new-app-8.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=d3e9ca23b30a4033cb53a61007f4a192" alt="apps-new-app" width="1890" height="651" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/apps-new-app-8.png" />

   7. **Process Assignments** (not applicable).

5. Click **Create** to create the new data table.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/create-new-data-table-9.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=67a0caf5abf571f7e6d95dcc7b0260f0" alt="create-new-data-table" width="1488" height="796" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-new-data-table-9.png" />

### Insert data into Data Table

Set up necessary permissions and app assignments and insert AI Agent-specific data into the Data Table.

1. Sign in to Platform.

2. Click **Data** > **Apps**.

3. Select the **App** with "write" access to the Data Table where you want to add information.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/app-write-access-10.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=e53388aa1ca31b1a105f4e6dc6b11ece" alt="app-write-access" width="1920" height="827" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/app-write-access-10.png" />

4. Copy **Client ID** and **Client Secret** of the App.

5. Create a JWT Token using the **Client ID** and **Client Secret** by following this [doc](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token).

6. Insert the following data into the Data Table by following this [doc](/ai-for-service/apis/automation/data-insert). 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"
       }
   }
   ```

<Note>
  * 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.
</Note>

**Single Queue Example**

<img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/single-queue-example-11.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=bc8dfb769e9dacced3205ee2143fffe3" alt="single-queue-example" width="1420" height="699" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/single-queue-example-11.png" />

**Multiple Queues Example**

<img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/multiple-queues-example-12.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=e20897b7d970c025a07acd1b4c06738a" alt="multiple-queues-example" width="1421" height="713" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/multiple-queues-example-12.png" />

## Generate Oauth ID to enable Kore Services to Connect with Genesys

**Steps to get Genesys OAuth ID**:

1. Sign in to **Genesys Cloud**.
2. Go to **Admin** > **Integrations** > **OAuth**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/single-queue-example-13.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=86a2c47574d6e452b95f097e0b5ff46d" alt="single-queue-example" width="1907" height="847" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/single-queue-example-13.png" />
3. Click **Add Client**.
4. Enter the **app name**, **description**, and **token duration** in the **App Name**, **Description**, and **Token Duration** fields.
5. Select **Token Implicit Grant (br /owser)** in the **Grant Types** section.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/token-implicit-grant-14.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=aef16e480dba505c108241a02c0a3d37" alt="token-implicit-grant" width="1586" height="740" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/token-implicit-grant-14.png" />
6. Add `{Agent AI URL}/koreaiaa-genesys/` in the **Authorized redirect URIs** field.
7. 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

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/authorized-redirect-uris-15.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=964a7b2790e776c5bcd459b99650da73" alt="authorized-redirect-uris" width="1909" height="652" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/authorized-redirect-uris-15.png" />

After saving the configuration, you get the **Client Id** of the created OAuth client. Copy the ID and have it available for [the next step](#create-an-interaction-widget-in-genesys-for-agent-ai).

## 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**:

1. Sign in to **Genesys Cloud**.

2. Click **Admin** > **Integrations**.

3. If you haven't created an Interaction Widget for Agent AI, install a new **Interaction Widget** by clicking the **Integrations** tab on the right side of the page.

   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/genesys-cloud-integrations-16.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=b17ccc57e1722aecfe30d3a1a6a98c29" alt="genesys-cloud-integrations" width="1916" height="839" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/genesys-cloud-integrations-16.png" />

   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-17.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=0eadd85f51f9437cd0e3a5ce7d01544b" alt="interaction-widget" width="1920" height="902" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-17.png" />

4. Name the **Interaction Widget** with a meaningful name, such as KoreaiAA Interaction Widget.

5. Open the **Interaction Widget** by clicking the name.

6. Go to the **Configuration** tab of the Interaction Widget.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-configuration-18.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=af696f82a8f1f9f59295389380113259" alt="interaction-widget-configuration" width="1920" height="902" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-configuration-18.png" />

7. In the **Application URL** field, enter the following structure:

```
{Agent AI URL}/koreaiaa-genesys/?conversationid={{gcConversationId}}&lang={{gcLangTag}}&environment={{gcHostOrigin}}&genesysid=<genesys-oauth-Id>&x_passthru_metadata=<Token>&showWidget=true/false&sendEventsToVG=true/false
```

<Note>
  * x\_passthru\_metadata is an optional query parameter. Required when you wish to pass custom data to Agent AI.
  * showWidget: Determines whether the Agent AI widget should be displayed during agent transitions.
    * Set to **true** to display the widget for Agent 1, if Agent 1 exits and Agent 2 takes over the conversation.
    * Set to **false** if you do not want the widget to be displayed during these transitions.
  * sendEventsToVG: Determines whether events should be sent to KVG to pause or resume transcriptions when a call is placed on hold or resumed. This helps reduce Automatic Speech Recognition (ASR) costs by avoiding transcription of hold music from Genesys.
    * Set to **true** to enable the new Audiohook flow for transcriptions, which uses the configurations provided under the Advanced Settings.
    * Set to **false** to continue using the old Audiohook flow for transcriptions.
</Note>

Add the following parameters to the Application URL based on the approach used for storing bot details.

**Kore Data Table**: **\&multibot=true\&x\_metadata=\<?x=%7B%22datatable%22%xxxxx>**
The "x\_metadata" value equals the URL-encoded string of JSON object.

**Third Party Configuration**: **\&accountId=\<bot-account-id>**
You can fetch the accountId from the **Agent AI > Flows & Channels > Digital > Web/Mobile Client > JWT App Details** page.

The "`x_metadata`" value equals the `URL`-`encoded string` of the JSON object.

1. For the **oauthId** value, use the **OAuth ID** from the [Generate Oauth ID](#generate-oauth-id-to-enable-kore-services-to-connect-with-genesys) section.

2. Build **x\_metadata**:

   1. Sign in to Platform.

   2. Click **Data** > **Data Tables,** and copy the **Data Table** name:
      <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/copy-data-table-name-19.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=05043f3c749cd7bf193017178d3ed8e6" alt="copy-data-table-name" width="1920" height="827" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/copy-data-table-name-19.png" />

   3. Click **Apps**, and click one of the app names that has "read" access:
      <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/click-apps-read-access-20.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=49dd75cfd7f72f37a65a7086c0869823" alt="click-apps-read-access" width="1920" height="827" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/click-apps-read-access-20.png" />

   4. Copy the **Client ID** and **Client Secret** values.
      <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/client-id-client-secret-values-21.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=4abecacc190fb8898f1a6f5673eb20ae" alt="client-id-client-secret-values" width="1920" height="827" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/client-id-client-secret-values-21.png" />

   5. Create a **JWT Token** using the **Client ID** and **Client Secret** by following this [doc](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token).

   6. Generate a **JSON object** with the specified structure, and then convert it into a URL-encoded string:

      ```
      {
                     "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
      ```

      Reference:

      <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/java-script-demo-22.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=8a506ee9432c52fc379c6ffc5c698da7" alt="java-script-demo" width="788" height="371" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/java-script-demo-22.png" />

   7. Copy the URL-encoded string and paste it against the **x\_metadata** value.

3. 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.

1. Use an existing Group, if your agents are already part of it. Otherwise, create a new Group for Agent AI permission.
2. Name the Group as **KoreAA-Agents** or similar to distinguish it.
3. Add any agent to allow them to use the Agent AI functionality. You can utilize more than one Group, if required.
4. Go back to the **Integrations** section and open the **Interaction Widget** created in the [Create an interaction widget](#create-an-interaction-widget-in-genesys-for-agent-ai) section.
5. 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).
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/group-filtering-23.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=95777d8d0afe4a6b4f39a0dce9e9f661" alt="group-filtering" width="2048" height="725" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/group-filtering-23.png" />

### Custom Role/Permission

In addition to the basic agent role, add a new role as given below:

1. Sign in to **Genesys Cloud**.

2. Go to **Admin** > **People & Permissions** > **Roles / Permissions**.

3. Click **Add Role** to create a new role.

4. Give a distinctive name to the role; for example, KoreaiAA Agent.

5. 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.</Note>

6. Once finished, the **Assigned Permissions** view should look like this:
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/assigned-permissions-24.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=a67bdf4977e0932f99d71e07207cf7e2" alt="assigned-permissions" width="1517" height="283" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/assigned-permissions-24.png" />

7. 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

1. Sign in to [Genesys Pure Cloud](https://apps.mypurecloud.com/).

2. Go to **Admin** > **Contact Center** > **Queues**, or enter "queues" in the **search** bar under the **Admin** section and press the **Enter** key.

3. Click **Create Queue**. An empty page to create a new queue appears on the right side of the page.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/create-queue-25.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=6c6b3b2bc136d67ad6bcb22c1b25791b" alt="create-queue" width="1920" height="828" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-queue-25.png" />

4. 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.
     <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/peer-id-26.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=9c35f40b0129897c5280827389dfa7d6" alt="peer-id" width="321" height="693" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/peer-id-26.png" />

5. Click **Save**.

### Enabling the Audio Monitoring toggle

To stream audio to third-party services, follow the below steps:

1. Sign in to [Genesys Pure Cloud](https://apps.mypurecloud.com/).
2. Go to **Admin > Contact Center > Queues**, or enter "queues" in the **search** bar under the **Admin** section and press the **Enter** key.
3. Click the intended queue name.
4. Click the **Voice** tab.
5. Enable the **Audio Monitoring** toggle.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/audio-monitoring-toggle-27.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=2b158e797482ab09013c12291c1e13dc" alt="audio-monitoring-toggle" width="2048" height="1074" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/audio-monitoring-toggle-27.png" />

   **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 manages incoming messages to the Genesys platform. When a chat is initiated from the [web chat messenger](https://developer.genesys.cloud/devapps/web-chat-messenger), it first gets directed to this inbound message flow.

#### Steps to create a chat architect flow

1. Sign in to [Genesys Cloud](https://apps.mypurecloud.com/directory/#/login-oauth).

2. Go to **Admin** > **Architect** > **Architect**.

3. Click the **three dots** next to **Flows: Inbound Call**, and select **Inbound Message**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/inbound-message-28.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=6b5d35ca3f0692918270b6a5d97ac549" alt="inbound-message" width="355" height="819" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/inbound-message-28.png" />

4. Click the **+Add** button to create an **Inbound Message Flow**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/create-inbound-message-flow-29.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=8be8002bdd7f0a5f4187dcd51fe1113f" alt="create-inbound-message-flow" width="624" height="630" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-inbound-message-flow-29.png" />

5. Click **Create Flow**. The final architect flow looks like the following screenshot:
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/create-flow-30.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=6bfb5b2045d5e8bb92e45d9c5df317fa" alt="create-flow" width="1847" height="774" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-flow-30.png" />

6. 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:

1. Sign in to [Genesys Cloud](https://apps.mypurecloud.com/).

2. Go to **Admin** > **Message** > **Messenger Configurations**.

3. Click **New Configuration**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/messenger-new-configuration-31.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=9bf3b226a0a86e679dd309ddb503f8db" alt="messenger-new-configuration" width="747" height="463" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/messenger-new-configuration-31.png" />

4. Enter a name and description.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/messenger-configuration-name-description-32.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=5c0890202511c120ddb8e3aa0d604940" alt="messenger-configuration-name-description" width="1850" height="932" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/messenger-configuration-name-description-32.png" />

5. 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 AI Agent**.</Note>

     <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/select-supported-languages-33.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=6da720aa4b95bb822f80cfe7693ac340" alt="select-supported-languages" width="1848" height="933" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/select-supported-languages-33.png" />

   * Under **Select Default Language**, click the **Select language** list and choose the default language.
     <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/default-language-34.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=a69247ee29145a61a2f802124437b844" alt="default-language" width="1846" height="928" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/default-language-34.png" />

   * Adjust the other settings according to your preferences.

6. 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.
     <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/clear-conversation-toggle-35.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=e1836e3271d3993b5e9a3293fb6a2657" alt="clear-conversation-toggle" width="1847" height="932" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/clear-conversation-toggle-35.png" />

   * Adjust the other settings according to your preferences.

7. Click **Save New Version** to create a new version.

### Create Messenger Deployment

To deploy the Messenger snippet to your website, follow these steps:

1. Sign in to [Genesys Cloud](https://apps.mypurecloud.com/).

2. Go to **Admin** > **Message** > **Messenger Deployment**.

3. Click **New Deployment**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/new-messenger-deployment-36.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=158be998e84f29a6997afa880ec72daa" alt="new-messenger-deployment" width="751" height="457" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/new-messenger-deployment-36.png" />

4. Enter a name and description.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/messenger-deployment-details-37.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=33576aa23a82a2f0fd16aacc66124b0c" alt="messenger-deployment-details" width="1847" height="932" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/messenger-deployment-details-37.png" />

5. 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**.

6. 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.

7. Under **Select your Architect Flow**, select the inbound message flow created in the previous steps.

8. Click **Save.** The **Messenger Deployments** page now displays the snippet and the deployment key.

9. 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.</Note>

     <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/messenger-window-38.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=5eddc39ac73e672330f6b111b6e8b584" alt="messenger-window" width="1848" height="930" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/messenger-window-38.png" />

## (Optional) Install Audiohook for Voice Streaming

Install Audiohook for voice streaming if using Kore-managed Transcriptions.

1. Sign in to **[Genesys Cloud](https://apps.mypurecloud.com/)**.

2. Go to **Admin** > **Integrations** > **Integrations**.

3. Enter "audiohook" in the search bar.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-39.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=5669a0dace1893be1d17774aef3d306a" alt="audiohook" width="1916" height="600" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-39.png" />

   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.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-monitor-40.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=738a64406cc1d26f3e69481807ba4c91" alt="audiohook-monitor" width="1913" height="748" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-monitor-40.png" />

5. Open the **Audiohook**, and go to the **Configuration** tab.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-configuration-41.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=42e4dad717c5c47eef488933ae30abae" alt="audiohook-configuration" width="1905" height="893" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-configuration-41.png" />

   1. **Channel** value should be both.
   2. 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`.

<Note>
  * Add "multiBot=true" parameter to it, if you want to use multiple Agent AI bots with different queues.
  * Configure SIP of any of the bots inserted in the Data Table.
  * Kore Voice Gateway(KVG) host name to be referred from the corresponding environment being used at Saas or on-prem.
</Note>

6. Follow these steps to get the **Connection URL**:
   1. Go to **Agent AI** > **Flows & Channels** > **Voice Gateway** > **SIP Numbers** > **Configure SIP Trunk**.
   2. Select **Agent AI** in the **Product Selection** section.
   3. Select **GENESYS Audiohook** in the **Select the SIP Trunk connection method** dropdown list.
   4. Click the **Copy** button against the autogenerated **Connection URL** field.
      <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/configure-sip-trunk-42.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=2fc337cc7d03e306bbcae7a7f6747bd5" alt="configure-sip-trunk" width="2238" height="1684" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/configure-sip-trunk-42.png" />

7. Add the following details in the **Advanced** tab:

   ```
   {
     "environment": <genesys-environment(For example: mypurecloud.com)>,
     "oauthClientId": <genesys-oauth-id>,
     "koreDomainURL": <Agent AI URL>,
     "oauthClientSecret": <genesys-oauth-secret>,
     "sendEventsToVG": true,
     "botId": <Bot-ClientID>,
     "token": <JWT-token-created-in-previous-step-using-Bot-ClientID-and-ClientSecret>
   }
   ```

   <Note>Create an OAuth using the **Client Credentials** grant type, and use the resulting **Client ID** and **Client Secret** for configuration.</Note>

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/advanced-configurations.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=e157a8760db19427d5e784c1978a8cce" alt="advanced-configurations" width="1819" height="800" data-path="ai-for-service/agentai/integration/genesys/images/advanced-configurations.png" />

8. Add credentials in the **Credentials** tab.

9. Use the **ClientID** and **ClientSecret** of the AI Agent you have used while configuring the Audiohook. These credentials are used to validate the audio stream signature by Kore.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-credentials-44.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=946d03659f6acb3760d679272e79eeee" alt="audiohook-credentials" width="1599" height="747" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/audiohook-credentials-44.png" />

10. 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

1. Sign in to [Genesys Cloud](https://apps.mypurecloud.com/).
2. Go to **Admin** > **Architect** > **Architect**.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/genesys-architect-45.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=66cdd0f4416475229dd9b2ea39b36fe0" alt="genesys-architect" width="1265" height="213" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/genesys-architect-45.png" />
3. Click the **+Add** button to create an **Inbound Call Flow**.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/create-inbound-call-flow-46.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=8595ded3e00f735f309e476eb33048e0" alt="create-inbound-call-flow" width="300" height="236" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-inbound-call-flow-46.png" />
4. Click **Create Flow**. The final architect flow looks like the following screenshot:
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/final-architect-flow-47.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=e2dbfe908add28c11fd953e545b9ee3e" alt="final-architect-flow" width="1630" height="827" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/final-architect-flow-47.png" />

<Note>
  * 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.
</Note>

## Access Custom Data and Secure Custom Data in AI Agent

Custom Data and Secure Custom Data can be accessed in Welcome Events in the Agent AI configuration page and in Dialog Tasks in the Agent AI automation page.

Custom Data can be accessed as `{{context.session.UserContext.customData.internalMetaData.<key>}}`.

Follow [this doc](/ai-for-service/agentai/agent-experience/access-custom-data-in-agent-ai) 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](/ai-for-service/agentai/agent-experience/access-custom-data-in-agent-ai) 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"`, use the JavaScript option in the Message node. Then, parse the value of `context.session.UserContext.customData.internalMetaData` before accessing its content.</Note>

**Example**:

```json theme={null}

var cd = JSON.parse(context.sessiinternalMetaDataon.UserContext.customData.internalMetaData);

print(cd.\<key\>);

```

## Post Installation Setup

### Steps to start a Chat Request Simulation

1. Sign in to [Genesys Developer Applications](https://developer.genesys.cloud/devapps/web-chat-messenger).

   <Note>To start chat simulation, you must have access to the Genesys Developer portal (an account with Genesys).</Note>

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-48.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=5aa4daf4a5a917b9823c18e652d294bf" alt="chat-simulation" width="1913" height="869" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-48.png" />

2. Click **Web Messenger**, select the **Deployments**, and then click **Start Chat** to initiate the chat request.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-web-messenger-49.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=9f1780257035ef33a1549738450dcee0" alt="chat-simulation-web-messenger" width="1670" height="794" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-web-messenger-49.png" />

3. Enter a message on the **Message Us** window, and then click the **Send** icon.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-message-use-50.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=fdbd83d41ab9fb19fcd441026902d88a" alt="chat-simulation-message-use" width="300" height="278" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/chat-simulation-message-use-50.png" />

4. Turn on the **On Queue** toggle on the top-right corner of the page.

5. A new chat notification appears on the **Genesys Agent Desktop**. Accept the conversation by clicking the **Answer** button on the left panel.

6. Select the **Interaction Widget** icon to view the Agent AI widget.
   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-icon-chat-51.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=cd3c3eff890b9bff6197b976d59bbdb5" alt="interaction-widget-icon-chat" width="1920" height="871" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/interaction-widget-icon-chat-51.png" />

### Steps to start a Voice Request Simulation

1. In **Call Routing**, assign the **Architect flow** created in **[Step-4](#steps-to-create-a-call-architect-flow)** to a Genesys Phone Number.

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/create-call-route-53.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=9bad3661f3d02dd6b61b50f971ebdfc2" alt="call-routing" width="1845" height="931" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-call-route-53.png" />

   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/create-call-route-53.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=9bad3661f3d02dd6b61b50f971ebdfc2" alt="create-call-route" width="1845" height="931" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/create-call-route-53.png" />

2. Initiate a call using this Genesys Phone Number.

3. A new call notification appears on the Genesys Agent Desktop. Accept the conversation by clicking the **Answer** button on the left panel.

4. Select the **Interaction Widget** icon to view the Agent AI widget.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/kore-data-table/call-interaction-details-54.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=371731156a8d20edbd7e7b68be43db2e" alt="call-interaction-details" width="1920" height="872" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/call-interaction-details-54.png" />

## Set default contextual panel to Kore Agent AI Interaction Widget

To streamline call handling and improve efficiency, the Agent AI widget can be embedded as the primary contextual panel interaction widget.

To enable this:

1. Sign in to **[Genesys Cloud](https://apps.mypurecloud.com/)**.
2. Click **Admin**.
3. Click **Panel Manager** under the **Contact Center** section. This opens the **Default Contextual Panel**.
4. 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](#create-an-interaction-widget-in-genesys-for-agent-ai)).
5. Click **Save**.

   <img src="https://mintcdn.com/koreai/LoQr0oPdwIVIy42h/ai-for-service/agentai/integration/genesys/kore-data-table/default-contextual-panel-55.png?fit=max&auto=format&n=LoQr0oPdwIVIy42h&q=85&s=27d044a248cecee4f577b1d6baa4c422" alt="default-contextual-panel" width="1828" height="962" data-path="ai-for-service/agentai/integration/genesys/kore-data-table/default-contextual-panel-55.png" />

   <Note>Reload the Genesys Agent Desktop before testing this latest change.</Note>

## 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.

## Switch to Agent AI SDK (Optional)

You can embed the Agent AI widget into the Genesys desktop using the Web SDK. To do this, update the following configurations:

### Kore Data Table Change

1. Go to the **Kore Data Table**.

2. Click on the name of the Data Table.

3. Add a new column to the existing data table as **isAgentAISDK** and data type as **string**.
   <img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/new-column.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=40983d3ee50d73f6c03b036b7d90b6db" alt="new-column" width="1465" height="709" data-path="ai-for-service/agentai/integration/genesys/images/new-column.png" />

4. Click **Create**/**Update** (for existing table configuration).

### Insert/update data into Data Table

For first time users, use the POST API and for existing users, use the PUT API to insert this new field into the Kore Data Table.

**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",
           "isAgentAISDK": "True"
        }
    }
```

## XO 11 Configuration Notes

For the configured App, ensure at least one Dialog Task has been configured for Agent AI use.

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/dialog-settings-page-25.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=15902c93904ecdb46b52f2c719806253" alt="dialog-settings-page" width="1311" height="1668" data-path="ai-for-service/agentai/integration/genesys/images/dialog-settings-page-25.png" />

**Where to find configuration settings**

You can find the necessary information in **Flows & Channels** > **Digital** > **Web/Mobile Client**.

<img src="https://mintcdn.com/koreai/FRsCZP2v9LC4efyX/ai-for-service/agentai/integration/genesys/images/jwt-app-details-26.png?fit=max&auto=format&n=FRsCZP2v9LC4efyX&q=85&s=e51b07edc50976d06262609a958e5420" alt="jwt-app-details" width="1143" height="1174" data-path="ai-for-service/agentai/integration/genesys/images/jwt-app-details-26.png" />
