Amazon Bedrock AgentCore Memory record streaming to Amazon Kinesis Data Streams

Amazon Bedrock AgentCore Memory → Amazon Kinesis Data Streams → AWS Lambda Record sync → Amazon DynamoDB Memory records

Stream Amazon Bedrock AgentCore Memory long-term records to Amazon Kinesis Data Streams and sync an Amazon DynamoDB table with AWS Lambda, including deletions.

Amazon Bedrock AgentCore Memory extracts long-term records with the built-in semantic and user-preference strategies and publishes a created, updated or deleted event for each record to Amazon Kinesis Data Streams.
An AWS Lambda event source mapping filters on the documented event types and skips the StreamingEnabled validation event.
The AWS Lambda function upserts or deletes an Amazon DynamoDB item keyed by memory record ID, so deletions reach the table even though deleted events carry no actor or namespace. If the function still fails on a record after its retries, the event source mapping sends metadata about the failed batch to an Amazon Simple Queue Service (Amazon SQS) queue.
The stream uses the FULL_CONTENT level, so the extracted memory text, which can include personal information from conversations, is copied into the stream and the Amazon DynamoDB table. Use METADATA_ONLY if you don't need the text.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/agentcore-memory-kinesis/typescript/cdk

Deploy

npm installnpx cdk bootstrap (once per account and Region)npx cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

npx cdk destroy

Created by:

Nithin Chandran R

Nithin Chandran R

Technical Account Manager at AWS