> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/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 allows 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's legacy Agent AI, URL is [https://agentassist.kore.ai](https://agentassist.kore.ai)<br />- If it's AI for Service, refer to the [Getting Started](/ai-for-service/getting-started) doc and use an appropriate URL. <br />- If it's on-prem, the URL points to the origin where your Agent AI runs. |
|                                                                                                                                    | Client App                          | To use any Kore AI Agent SDKs, you must create a client app to get the authentication credentials to communicate between the Kore AI Agent and Agent AI.<br />**Note:** The system supports only the default Client App.                                                                                                                                                                             | [adding-the-webmobile-client-channel](/ai-for-service/channels/add-web-mobile-client#add-webmobile-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 the data that Kore Middleware service needs.<br />- `x_passthru_metadata` - Optional, can be JWE/JWT/base64/URL-encoded JSON stored as custom data.                                                                               | `x_metadata` JSON object structure:<br />\{"datatable":\{"name":"\<datatable name>","token":"\<jwt token>","qDelimiter":"\<Paste the special character used in the queue name>"}}                                                                                                                           |
| 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 runs for the AI Agent.                                                                                                                                                                                                                                                                                                                    | Set to `true` to turn on Kore audio processing, or `false` to turn it off.                                                                                                                                                                                                                                  |
| 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 key-value pairs (KVPs) to include 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. You need it to send secure custom data to Agent AI. | **Sample:**<br />`{`<br />"queueName": "participants\[0].queueName,"<br />"callStatus": "participants\[0].calls\[0].state"`}`                                                                                                                                                                               |
| 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 you need it only when the algorithm is RS256 or RS512.<br />(Not supported)                                                                                                                                                                                  |
| Capture AI Agent Information in Kore Data Table                                                                                    | Algorithm                           | Algorithm assigned to the Client App.                                                                                                                                                                                                                                                                                                                                                                | The value must be HS256.                                                                                                                                                                                                                                                                                    |
| Install Audiohook for Voice Streaming                                                                                              | Voice Gateway                       | For the 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](#create%2Fupdate-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](#create%2Fupdate-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 Custom Fields of the Data Table store the configuration data, not the 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 **+ Add**:

4. Enter 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>You must set the **Reference Key** label to `agentAssist`. The Interaction Widget uses this value 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>Don't click on the data table name.</Note>

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

   <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 these conventions in the table for other custom fields. Use the exact names, including upper/lower case.

Get these values 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 custom fields require the string type.
  2. When **is Audiohook Enabled** is set to `false`, the application uses the Genesys native transcription service through 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 in the defined queues.

<Note>
  * The system doesn't support Custom Data.
  * You can't map one queue 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>Encode all values in base64.</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>Verify that **Third Party Configuration** is turned on in **Widget Settings** > **Agent AI General Settings**.</Note>

### Kore Data Table

Data Tables store 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 you use a single AI Agent 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 matches the third-party queue name with the `QueueIdentifier` credential name in its AI Agent credentials to render the appropriate AI Agent.

* The system fetches AI Agent credentials 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 Data Table.
* 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>Don't enter multiple records with different AI Agent credentials in Kore Data Table for a single QueueIdentifier.</Note>

### How to create a new Data Table

1. Sign in to **AI for Service**.

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 include in the Data Table. Click the check 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 contains unique values. (Turn on **is Unique**.)
      * **Column & Sort Order** - List of columns to include in the index; you can select multiple columns and specify the sorting order (ascending or descending) for each column. (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 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.

### 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 **AI for Service**.

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

3. Select the **App** with write access to the Data Table where you want to add information.

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

   <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" />

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

   **API Body Payload Structure**:

   ```json theme={null}
   {
       "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` values must be JSON objects converted to strings.
</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 (Browser)** 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 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. The Genesys Agent Desktop hosts this widget, and it 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.

   <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 that you need to pass custom data to Agent AI.
     * `showWidget`: Determines whether the Agent AI widget appears 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 don't want the widget to appear during these transitions.
     * `sendEventsToVG`: Determines whether the system sends events to VG to pause or resume transcriptions when agents put a call on hold or resume it. This helps reduce Automatic Speech Recognition (ASR) costs by avoiding transcription of hold music from Genesys.
       * Set to `true` to allow the new Audiohook flow for transcriptions, which uses the configurations 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 how you store 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 **AI for Service**.

   2. Click **Data** > **Data Tables**, and copy the Data Table name:

   3. Click **Apps**, and click one of the app names with 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.

   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 following structure, and then convert it into a URL-encoded string:

      ```json theme={null}
      {
       "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 as 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 **KoreAA-Agents** or a similar name to distinguish it.
3. Add any agent to allow them to use the Agent AI functionality. You can use multiple groups.
4. Go back to the **Integrations** section and open the **Interaction Widget** you 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 use 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

along with the basic agent role, add the following role:

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>

   The **Assigned Permissions** view looks like the following image:

   <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" />

6. 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 the system can use 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 these 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. Turn on 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 have an additional **Audio Monitoring** option, separate from **Voice Transcription**. This gives you control over which features you turn on. Audio Monitoring activates in the queue only if your organization activates Audiohook Monitor.

## Chat Setup

### Create/Update Architect Inbound Message Flow in Genesys for the Agent Queue

This step manages incoming messages to the Genesys platform. When you initiate a chat from the [web chat messenger](https://developer.genesys.cloud/devapps/web-chat-messenger), Genesys routes it to this inbound message flow first.

#### 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 **+Add** to create an **Inbound Message Flow**.

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. In [Genesys Cloud](https://apps.mypurecloud.com/), go to **Admin** > **Message** > **Messenger Configurations**.

2. Click **New Configuration**.

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

4. 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>You must configure the same language in **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.

5. Click the **Apps** tab and complete the following steps:
   * Under **Clear Conversation**, turn the toggle on. You need this 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.

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

### Create Messenger Deployment

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

1. In [Genesys Cloud](https://apps.mypurecloud.com/), go to **Admin** > **Message** > **Messenger Deployment**.

2. Click **New Deployment**.

3. Enter a name and description.

4. Under **Select your Configuration**, click **Select Configuration** to select a version of a Messenger configuration you 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**.

5. 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 **Allow all domains**. (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 doesn't run on that website and rejects API requests from that domain.

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

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

8. Copy the Messenger snippet and deploy the Messenger snippet to your website.
   * If you are building a custom Messenger, copy the deployment key.

     <Note>The Messenger window appears after the website page loads.</Note>

## (Optional) Install Audiohook for Voice Streaming

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

1. In [Genesys Cloud](https://apps.mypurecloud.com/), go to **Admin** > **Integrations** > **Integrations**.

2. Enter `audiohook` in the search bar. Audiohook integration requires specific configuration values to support Agent AI configuration.

3. Install a new audiohook app by clicking **Integrations** on the upper-right corner.

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

   1. **Channel** value must be both.
   2. The **Connection URI** format must be similar to `wss://{Voice Gateway}/audiosocket/genesys/?sipuri=xxx&token=xxx&botId=xxx&accountId=xxx&agentassist=true`.

   <Note>
     * Add `multiBot=true` parameter to it to use multiple Agent AI bots with different queues.
     * Configure the SIP of any of the bots inserted in the Data Table.
     * Get the Voice Gateway host name from the corresponding environment you use at SaaS or on-prem.
   </Note>

5. 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 **Copy** next to the **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" />

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

   ```json theme={null}
   {
     "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" />

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

8. Use the **ClientID** and **ClientSecret** of the AI Agent you used while configuring the Audiohook. The system uses these credentials to validate the audio stream signature.

9. Click **Save**.

## Create/Update Architect Inbound Call Flow in Genesys for the Agent Queue

Calls coming to a Genesys number pass through an architect flow. If you don't have an Automatic Call Distribution (ACD) architect flow for the queue, create one by following this section.

#### Steps to create a call architect flow

1. In [Genesys Cloud](https://apps.mypurecloud.com/), go to **Admin** > **Architect** > **Architect**.
2. Click **+Add** to create an **Inbound Call Flow**.
3. 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 to transfer the call.
  * The **Transcription node** is optional, if you have turned on Voice Transcription and Audio Monitoring in the queue-level voice configuration.
  * Architect flow is 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

You can access Custom Data and Secure Custom Data in:

* Welcome Events in the Agent AI configuration page
* Dialog Tasks in the Agent AI automation page

You can access Custom Data as `{{context.session.UserContext.customData.internalMetaData.<key>}}`. Follow [this doc](/ai-for-service/agentai/agent-experience#access-custom-data) for the detailed steps on how to access Custom Data.

You can access Secure Custom Data as `{{context.session.UserContext.secureCustomData.<key>}}`. Follow the same steps of [this doc](/ai-for-service/agentai/agent-experience#access-custom-data) for detailed information on how to access Secure Custom Data,except for 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 upper-right corner of the page. A new chat notification appears on the **Genesys Agent Desktop**.

5. Accept the conversation by clicking **Answer** 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** you created in **[Step-4](#steps-to-create-a-call-architect-flow)** to a Genesys phone number.
2. Initiate a call using this Genesys phone number. A new call notification appears on the Genesys Agent Desktop.
3. Accept the conversation by clicking **Answer** on the left panel.
4. Select the Interaction Widget icon to view the Agent AI widget.
   <img src="https://mintcdn.com/koreai/ZKlmfKEaJgV0R2PE/ai-for-service/agentai/integration/genesys/kore-data-table/call-interaction-details-54.png?fit=max&auto=format&n=ZKlmfKEaJgV0R2PE&q=85&s=0facd4ff3379085f8796b7bd3f07694e" 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, you can embed the Agent AI widget as the primary contextual panel interaction widget.

To enable this:

1. In [Genesys Cloud](https://apps.mypurecloud.com/), click **Admin**.
2. Click **Panel Manager** under the **Contact Center** section. This opens the **Default Contextual Panel**.
3. 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)).
4. 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. The system generates a new conversation summary for the receiving agent and adds it 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 unavailable 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**:

```json theme={null}
    {
        "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 configuration of at least one Dialog Task 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 it 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" />
