aws-samples / aws-samples/serverless-patterns
New pattern submission - bedrock-semantic-cache-s3vectors-sam
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 1.1k
- Avg merge
- 7d 14h
- Merged PRs (30d)
- 6
Description
To submit a template to the Serverless Patterns Collection, per the simplified process all pattern metadata (description, language, level, framework, intro, resources, deploy/test/cleanup, author) is provided in the `example-pattern.json` file included in the PR.
**Pattern:** bedrock-semantic-cache-s3vectors-sam
**Summary:** Serverless semantic cache for Amazon Bedrock using AWS Lambda and Amazon S3 Vectors. Lambda embeds the incoming prompt (Titan Text Embeddings v2), queries an S3 Vectors index by cosine similarity, and returns a cached answer on a semantic hit (threshold + freshness TTL + SSM epoch force-invalidation + negation-parity guard), skipping the Bedrock LLM call. On a miss it calls Bedrock, stores the embedding + answer in vector metadata, and returns the fresh result. Fully serverless (S3 Vectors scales to zero; Lambda is stateless).
**Language:** Python
**Framework:** AWS SAM
**Level:** 300 (Advanced)
## GitHub PR for template:
https://github.com/aws-samples/serverless-patterns/pull/3262
Contributor guide
Research direction
Review pull request #3262 and the included example-pattern.json, which contains the pattern metadata required by the submission process. Check that the Bedrock, Lambda, S3 Vectors, and AWS SAM template details are complete and that the submitted pattern meets the repository’s collection requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100