> ## 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 Chat Integration with Five9

This document explains how to integrate the Agent AI widget into the Five9 Agent Desktop. The integration supports automation, [Agent Coaching](/ai-for-service/agentai/agent-experience/agent-realtime-coaching#real-time-agent-coaching), [Agent Playbook](/ai-for-service/agentai/agent-experience/playbook#agent-ai-playbook), [Sentiment Analysis](/ai-for-service/agentai/agent-experience#sentiment-analysis), and end-of-call summaries.

## Prerequisites

Administrators with access to a Five9 Admin Console and with privileges to set up the following configurations:

* Five9 Chat enabled for your instance. Contact your Five9 representative.
* Platform administrators with access to [Kore.ai](https://agentassist.kore.ai/) Agent AI instance and familiarity with creating and configuring a Kore AI Agent.
* Kore App credentials such as Account ID. Read [this doc](/ai-for-service/channels/adding-channels-to-your-bot) for a walkthrough.

## Definitions

| **Key**          | **Definition**                                                                                                               | **Reference**                                                                                                                                                                                                             |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agent AI URL     | The domain of the Agent AI.                                                                                                  | - If it's legacy Agent AI, the URL is [Agent AI](https://agentassist.kore.ai).<br /> - If it's AI for Service, the URL is `https://platform.kore.ai`.<br /> - If it's on-prem, the URL is the origin that hosts Agent AI. |
| Connector        | The Five9 Connector displays the Agent AI iframe within the Five9 Agent Desktop.                                             |                                                                                                                                                                                                                           |
| Account ID       | A unique identifier for an account.                                                                                          | Available under **Channels** > **Chat** in the [Agent AI](https://agentassist.kore.ai) configuration portal.                                                                                                              |
| BotLanguageCode  | The language configured in the Kore AI Agent.                                                                                | Refer to the [Supported Languages](/ai-for-service/agentai/agent-experience/supported-languages) document for the language code of all supported languages.                                                               |
| Queue Identifier | A unique identifier in the Data Table used to fetch AI Agent details at run time. It can be a skill name or a campaign name. |                                                                                                                                                                                                                           |

## Configurations on Kore Agent AI

* [Capture Agent AI Bot Mapping for Skills or Campaigns](#capture-agent-ai-bot-mapping-for-skills-or-campaigns)

## Configurations on the Five9 Admin Console

* [Create Connector](#create-connector)
* [Five9 Account Setup for Incoming Chat Requests](#five9-account-setup-for-incoming-chat-requests)

### Capture Agent AI Bot Mapping for Skills or Campaigns

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

For example, if you want Agent AI Bot1 to associate with Skill1 and Agent AI Bot2 with Skill2, you must:

* Create a record in Third-Party Configuration for Agent AI Bot1, setting the Queue Identifier to Skill1.
* Create a record in Third-Party Configuration for Agent AI Bot2, setting the Queue Identifier to Skill2.

This setup ensures the correct Agent AI widget renders for conversations routed based on the defined skill or campaign.

<Note>
  * The system doesn't support Custom Data and Secure for the Five9 Chat integration.
  * You can't map a Skill or a Campaign 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 skill named **Chat\_Skill** that handles incoming chat requests, and you want the Agent AI widget to render for conversations routed to this skill. You must create the following details of the Third-Party Configuration record in your Agent AI account:

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

<img src="https://mintcdn.com/koreai/wBhZm_F3YgBV6Nll/ai-for-service/agentai/integration/five9/images/create-record-add-values.png?fit=max&auto=format&n=wBhZm_F3YgBV6Nll&q=85&s=a33dbd67eb1792dc450bc2d07a4524b5" alt="create-record-add-values" width="638" height="932" data-path="ai-for-service/agentai/integration/five9/images/create-record-add-values.png" />

<Note>The values must be 'Base64' encoded.</Note>

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

<Note>You must turn on the **Third-Party Configuration** setting in **Agent AI** > **Configurations** > **Widget Settings** > **Agent AI Settings** > **Agent AI General Settings**.</Note>

<img src="https://mintcdn.com/koreai/wBhZm_F3YgBV6Nll/ai-for-service/agentai/integration/five9/images/enable-third-party-configuration.png?fit=max&auto=format&n=wBhZm_F3YgBV6Nll&q=85&s=ed0e1196d86ae461dec987c9c39e663b" alt="enable-third-party-configuration" width="1584" height="867" data-path="ai-for-service/agentai/integration/five9/images/enable-third-party-configuration.png" />

## Create Connector

1. Sign in to [Five9 Administrator Console](https://admin.us.five9.net/).

2. Search for **connectors** in the search bar, and select **Connectors**.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/connectors.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=1c49c930cb1757501b21bc3063eaa32f" alt="connectors" width="1850" height="934" data-path="ai-for-service/agentai/integration/five9/images/connectors.png" />

3. Select **Create**.

4. Provide a name in the **Connector Name** field.

5. The URL must be `{Agent AI URL}/integrations/five9/`

6. The method must be GET.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/create-new-connector-get-method.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=a773c0926be0f2c86aa31496e95ee48f" alt="create-new-connector-get-method" width="1848" height="890" data-path="ai-for-service/agentai/integration/five9/images/create-new-connector-get-method.png" />

7. Select **Next**.

8. Select **Field** from the **Add** dropdown list in the **Parameters** section.

9. Select **session\_id**, **domain\_id**, **id**, **skill\_name/campaign\_name** (choose either skill\_name or campaign\_name, depending on which you use to map the bot in Agent AI), and select **Ok**.\\
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/add-field-ok.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=0215ddf6ae05d9114597546c2dc97ac0" alt="add-field-ok" width="1843" height="894" data-path="ai-for-service/agentai/integration/five9/images/add-field-ok.png" />

10. Select the **Edit** symbol next to each parameter and update the values as follows:
    * domain\_id -> Domain ID
    * id -> Agent ID
    * session\_id -> conversationid
    * skill\_name/campaign\_name -> identifiers
      <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/changing-parameters.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=8b1dd2e717f47263cd3b0394e78c7b14" alt="changing-parameters" width="1848" height="893" data-path="ai-for-service/agentai/integration/five9/images/changing-parameters.png" />

11. Select **Constant** from the **Add** dropdown list in the **Parameters** section.
    <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/parameters-add-constant.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=4fdce44fb92a2982dff77073f14fb8f2" alt="parameters-add-constant" width="1848" height="882" data-path="ai-for-service/agentai/integration/five9/images/parameters-add-constant.png" />

12. Enter 'accountid' in the **Name** field and the **accountid** of your Agent AI account in the **Value** field. To find this ID, go to **Agent AI** > **Flows & Channels** > **Channels** > **Digital** > **Web/Mobile Client** > **JWT App Details**. For more details, see this [doc](/ai-for-service/channels/add-web-mobile-client#add-webmobile-client-channel).

13. Select **Ok** > **Next**.

14. The default selection for **Trigger Event** is **Call** and for **On Call Event** is **On Call Accepted**.

15. Select **Chat** for **Trigger Event** — the **On Chat Event** field defaults to **On Chat Arrival**.

16. Select **Done**.
    <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/create-new-connector-done.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=c9269e4628c414a8121da0938e5bd1a2" alt="create-new-connector-done" width="1844" height="888" data-path="ai-for-service/agentai/integration/five9/images/create-new-connector-done.png" />

## Five9 Account Setup for Incoming Chat Requests

* Create a skill and add agents with an active Chat/SMS channel. For more details, see [this doc](https://documentation.five9.com/bundle/admin-console/page/admin-console/skills/_ch-user-skills.htm).
* Create a chat profile by following [this doc](https://documentation.five9.com/bundle/digital-engagement/page/digital-engagement/digital-in-admin-console/digital-components/chat-profiles.htm).
* Create an IVR script by following [this doc](https://documentation.five9.com/bundle/ivr-admin/page/ivr-admin/examples/creating-an-ivr-script.htm).
  <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/ivr-script.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=4438adae3fcc32e39601c3f8fb3af026" alt="ivr-script" width="893" height="477" data-path="ai-for-service/agentai/integration/five9/images/ivr-script.png" />

### Create Inbound Campaign

1. Sign in to [Five9 Admin Console](https://admin.us.five9.net/).

2. Search for campaigns, and select **Campaigns**.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/search-campaigns.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=439afe7930adc02e61c542a833b5b078" alt="search-campaigns" width="1850" height="891" data-path="ai-for-service/agentai/integration/five9/images/search-campaigns.png" />

3. Select **Create**.

4. Select **Inbound** > **Continue**.

5. Enter the following details:
   1. Enter a **campaign name**.

   2. Enter a **campaign description**.

   3. Select **Chat Profile**, then select the chat profile from the previous step or **SystemDefault**.

      <Note>You must have the necessary permissions to view campaign profiles. If you don't, an error message displays.</Note>

   4. **Voice Lines**: Enter the number of lines to dedicate to voice traffic. This value sets the maximum number of phone lines or ports to support the calls for this campaign.

   5. **Text Interactions**: Enter the number of lines to dedicate to text interactions.

      This setting runs IVR scripts for chat or email campaigns, and determines how many IVR sessions can run the IVR script concurrently. For example, if 10 customers are in a chat campaign and you set the number of text channels to 5, only 5 customer interactions use the IVR script. The remaining 5 route to the chat campaign's default skill without any scripting logic.

   6. Enter the **usage threshold percentage** value. This value sets the maximum percentage of lines in use. When usage reaches the threshold, the system sends a notification.

   7. Enter **email addresses for threshold notifications**. Use semicolons to delimit a list.

   8. Enter the number of lines to dedicate to **Visual IVR (VIVR) sessions**. This setting runs an IVR script using a web browser URL, but instead of TTS prompts playing audio (as in a voice call), it displays the actual TTS text. A voice caller and a VIVR caller get the same IVR flow and experience — one uses voice and the other uses a browser screen for online viewing. For more information about VIVR, see the [Interactive Voice Response (IVR)](https://documentation.five9.com/bundle/ivr-admin/page/ivr-admin/landing-ivr-admin.htm) admin guide.

   9. Select **Next**.

6. Leave the **Numbers** section empty, and select **Next**.

7. Select **Default Script**, and select the default IVR script or the IVR script from the previous step.

8. Select **Next**.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/new-campaign-default-script.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=f91bdde8863764f0cca1dba281718327" alt="new-campaign-default-script" width="1847" height="888" data-path="ai-for-service/agentai/integration/five9/images/new-campaign-default-script.png" />

9. Select **Digital Skill**, and select the skill from the previous step or **Default Skill**.

10. Select **Create**.
    <Note>After creating the inbound campaign, start it. Refer to the [Manage Campaigns](https://documentation.five9.com/bundle/admin-console/page/admin-console/campaigns/managing-campaigns.htm) doc for help.</Note>

## Chat Simulation

1. Open [Script Generator](https://app.five9.com/five9_clients/consoles_latest/Generator/index.html).

2. Enter your Five9 account domain name in the **Domain** field and the chat inbound campaign name in the **Profiles** field.

3. Scroll down and select **Preview on Page**.

4. Enter values in the **Name** and **Question** fields.

5. Select **Start Chat**.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/start-chat.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=35628cab5c9f4a517c8b2e25e0d61afc" alt="start-chat" width="1847" height="970" data-path="ai-for-service/agentai/integration/five9/images/start-chat.png" />

6. Open the **Five9 Agent Desktop**, and change the status to **Ready (Text)**.

7. Select the lock symbol to accept the interaction.

8. Once you accept the interaction, the connector opens by default where the Agent AI widget renders.
   <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/agentai-widget.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=0f228c6f08f6783387f37dd6d0816659" alt="agentai-widget" width="1848" height="889" data-path="ai-for-service/agentai/integration/five9/images/agentai-widget.png" />

9. Select **send** to send a message to the customer.

10. Select **copy** to copy the message to the clipboard.

11. When the agent or customer ends the chat, the chat summary displays in the Agent AI widget.
    <img src="https://mintcdn.com/koreai/WpX_vttOthVIy8Vp/ai-for-service/agentai/integration/five9/images/chat-summary.png?fit=max&auto=format&n=WpX_vttOthVIy8Vp&q=85&s=0afac9ca374c25b622523eee81e02da7" alt="chat-summary" width="1848" height="894" data-path="ai-for-service/agentai/integration/five9/images/chat-summary.png" />

## Integration Limitations

* The system doesn't support custom data and secure custom data.
* The system doesn't support internal transfers as the widget doesn't render for other agents joining the conversation, as the Five9 connector isn't available for other agents.
* **Concurrent Chats Limitation**: Agent AI widget receives customer messages or summary events for a chat only when that chat window is active. If the agent switches to a different chat, the widget doesn't process new messages or events from the previous chat.
