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

# Getting Started with Agent Copilot for Chat

In this guide, you will learn how to configure your first embedded Agent Copilot workspace for the chat AI Agent. This configuration provides an Agent Copilot workspace that includes two widgets that suggest next actions to the human agent.

## Prerequisites

* Configure a contact center platform that you can integrate with a [handover provider](/ai/escalate/handover-reference/overview). For example, for [Live Agent](/ai/escalate/handover-reference/live-agent), you need to have an [Inbox](/live-agent/settings/inboxes) with the [Project ID and the Webhook URL set up](/live-agent/settings/inboxes#edit-inboxes) and, if necessary, the **Enable AI Copilot Workspace** option activated.
* Add a [compatible LLM](/ai/agents/develop/gen-ai-and-llms/model-support-by-feature) for the LLM Prompt and Copilot: Sentiment Tile Nodes and configure the LLM in the [Generative AI settings](/ai/agents/develop/gen-ai-and-llms/generative-ai).

## Setup Process

The setup process includes the following steps:

1. Create a handover provider. The handover provider connects the AI Agent and Agent Copilot to your contact center.
2. Create a Handover Flow. The Handover Flow controls the interaction with the AI Agent and the handover to a human agent.
3. Create an Agent Copilot Flow. The Agent Copilot Flow controls the Agent Copilot workspace and the individual widgets in it.
4. Test the Agent Copilot workspace through a Webchat v3 Endpoint.

## Set Up Agent Copilot for Chat

<Steps>
  <Step title="Create a Handover Provider">
    In **Deploy > Handover Providers**, create a [Handover Provider](/ai/escalate/handovers) according to your contact center platform.
  </Step>

  <Step title="Create a Handover Flow">
    1. In **Build > Flows**, create a [Flow](/ai/agents/develop/projects-and-flows/overview) and give it a clear name, for example, `Handover`.
    2. In the Flow editor, add a [Say Node](/ai/agents/develop/node-reference/basic/say) and set its **Text** parameter to `Hi, let's hand you over to the human agents.`.
    3. Add a [Handover to Human Agent Node](/ai/agents/develop/node-reference/service/handover-to-agent) and configure as follows:
       * **Handover Provider** — set to the previously [created Handover Provider](#create-a-handover-provider), and [configure it accordingly](/ai/escalate/handover-reference/overview). For example, if you use [Live Agent](/ai/escalate/handover-reference/live-agent), you need to set the **Live Agent Inbox ID**.
       * **Handover Accepted Message** — enter `Transferring to human agents...`.
  </Step>

  <Step title="Create an Agent Copilot Flow">
    1. In **Build > Flows**, create a Flow and give it a clear name, for example, `Agent Copilot`.
    2. Add a [Copilot: Set Grid Node](/ai/agents/develop/node-reference/agent-copilot/set-grid) and configure the grid as follows:

    ```json theme={null}
    {
      "grid": {
        "columns": 2,
        "rows": 2,
        "gap": 5
      },
      "tiles": {
        "next-best-action": {
          "x": 1,
          "y": 1,
          "rows": 1,
          "columns": 1
        },
        "sentiment": {
          "x": 2,
          "y": 1,
          "rows": 1,
          "columns": 1
        }
      }
    }
    ```

    3. After the Copilot: Set Grid Node, add an [LLM Prompt Node](/ai/agents/develop/node-reference/service/llm-prompt). Configure it to generate the next best response for the agent based on the user's latest input and to store the result in the Input object:

    * **System Prompt** — enter the following:

    ```txt theme={null}
    Based on the user's last message, suggest the most helpful next response for a human agent.
    ```

    * In the **Storage & Streaming** section, configure the following:
      * **How to handle the result** — set to **Store in Input**.
      * **Input Key to store Result** — set to `input.promptResult`.

    4. Add the following Agent Copilot Nodes after the LLM Prompt Node and configure them as follows:
       * **[Copilot: Next Action Tile Node](/ai/agents/develop/node-reference/agent-copilot/next-action-tile)**:
         * **Tile ID** — `next-best-action`
         * **Text**:
         ```txt theme={null}
         {{input.promptResult.detailedResult.choices[0].message.content}}
         ```
         This expression dynamically retrieves the LLM-generated suggestion for the tile.
         * *(Optional)* In the **Settings** section, set **Label** to `Next Best Action`.
       * **[Copilot: Sentiment Tile Node](/ai/agents/develop/node-reference/agent-copilot/sentiment-tile)**:
         * **Tile ID** — `sentiment`.
         * *(Optional)* In the **Settings** section, set **Label** to `Customer Sentiment`.
  </Step>

  <Step title="Test Agent Copilot">
    To test Agent Copilot, create a Webchat v3 Endpoint:

    1. In **Deploy > Endpoints**, create a [Webchat v3 Endpoint](/webchat/v3/configuration)
    2. In the Endpoint settings, configure the following:
       * Set **Flow** to the previously created Handover Flow, for example, `Handover`.
       * In the **Copilot** section, set **Copilot Flow** to the previously created Agent Copilot Flow, for example, `Agent Copilot`.
    3. Click **Save** to activate the **Open Demo Webchat** button.

    Then, to simulate a user interaction and test Agent Copilot, follow these steps:

    1. In the Webchat v3 Endpoint settings you created, click **Open Demo Webchat** in the upper-right corner. Demo Webchat opens.
    2. Click **Start conversation** and send the AI Agent a message, for example, `Hello, I need help with my order`. You should receive a message with the text you set in the Say Node followed by the text from the Handover to Human Agent Node.
           <Note>
             At the start of a conversation, the `Initial message for AI Copilot` reply may appear in the human agent's chat as if it were sent by the end user. This reply is added automatically to trigger Agent Copilot and is visible only to the human agent.
           </Note>
    3. Go to your contact center platform and search for the session with the message you sent. The Agent Copilot workspace displays two widgets that suggest next actions.
  </Step>
</Steps>

## More Information

* [Agent Copilot](/agent-copilot/overview)
* [Agent Copilot Nodes](/ai/agents/develop/node-reference/agent-copilot/overview)
* [Agent Copilot for Voice](/agent-copilot/getting-started/voice)
