
Cache Amazon Bedrock answers by meaning: AWS Lambda checks Amazon S3 Vectors for a similar prompt and skips the model on a hit.
{"action":"invalidate"} bumps the epoch in AWS Systems Manager Parameter Store, which turns every earlier entry into a miss.AWS_IAM auth type. Every caller shares one cache, so don't use it for answers that are specific to one user. Amazon Bedrock's native prompt caching matches an exact prompt prefix instead, and the two work together.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/bedrock-semantic-cache-s3vectors/python/samsam deploy --guidedREGION to the Region you deployed to, because every command passes --region $REGION.sam delete --stack-name STACK_NAME --region $REGION. Enter y at each confirmation prompt. This also removes the Amazon S3 Vectors index and vector bucket, the epoch parameter and the log group.aws cloudformation list-stacks --region $REGION --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".aws ssm delete-parameter --name /semantic-cache/api-key --region $REGION, then delete the local response.json written during testing. The shared AWS SAM CLI artifacts bucket is left in place.