Set up a AI Agents (Cognigy) Text Bot in Virtual Agent Hub

Use this page to connect an AI Agents (Cognigy) text bot to NiCE CXone through Virtual Agent Hub. When you complete this procedure, NiCE CXone routes the customer messages from a digital channel through Studio and Virtual Agent Hub to your AI Agents (Cognigy) bot, and returns the bot's responses to the contact. This integration supports text-based digital channels, including digital chat, WhatsApp, Apple Messages for Business, Facebook Messenger, and SMS Messaging.

This page covers text bot integrations only. Voice bot integrations use a separate SIP backchannel method and require assistance from your NiCE CXone Account Representative. Do not use this procedure to set up a voice bot.

How the Text Bot Integration Works

When a contact sends a message through a digital channel, NiCE CXone routes the interaction to a Studio script. The script uses the TextBotExchange action to forward the message to AI Agents (Cognigy) through Virtual Agent Hub. AI Agents (Cognigy) processes the message, identifies the contact's intent, and returns a response and a control signal. The script then delivers the response to the contact or acts on the control signal.

Message Flow

The following sequence describes the message flow for each turn in a text bot conversation:

  1. The contact sends a message through a digital channel.

  2. The digital channel invokes the AskCaller action to pass the message into the Studio script.

  3. The Studio script forwards the message to the TextBotExchange action.

  4. The TextBotExchange action sends the message to AI Agents (Cognigy) through the Virtual Agent Hub.

  5. AI Agents (Cognigy) processes the message and generates a response.

  6. The Virtual Agent Hub delivers the response and control signal from AI Agents (Cognigy) to the TextBotExchange action.

  7. The TextBotExchange action passes the response and control signal to the Studio script.

  8. The Studio script evaluates the control signal and determines the appropriate branch.

    1. If the conversation continues: The Studio script loops back to the AskCaller action, go to step 9.

    2. If the task is complete or escalation is needed: The Studio script exits the bot loop and continues with the next action in the script.

  9. The AskCaller action delivers the response to the contact through the digital channel and waits for the next message. The flow repeats from step 1.

    This is applicable to the OnPromptAndCollectNextResponse branch only.

Control Signals Returned by AI Agents (Cognigy)

After each turn, AI Agents (Cognigy) returns one of the following control signals to the TextBotExchange action. Your Studio script must handle each signal:

  • PromptAndCollectNextResponse: The conversation should continue. The script loops back to the AskCaller action to wait for the contact's next message.

  • OnReturnControlToScript: The virtual agent has completed its task or determined that a live agent is needed. Control returns to the Studio script. AI Agents (Cognigy) passes escalation data through thecustomPayload, and the Studio script reads it to determine the next routing action. The best practice is to use an escalation intent that starts with escalat so the script can reliably detect escalation across different bot intent names, such as, "escalate" or "escalation".

  • OnError: An unexpected error occurred. The script takes the error-handling path. Check the _ERR variable and errorDetailsVarName output property for details.

Prerequisites

Verify that all prerequisites are met before you start this procedure. Missing prerequisites are the most common cause of integration failures.

NiCE CXone Requirements

  • Virtual Agent Hub enabled for your business unit or tenant. Contact your TAM if Virtual Agent Hub is not available in your system.

  • AI Agents (Cognigy) must be enabled for your NiCE CXone tenant. This application is enabled by a TAM or Professional Services. If you do not see the AI Agents (Cognigy) option in the application menu, verify that the appropriate roles and permissions are assigned. If the required permissions are not available, your organization is not configured to use AI Agents (Cognigy); in this case, contact your TAM.

  • AI Agents (Cognigy) application enabled for your NiCE CXone tenant. A TAM or Professional Services must enable this application. If you do not see the AI Agents (Cognigy) option in the application menu, go to Roles & Permissions section and ensure appropriate permissions. If you do not see the permissions for AI Agents (Cognigy) then your organization is not configured to use the AI Agents (Cognigy) application, in that case contact your TAM.

  • View, Create, and Edit Scripts - required to create and modify Studio scripts.

  • A configured digital channel in CXone Digital Experience (DX). Supported text-based digital channels, including digital chat, WhatsApp, Apple Messages for Business, Facebook Messenger, and SMS Messaging.

  • A Studio script configured for a digital media type (or permission to create one). Voice script types do not support the TextBotExchange action.

AI Agents (Cognigy) Requirements

  • A AI Agents (Cognigy) project with a Flow that is fully configured, trained, and ready for deployment. The best practice is for the Flow to include responses for at least the welcome intent and a timeout intent.

  • Edit permission in NiCE CXone for AI Agents (Cognigy) (maps to Admin role in AI Agents (Cognigy)), or sufficient AI Agents (Cognigy) permissions to create and manage Endpoints.

  • An understanding of the AI Agents (Cognigy) project name and the Flow you want to use.

Configure the AI Agents (Cognigy) Text Bot Integration

Complete the following tasks in order. Each task depends on the results of the previous task.

  1. Retrieve Endpoint Credentials from AI Agents (Cognigy)

  2. Add a Configuration in Virtual Agent Hub

  3. Create or Open the Studio Script for the Digital Channels

  4. Configure the TextBotExchangeaction

  5. Assign the Virtual Agent Hub Configuration to the TextBotExchangeaction

  6. Configure Outcome Branches in the Studio Script

  7. Save, Validate, and Publish the Studio Script

  8. Test the Text Bot Integration