New serverless pattern - apigw-http-api-lambda-bedrock-dynamodb-vector-search-cdk - #3275
Draft
proton0210 wants to merge 9 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /documentsfor embedding and storing documents andPOST /searchfor filtered semantic retrieval withSearchVectorstenantId,documentId) so the same document ID can safely exist in different tenantstopKbefore invoking AWS servicesDESTROY, preventing cleanup leftoversWhy this pattern is useful
This pattern gives serverless developers a focused starting point for semantic search while keeping embeddings beside operational data in DynamoDB. It is useful because it:
The collection currently contains an S3 Vectors RAG example but no native DynamoDB vector-search pattern.
Validation
npm run build,npm test, andnpm run synth -- --quietpassedexample-pattern.jsonschema validation passed; its introduction is 354 words and it contains 4 official resourcescf375c1adc3f2a81e9a330163604bdf5bbc92602deployed through the documented interactivenpx cdk deploypath toCREATE_COMPLETEdocumentIdwas stored in a second tenant and its filtered search returned exactly one tenant/category-correct result with zero cross-category matchesERROR,Exception,Request failed, or timeout matchesnpx cdk destroypath removed the stack; the README confirmation returned[], and post-destroy inventory found zero residual tables, Lambda functions, HTTP APIs, IAM roles, or log groups belonging to the patternNotes
npm audit --omit=devcurrently reports one high-severity transitivebrace-expansionadvisory bundled insideaws-cdk-lib@2.263.0; npm cannot replace that bundled dependency automatically, and it is CDK tooling rather than deployed Lambda code.