Developer Docs | Kommunicate

Developer Docs | Kommunicate

  • Book a Demo
  • Try For Free

›AI Agents

Web

  • Installation
  • CMS Installation
  • Authentication
  • Conversation
  • Conversation Assignment
  • Customization
  • Localization
  • Logout
  • Troubleshooting

Android

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Migration
  • Troubleshooting

iOS

  • Installation
  • SwiftUI Setup (Optional)
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Configuration
  • Localization
  • Logout
  • Troubleshooting

React Native

  • Installation
  • Expo Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Logout
  • Troubleshooting

Flutter Mobile

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Troubleshooting

Flutter Web

  • Installation
  • Authentication
  • Conversation

Ionic/Cordova

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Resolving Errors

Ionic/Capacitor

  • Installation
  • Authentication
  • Push notification
  • Customization

Rich Messages

  • How To Use
  • Types of Rich Messages

AI Agents

  • AI Agents Setup
  • Dialogflow Integration
  • Lex Integration
  • Kompose AI Agent Builder
  • IBM Watson Integration
  • Custom AI Agent Integration
  • Import Kompose AI Agent
  • AI Agent Samples

Integrations

  • Zapier
  • WhatsApp
  • WhatsApp 360Dialog
  • WhatsApp Twilio
  • WhatsApp Cloud API
  • Instagram Integration
  • Telegram Integration
  • Sunshine Integration
  • Freshdesk Integration
  • Pipedrive Integration
  • Agile Integration
  • Slack Integration
  • Google Analytics

Platform APIs

  • Authentication
  • Endpoints

Dashboard Features

  • Analytics
  • Conversations
  • Users
  • AI Agent Integration
  • Helpcenter
  • Campaign Messaging
  • Settings

Configuration

  • Single Sign On (SSO) Setup
  • Webhooks
  • Access Token URL
  • Email Fallback

Lex Integration

Overview

Kommunicate provides a codeless integration with Amazon Lex. You can easily integrate an AI agent from AI agent section in the Kommunicate dashboard. In this section, learn how to:

  • Integrate with Lex
  • Handoff the conversation to a human if the AI agent is not able to answer

Integrate with Lex

Kommunicate requires the following information to interact with your AI agent. You can obtain this information from the AWS console.

A. Access Key ID & Secret access key: An access key ID and secret access key are required to sign requests you make using the AWS SDKs. To get your access key sign into your AWS console as a Root or IAM user.

  1. Open the Identity and Access Management (IAM) panel in the same AWS account where the Lex AI agent is present.

  2. Go to “Access management -> Users”. Create a user by clicking the “Add Users” button. Add a user name eg: “Lex-AI agent”.

LexInt1

  1. Set permissions: Choose "Attach Policies Directly"

  2. Select the following two permissions: AmazonLexReadOnly & AmazonLexRunBotsOnly

LexInt2

  1. Keep the "Tags" empty and proceed to Next.

  2. On the next page confirm the attached permissions to the user and click on “Create User”.

  3. Now that your user is created, select the user, and on the next page click on Security Credentials.

LexInt4

  1. Scroll down and click on Create Access Key.

LexInt4

  1. Select Third-Party Service and proceed next to generate the access keys.

LexInt4

A. AI Agent name in Lex platform: Lex requires a name for your AI agent when you create it. Once you create the AI agent, you can also get it from the AI agent list in Lex home page.

B. AI Agent Alias: You create an AI agent alias when you publish the AI agent. It helps you to work with multiple versions of your AI agent. Update the AI agent alias in Kommunicate if you want Kommunicate to connect with a specific version of the AI agent.

C. Region: AWS region where Lex service is running. You can find your region in the top-right corner following the user name in the AWS console.

Once you have the above information follow the below steps to integrate the AI agent with Kommunicate:

  1. Log in to Kommunicate and go to AI agent section.
  2. Click the Integrate AI Agent in the Amazon Lex card.
  3. Fill in the required detail and click next.
  4. Give your AI agent a name. This name will be visible to your users who interact with the AI agent.
  5. Enable/Disable the autoHandoff setting if you want your AI agent to assign the conversation to a human agent in your team when the conversation is hung up by the AI agent.
  6. Click on Let this AI agent handle all new conversations. All new Conversations started after the integration will be assigned to this AI agent and your AI agent will start answering them.

NOTE: Make sure to choose the same language for the AI agent in both Lex and Kommunicate.

LexInt4

LexInt4

Welcome message from AI agent

When a conversation is created and routed through the AI agent, Kommunicate notify the Lex platform so that the AI agent can send the welcome message to your users. Below is the message Kommunicate sends to the Lex - kmConversationStarted

You need to create an intent and add above string to the sample utterance section. Set the welcome message in the response of this intent.

This message is different from the Welcome Message you set in Kommunicate dashboard. If Welcome Message for AI agent and humans (configured from the dashboard) both are enabled, both welcome message will be sent to the users. We recommend disabling the Welcome Message from the dashboard in this case.

Lex-Welcome-Message

AI Agent to human handoff

AI Agent to human handoff allows you to seamlessly switch from an AI agent to a human agent when the AI agent is unable to answer the query on its own. There are two ways to achieve it.

When AI agent is not able to answer

Lex console has a Error handling section to deal with those scenarios where your AI agent is not able to answer. You can set a message in clarification prompt to tell the user that his query did not match any intent. After a certain number of retries if no intent is detected in user's query the AI agent will display a message set in the 'Hang-Up Phrase' section. Kommunicate will automatically detect this message and handoff the conversation to the assigned human agent according to the Conversation Rules you've set up on your dashboard.

The Maximum number of retries before the AI agent hands-off the conversation and the Hang-up phrase can be configured from the AWS Lex dashboard in the Error-Handling section in your AI agent's Editor tab as shown in the picture below.

Lex-Hand-Off

Amazon Lex V2 does not support clarification prompts and hang up phrases (abort statements). Amazon Lex V2 AI agents contain a default fallback intent that is invoked if no intents are matched. To send a clarification prompt with retries, configure a Lambda function and enable the dialog code hook in the fallback intent. The Lambda function can output a clarification prompt as a response and the retry value in a session attribute. If the retry value exceeds the maximum number of retries, you can output a hang up phrase and close the conversation.

When a specific intent is detected

You can configure your AI agent to handover the conversation to human when a specific intent is detected. You have to set the below JSON as the custom markup in the response section.

{
  "platform": "kommunicate",
  "message": "our agents will get back to you",
  "metadata": {
    "KM_ASSIGN_TO": ""
  }
}

if you want to assign the conversation to a specific human agent then pass the agent's login id in KM_ASSIGN_TO parameter.

Using Rich messages

There are two ways you can use rich messages with your Lex AI agent.

Note: You can only use rich messages that are of less than 1000 characters.

Enable cards in response

Lex has the builtin support for the card messages. In the response section of the intent enable the response card setting and enter the required detail. Once intent is saved and the published Kommunicate will render that card in chat widget.

Add Kommunicate rich messages as custom markup

You can use the all type of rich messages provided by Kommunicate with Lex. You can set the respective JSON as the custom html in response section of the intent. Once this is done you need to save and publish the AI agent to see the rich messages in chat widget. rich messages using custom markup

Make the AI agent multilingual

Kommunicate allows you to integrate your multilingual AI agent so that your AI agent can reply in the user's language. You need to pass the user's language tag to Kommunicate.

Language tags follow the HTTP/1.1 specification, section 3.10. Kommunicate will send this information with every message to the integrated AI agent platform. You can use the below method to update the user's language for Lex V2 only.


Kommunicate.updateUserLanguage("en-US");

Call the above method when the Kommunicate SDK is initialized. Refer to "onInit" callback function in installation script.

Send attachments and location to AI agent

To receive the file attachment and location details, you need to create a lambda function which can process the attachments. Create a new intent with kommunicateMediaEvent expression in Sample utterances section and select the AWS Lambda function from the fulfillment.

When a user attaches a file or shares location, Kommunicate sends this information in Request Attribute parameter to your lambda function. You can do the further processing and return confirmation to the user.

This is sample JSON for file attachment:

{
    "attachments": [{
        "payload": {
            "size": "Size in bytes",
            "name": "Name of the file",
            "url": "URL of the file"
        },
        "type": "image/png" // media type (in form of type/subtype) . Use the regex 'type/*' to get the generic type
    }]
}

Sample JSON for the location message

{
    "attachments": [{
        "payload": {
            "lat": "Latitude",
            "lon": "Longitude"
        },
        "type": "location"
    }]
}

← Dialogflow IntegrationKompose AI Agent Builder →
  • Overview
  • Integrate with Lex
  • Welcome message from AI agent
  • AI Agent to human handoff
  • Using Rich messages
  • Make the AI agent multilingual
  • Send attachments and location to AI agent

Ready to automate more than 80% of your customer support?

Try for Free
  • support@kommunicate.io
  • United States
    (+1) (310) 402-2374
  • India
    (+91) 974-057-0196
  • Learn
    • iOS Chatbot
    • Amazon Lex Chatbot
    • Chatbot in Android
    • ChatGPT with Flutter
    • Document to Chatbot
    • React Native Chatbot
    • Create Flutter Chatbot
    • Whatsapp Business API
    • Integrate React Js Chatbot
    • Whatsapp Chatbot Using NodeJs
    • Integrate ChatGPT With Whatsapp
    • Integrate Dialogflow With Whatsapp
    • ChatGPT For Product Engagement
    • Product
    • AI Chatbot Builder
    • Generative AI Chatbot
    • Customer Experience
    • Chatbot Features
    • Dialogflow Integration
    • FAQ Chatbot
    • Live Chat
      Industries
    • Healthcare Chatbot
    • E-commerce Chatbot
    • Education Chatbot
    • Banking Chatbot
  • Integrations
    • E-commerce Chatbot Integration
    • Omnichannel Chatbot
    • Chatbot Integration
    • Chatbot for Website
    • Mobile Apps Chatbot
    • Chatbot for CRM's
    • Automation and Analytics
    • Zendesk Chatbot Integration
  • Resources
    • Chatbots Templates
    • Case Studies
    • Whitepapers
    • Chatbot Guide
    • Videos
    • Knowledge Hub
    • Comparisons
    • ROI Calculator
    • Blogs
    • Company
    • Partner Program
    • Affiliate Program
    • Pricing
    • About Us
    • Media
      Support
    • Contact Us
    • HelpCenter
    • Stack Overflow
    • API Status
  • Comapare
    • Kommunicate Vs Verloop
    • Kommunicate Vs Intercom
    • Kommunicate Vs Yellow
    • Kommunicate Vs Twak
    • Kommunicate Vs Ada
Arabic
Hindi
Spanish
French
German
Portuguese
Urdu
Software Advice Frontrunners for Live Chat Mar-22Software Advice Frontrunners for Live Chat Mar-22crozdesk badgeISO certificationHIPAA complianceGDPR compliant - GDPR Copy 12Created with Sketch.COMPLIANT
Copyright © 2026 Kommunicate.io.
T&C Privacy Policy Career SLA DPA Sitemap