Learn how to integrate GenerativeAgent into Amazon Connect
Detailed Flow
AWS Components
ValkeyElastiCacheSecurityGroup
PullActionLambdaSecurityGroup
PushActionLambdaSecurityGroup
ValkeySubnetGroup
).asapp-generativeagent
), up to 40 characters.cache.t4g.micro
. Adjust sizing based on your expected call volume before production.PRIMARY_VALKEY_HOST
and PRIMARY_VALKEY_PORT
when configuring your Lambda functions.
Node.js 22.x
.For other languages such as Go or Python, contact your ASAPP team.Create the Lambda function
asapp-generativeagent-engage
)Node.js 22.x
.x86_64
.Create and Save ARN
Engage
Lambda function is created, Save the ARN of the Lambda function.You will need this ARN when editing the GenerativeAgent Flow Module JSON in the Create GenerativeAgent Flow Module section.Upload the code
.zip
file containing the Lambda function code.You can find the Lambda function code for Engage in the repository at:input variables
from Amazon Connect to GenerativeAgent, update the attributesToInputVariables.mjs
file in the Engage Lambda function before uploading your Lambda code.Add environment variables
Name | Description | Value |
---|---|---|
ASAPP_API_HOST | Base URL for ASAPP API | https://api.asapp.com |
ASAPP_API_ID | App-Id credential | Provided by ASAPP |
ASAPP_API_SECRET | App-Secret credential | Provided by ASAPP |
contactId
taken from the Event.ContactData
.
PullAction
Lambda function is created, Save the ARN of the Lambda function.You will need this ARN when editing the GenerativeAgent Flow Module JSON in the Create GenerativeAgent Flow Module section.Create the Lambda function
asapp-generativeagent-pullaction
)Node.js 22.x
.x86_64
.Create and Save ARN
PullAction
Lambda function is created, Save the ARN of the Lambda function.You will need this ARN when editing the GenerativeAgent Flow Module JSON in the Create GenerativeAgent Flow Module section.Upload the code
.zip
file containing the Lambda function code.You can find the Lambda function code for PullAction in the repository at:Add environment variables
Name | Description | Value |
---|---|---|
VALKEY_HOST | Hostname of the Valkey Cache (primary node) | [PRIMARY_VALKEY_HOST] |
VALKEY_PORT | Port of the Valkey Cache (primary node) | [PRIMARY_VALKEY_PORT] |
VALKEY_HOST
and VALKEY_HOST
.Be sure to enter only the hostname part for VALKEY_HOST
and only the port number for VALKEY_PORT
.PullAction
to query at the next opportunity.
PushAction
Lambda function is created, Save the ARN of the Lambda function.You will need this ARN when editing the GenerativeAgent Flow Module JSON in the Create GenerativeAgent Flow Module section.Create the Lambda function
asapp-generativeagent-pushaction
)Node.js 22.x
.x86_64
)Create and Save ARN
PushAction
Lambda function is created, Save the ARN of the Lambda function.You will need this ARN when editing the GenerativeAgent Flow Module JSON in the Create GenerativeAgent Flow Module section.Upload the code
.zip
file containing the Lambda function code.You can find the Lambda function code for PushAction in the repository at:Add environment variables
Name | Description | Value |
---|---|---|
VALKEY_HOST | Hostname of the Valkey Cache (primary node) | [PRIMARY_VALKEY_HOST] |
VALKEY_PORT | Port of the Valkey Cache (primary node) | [PRIMARY_VALKEY_PORT] |
VALKEY_HOST
and VALKEY_HOST
.Be sure to enter only the hostname part for VALKEY_HOST
and only the port number for VALKEY_PORT
.Create the IAM role
[asapp-assuming-role-arn]
placeholder with the value provided by ASAPP.If there are multiple ARNs to trust, create multiple statements with unique Sid values and ASAPP provided ARN values in each statement.ASAPPGenerativeAgentRole
).
Review your settings, and click Create role.
Add Kinesis Video Stream access
[customer-account-id]
with your AWS Account number and [kinesis-video-streams-prefix]
with the value saved in the Configure your Amazon Connect instance step.Add Lambda function access
[lambda-pushaction-arn]
placeholder with the ARN of the PushAction
Lambda function.Share the IAM role ARN with ASAPP
PushAction
Lambda function and Kinesis Video Streams..wav
prompt files from the following repository:
Prompt audio files
.wav
file:
.wav
extension:
ASAPPGenerativeAgent.json
flow module json from the repository: ASAPP GenerativeAgent Flow Module.json
file and update the ARNs to reference your own Lambda functions:
Engage
Lambda function with the ARN you created in Step 2: Engage.PullAction
Lambda function with the ARN you created in Step 2: PullAction."Identifier": "Wait1sPrompt"
and, within its "Parameters"
, replace the "PromptId"
string value with your asappSilence1second
prompt ARN."Identifier": "Wait400msPrompt"
and, within its "Parameters"
, replace the "PromptId"
string value with your asappSilence400ms
prompt ARN."Identifier": "PlayBeepBopShort"
and, within its "Parameters"
, replace the "PromptId"
string value with your asappBeepBop
prompt ARN..json
file and click Import.Configure Contact Attributes
Contact Attribute | Required | Description |
---|---|---|
ASAPP_companyMarker | Yes | Your company’s unique identifier in GenerativeAgent |
Custom attributes | No | The additional attributes to pass to GenerativeAgent for the task to enter and additional input variables |
ASAPP_companyMarker
is provided by ASAPP along with your API credentials. Contact your ASAPP team if you need this value.Mapping Custom Attributes
Engage
Lambda function:
attributesToInputVariables.mjs
file in the Engage
Lambda function.
taskName
will be set as the task for GenerativeAgent to enter.
InitialTask
is mapped to taskName
and AccountNumber
is mapped to CustomerAccountNumber
for input variables.Invoke the GenerativeAgent Flow Module
Handle the result
ASAPP_Disposition
contact attribute with one of the following values:transferToAgent
: when the conversation needs to be transferred to an agenttransferToSystem
: when the conversation needs to be transferred to an external systemdisengage
: when the conversation is completederror
: when an error has occurredMap output Variables
transferVariables
from the system transfer from GenerativeAgent for use in your flow.transferVariables
from system transfer are supported.transferVariables
in your flow:ExtractOutputVariables
.
$.External.outputVariables.<variableName>
where <variableName>
is the name of the output variable you want to extract.
CustomerAccountNumber
, the key would be $.External.outputVariables.CustomerAccountNumber
.