Configure post-chat AI analysis

To configure post-chat AI analysis, go to System Configurator > System Management > Event-Driven Integrations.

Add an integration with the following details:

  • Channel Type: Chat

  • Endpoint URL:

    Use the URL for your region:

    • Europe: https://cc-workflows-eu-c1.cc.sinch.com/prod/chat-analysis
    • North America: https://cc-workflows-na-w2.cc.sinch.com/prod/chat-analysis
    • Australia: https://cc-workflows-au-s2.cc.sinch.com/prod/chat-analysis
  • Conversation Direction: Inbound, Outbound, or Both

  • Ordinal: Enter an order number for this integration. For more information about this field, see the Event-driven integrations document.

  • Event: Ended

  • Queues: Add the queues where the integration is used

  • JSON for Configuration: This is the format of the JSON definition. For more details on which parts of this you'll need to edit, see below.

    {
      "request": {
        "method": "POST",
        "authentication": {
          "type": "oauth",
          "secrets_ref": "orchestration-layer"
        },
        "headers": {
          "x-cmi-api-key": "{secrets.ri-apikey}",
          "x-cmi-password": "{secrets.cmi-chat-analysis-user}"
        },
        "body": {
          "cmi_url": "https://8h6b51di7x.execute-api.eu-central-1.amazonaws.com/acme/cmi",
          "cmi_user": "analysis.user",
          "contact_id": "{contact.id}",
          "contact_group_id": "{contact.guid}"
        }
      }
    }

The analysis only covers text content, attachments aren't included in the analysis.

By default, the analysis is done to the conversation including all transfers made thus far. If you instead only want to carry out the analysis at the end of the conversation, add this condition to your JSON configuration:

"condition": "event.details != 'forwarded'",

Accessing Contact Management Interface (CMI)

You'll need to access CMI to save the AI analysis.

Edit the following parameters in the JSON request body:

  • cmi_url: Replace the URL (https://8h6b51di7x.execute-api.eu-central-1.amazonaws.com/acme/cmi) with the public address of your Contact Management Interface (CMI)

  • cmi_user: Replace the user (analysis.user) with the logon name of your CMI user that has the settings and rights listed at Prerequisites.

If you didn't use the same names for your secrets as in our example, edit the name in the JSON header:

  • x-cmi-api-key: Replace ri-apikey with the name of the secret added for your CMI's API key in Secrets manager

  • x-cmi-password: Replace cmi-chat-analysis-user with the name of the secret added for your CMI's password in Secrets manager

Customizing the AI analysis

You can customize the AI analysis to suit your needs by specifying the prompt in the customAiInstructions field. This makes it possible, for example, to:

  • Add a new field to the AI analysis called Chat reason and derive the reason from the chat with a short explanatory description.

  • Highlight any billing issues in the summary.

  • Censor personally identifiable information (PII).

To customize the analysis, give your instructions to the AI in the customAiInstructions field:

"customAiInstructions": "Add a new field: Chat reason. It should contain 1-2 sentences on why the customer contacted us."
"customAiInstructions": "Anonymize all sensitive and personally identifiable information (PII) from Summary."

Keep these parts as they are in the example JSON

  • Reference to secret orchestration-layer in the authentication: the secret to access the AI orchestration layer.

  • Parameter contact_id: to identify the conversation leg for the analysis.

  • Parameter contact_group_id: to identify the conversation, including all transfers along the way, for the analysis.