
Prerequisites
- Access to Amazon Lex.
- Access to AWS Lambda.
Generic endpoint settings
Override snapshot connections
If you activate the Override Snapshot Connections toggle, the endpoint overrides the connections in the snapshot with connections from the project. If only the snapshot has a connection, the connection isn’t overridden. If necessary, you need to update such connections manually. To override the connection of the agent in production, you can:- Make the necessary changes in a staging environment, create a snapshot of the same agent, and select the snapshot in the endpoint settings. Deactivate the Override Snapshot Connections toggle.
- Import connections from another agent using a package. Activate the Override Snapshot Connections toggle.
Mocking
In the Advanced Settings section, you can toggle on the Enable Mocking setting to activate mocking for the endpoint. Mocking lets you change node behaviors and test how they perform through the endpoint without changing the original node settings. Make sure that you also activate mocking at the node level.Additional endpoint settings
You can use the following additional settings to customize the endpoint:Endpoint-specific settings
How to set up
Configure in Cognigy
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 NLU model to process Amazon Lex slots.
Configure in Amazon
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.
- 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.mjsfile:In the script, replace theCOGNIGY_ENDPOINT_HOSTNAMEandCOGNIGY_ENDPOINT_PATHvariables with your Endpoint hostname and the URL token of your Endpoint. For example, if your Cognigy 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:ListIntentsandlex:ListSlots. Alternatively, you can also use a predefined role such asAmazonLexReadOnly. 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 its latest version and save changes.
Use Amazon Lex with Cognigy NLU
Use Amazon Lex with Cognigy NLU
Use the Amazon Lex Endpoint to transcribe user input, while Cognigy’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.mjsfile:In the script, replace theCOGNIGY_ENDPOINT_HOSTNAMEandCOGNIGY_ENDPOINT_PATHvariables with your Endpoint hostname and the URL token of your Endpoint. For example, if your Cognigy 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 its latest version and save changes.