Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

AWS Lambda from Amazon Kendra to Amazon Bedrock

Created with SnapAmazon KendraAWS LambdaAmazon Bedrock

AWS Lambda function to retrieve documents from an Amazon Kendra index and pass it to Amazon Bedrock for a generated response.

AWS Lambda: Two AWS Lambda functions are created. DataSourceSync Lambda function crawls and indexes the content. InvokeBedrockLambda AWS Lambda function that invokes the specified model by passing the retrieved content from Amazon Kendra as context to the generative AI model.
Amazon Kendra: An Amazon Kendra index is created with a S3 data source. When a the InvokeBedrockLambda function is called, documents are retrieved from the Amazon Kendra index.
Amazon Bedrock: Documents retrieved from the Amazon Kendra index are sent to Amazon Bedrock which responds with a generated response.

< Back to all patterns


GitHub icon Visit the GitHub repo for this pattern.

Download

git clone https://github.com/aws-samples/serverless-patterns/ cd serverless-patterns/kendra-bedrock-cdk-python

Deploy

cdk deploy BedrockKendraStack --parameters S3DSBucketName=${YourS3BucketName}


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Kruthi Jayasimha Rao

Presented by Kruthi Jayasimha Rao

Kruthi is a Partner Solutions Architect with a focus in Generative AI. She provides technical guidance to AWS Partners in following best practices to build secure, resilient, and highly available solutions in the AWS Cloud.

Follow on LinkedIn