Integrate Amazon Kendra with Amazon Bedrock

Amazon S3 → Amazon Kendra → Create index → Invoke Bedrock → Generate response

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 crawls and indexes the content. InvokeBedrockLambda 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 an Amazon S3 data source and InvokeBedrockLambda retrieves the index documents.
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 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/lambda-kendra-bedrock

Deploy

sam deploy --guided --capabilities CAPABILITY_NAMED_IAM


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Kruthi Jayasimha Rao

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