
Prerequisites
- Access to Amazon Lex.
- Access to AWS Lambda.
Generic Endpoint Settings
Learn about the generic Endpoint settings on the following pages:Specific Endpoint Settings
Amazon Lex Settings
Amazon Lex Settings
Parameter | Description |
---|---|
Reparse Alexa Slots | Allows Slots detected by Amazon Lex to be passed to Cognigy.AI and be processed by the Cognigy.AI NLU model. To make this parameter available, select Amazon Lex (Built-in) from the NLU Connector list in the Endpoint settings. |
How to Set Up
Setup on the Cognigy.AI Side
Create an Amazon Lex Endpoint
Create an Amazon Lex Endpoint
- In the left-side menu of your Agent, click Deploy > Endpoints.
- On the Endpoints page, click + New Endpoint.
- In the New Endpoint section, do the following:
- Select the Lex Endpoint type.
- Specify a unique name.
- Select a relevant Flow from the list. Save changes.
- Go to the Configuration Information section and copy the Endpoint URL for later use in Amazon Lex.
- (Optional) In the Amazon Lex Settings section, activate the Reparse Alexa Slots option only if you want the Cognigy.AI NLU model to process Amazon Lex slots.
Setup on the Amazon Side
Select the use case:Use Amazon Lex with Amazon NLU
Use Amazon Lex with Amazon NLU
Use your existing Amazon Lex bots along with their native NLU capabilities to process user input within Cognigy.AI.
- Open the Lambda console.
-
Select Create function. Configure the following settings:
- Function name – enter a name for the function.
- Runtime – select Node.js 22.x.
-
Select Create function. The console creates a Lambda function with a single source file named
index.mjs
. Edit this file in the built-in code editor. Copy the following code and paste it into yourindex.mjs
file:In the script, replace theCOGNIGY_ENDPOINT_HOSTNAME
andCOGNIGY_ENDPOINT_PATH
variables with your Endpoint hostname and the URL token of your Endpoint. For example, if your Cognigy.AI trial Endpoint URL ishttps://endpoint-trial.cognigy.ai/175525264283054b52edb3b9ece270755e46e651ac00015fad9f1175bb47c110
, specify the following values:In the Deploy section, select Deploy to update your function’s code. Then, to run your code, select Create test event in the Test events section. Modify the service that was created for the Lambda function. Add the following permissions:lex:ListIntents
andlex:ListSlots
. Alternatively, you can also use a predefined, role such as `AmazonLexReadOnly. Save the Lambda function. - Open the Amazon Lex console.
- Select Create bot. For the Creation method, select Start with an example. In the Example bots section, select OrderFlowers from the list.
- In the Bot configuration section, give the bot a name and an optional description. The name must be unique in your account.
- Open your first intent. Go to the Fulfillment section and enable Fulfillment Lambda code hook in the Advanced options.
- Click Update Options and Save intent. Open each intent in the current language, including the FallbackIntent, and repeat these steps. Build the language, then repeat these steps for additional languages if required.
- Go to Bot versions and create a new version. Then, go to Aliases and create a new alias and link it to the latest bot’s version. Reopen the alias and click the name of each language that is supported.
- Select the previously created Lambda function with it’s latest version and save changes.
Use Amazon Lex with Cognigy.AI NLU
Use Amazon Lex with Cognigy.AI NLU
Use the Amazon Lex Endpoint to transcribe user input, while Cognigy.AI’s NLU model handles intent recognition and slot parsing.
- Open the Lambda console.
-
Select Create function. Configure the following settings:
- Function name – enter a name for the function.
- Runtime – select Node.js 22.x.
-
Select Create function. The console creates a Lambda function with a single source file named
index.mjs
. Edit this file in the built-in code editor. Copy the following code and paste it into yourindex.mjs
file:In the script, replace theCOGNIGY_ENDPOINT_HOSTNAME
andCOGNIGY_ENDPOINT_PATH
variables with your Endpoint hostname and the URL token of your Endpoint. For example, if your Cognigy.AI trial Endpoint URL ishttps://endpoint-trial.cognigy.ai/175525264283054b52edb3b9ece270755e46e651ac00015fad9f1175bb47c110
, specify the following values:In the Deploy section, select Deploy to update your function’s code. Then, to run your code, select Create test event in the Test events section. - Open the Amazon Lex console.
- Select Create bot. For the Creation method, select Start with an example. In the Example bots section, select OrderFlowers from the list.
- In the Bot configuration section give, the bot a name and an optional description. The name must be unique in your account.
-
Create a single intent with one sample utterance that will never get called, for example,
THIS_WILL_NEVER_BE_CALLED
. Save the intent and open FallbackIntent. - Go to the Fulfillment section and enable Fulfillment Lambda code hook in Advanced options.
- Click Update Options and Save intent. Build the language.
- Go to Bot versions and create a new version. Then, go to Aliases and create a new alias and link it to the latest bot’s version. Reopen the alias and click the name of the primary language.
- Select the previously created Lambda function with it’s latest version and save changes.