Skip to content

New pattern submission - bedrock-semantic-cache-s3vectors-sam #3263

Description

@manishh-13

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:

#3262

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions