Yes, you can run semantic search without a separate vector database. DynamoDB offers native vector indexes, so you store embeddings next to your operational items and query them with the SearchVectors operation. The architecture is straightforward. Two details decide whether it works well for you: how you read the scores, which depends on the distance function configured on the index, and how you provision the index, because the CDK path for DynamoDB vector indexes still needs verification before you ship it. This guide covers both, along with the point where OpenSearch Serverless becomes the better choice.
How the pieces fit together
The pattern separates three jobs: preparing content, storing vectors beside your data, and running similarity queries. In practice the flow looks like this:
As an Amazon Associate I earn from qualifying purchases.
- Define the searchable unit. Decide what one item is (a support article, a product description, a chat memory, a document chunk) and which fields you need to return with each match. Those returned fields are the ones you will project into the index later.
- Generate embeddings. Send the text to an embedding model. AWS documentation names Amazon Bedrock and other model providers as possible sources of foundation models. It does not recommend a specific embedding model, and no quality, latency, or cost figure for a particular model is established in the sources this guide relies on, so test candidates against your own content.
- Choose the dimension count. Pick the smallest dimension count that still meets your relevance needs. Storage grows with dimensions (see the storage section below).
- Write items with vector attributes. Store each item in the DynamoDB table with its embedding attribute, plus any partition-key attribute you plan to scope searches by.
- Create the vector index on the table and wait until it reports
ACTIVE. Searches against an index that is not active do not run. - Embed the query with the same model you used for the items, then call
SearchVectorswith the table name, the index name, the search vector, and a top-k count. - Hydrate the results. Use the returned items to show results. If a field you need is not projected into the index, fetch it from the base table by key.
Because the vectors live in the same table as your operational data, there is no separate replication pipeline to run for this pattern. Your application writes once, and the index reflects items that carry valid vector attributes.
Reading SearchVectors results correctly
The AWS CLI reference describes SearchVectors as a similarity search against a vector index on a DynamoDB table. It returns the most similar items sorted by a similarity score, and the meaning of that score depends on the distance function configured for the index. The request includes the table, the index, a search vector, and the number of results to return (top-k).
#1 Best Overall
The most common mistake is assuming a higher score always means a closer match. It does not. The direction depends on the metric:
| Distance function | Which results are returned | How to read the score |
|---|---|---|
| Cosine | The k smallest scores | Lower is closer. Scores range from 0 (identical) to 2 (opposite). |
| Euclidean | The k smallest scores | Lower is closer. |
| Dot product | The k highest scores | Higher is closer. |
Sort your display logic from the index configuration, not from a general rule. If you change the distance function, your ranking thresholds must change with it.
Index storage and design choices
Vector-index storage is separate from base-table storage, and your design choices change the size of that index. AWS documentation identifies three levers.
Free tools Windows power users keep installed
One-click scans. No signup required.
Dimensions
The vector portion of the index stores 32-bit floating-point values, so vector storage grows with the number of dimensions. AWS gives one comparison in its storage guidance: a 1,536-dimension vector uses roughly four times the vector storage of a 384-dimension vector. That is an illustration of how dimensions scale, not an estimate of your bill. The guidance page does not state a publication year for this example, so confirm the current figure in the storage documentation before you size a production index.
Projections
Projected attributes add storage on top of the vectors. The projection type you choose sets how much of each item is copied into the index:
| Projection type | What is copied into the index | Storage impact |
|---|---|---|
| KEYS_ONLY | Key attributes only | Lowest |
| INCLUDE | Keys plus the non-key attributes you specify | Depends on the attributes listed |
| ALL | Every attribute on the item | Highest |
AWS recommends projecting only the attributes your code reads directly from search results. Everything else should come from the base table by key.
Rank #4
Which items enter the index
Only items with valid vector attributes are replicated to the vector index. If the index defines a partition-key attribute, items must also carry that attribute. An item missing either one is absent from search results, with no error on the write. This is the most common cause of “my new items don’t show up,” so check it first (see the checklist below).
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesPartition scoping for tenants, users, and sessions
AWS describes DynamoDB vector search for retrieval-augmented generation (RAG) and agent memory, and it supports partition scoping by a tenant, user, or session key. Scoping keeps one customer’s memories or documents out of another customer’s results, and it reduces the candidate set that each query considers. Design the partition key before you create the index, because it determines which items are eligible.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Provisioning with AWS CDK: what is verified
AWS CDK defines your infrastructure in code and provisions the supported AWS resources it describes. For this architecture, the verified and unverified parts are different, so keep them separate in your project:
- Verified: The AWS CDK v2 API reference includes an L1
CfnCollectionconstruct for Amazon OpenSearch Serverless collections, with a vector option in its properties. Provisioning an OpenSearch Serverless collection also requires an encryption policy, as the CDK PythonCfnCollectionreference notes. - Not established: A definitive CDK resource schema for creating a DynamoDB vector index. Do not copy CDK code for the DynamoDB index from an unverified source. Confirm the resource type and property names in the current CDK API reference, then check the matching CloudFormation resource definition before you deploy.
- Not established: The IAM permissions needed to create the index and call
SearchVectors. Grant the minimum set that the current DynamoDB API documentation lists for those actions, then test with a non-production role.
Until the DynamoDB index resource is confirmed, you can still create the table and its data-writing logic in CDK, then create the vector index through the supported path that your account and Region expose. Record the index name in your stack outputs so application code can reference it.
DynamoDB vector search or OpenSearch Serverless
The choice comes down to what the query has to do beyond similarity. The table below compares the two options on the axes that the documentation actually distinguishes. It does not declare a winner, and it does not replace a workload test.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall| Requirement | DynamoDB native vector index | OpenSearch Serverless |
|---|---|---|
| Semantic similarity over data already in DynamoDB | Designed for this case, with vectors stored beside operational items | Supported, but requires a separate collection and a way to keep it in sync |
| Full-text or hybrid ranking | Not described as a capability in the sources reviewed | AWS points to OpenSearch integration for full-text, analytics, and hybrid search |
| Filtering, aggregations, geospatial or nested queries | Not described as a capability in the sources reviewed | Documented |
| Distance metrics | Cosine, Euclidean, and dot product, as configured on the index | Euclidean, cosine, and dot product |
| Replication pipeline | None needed for the vector pattern | DynamoDB-to-OpenSearch Zero-ETL integration is an option when you need the wider feature set |
| Index storage and service cost | Not established here; check current pricing | Not established here; check current pricing |
Use DynamoDB native vector search when semantic retrieval is the main job, your data already lives in DynamoDB, and you want fewer moving parts. Move to OpenSearch Serverless when users need keyword relevance alongside semantic results, faceted analytics, or the broader query set that OpenSearch provides.
Before you deploy: checks and common failures
- Confirm Region support. Region availability for DynamoDB vector indexes and
SearchVectorswas not established in the sources reviewed for this guide. Check the current AWS Regional services list for your target Region before you design around it. - Index not active. Searches fail or return nothing until the index is
ACTIVE. Poll its status after creation. - Missing vectors in results. Check that the item has a valid vector attribute and the partition-key attribute the index requires.
- Odd ranking. Confirm the distance function on the index, then apply the correct sort direction from the table above.
- Missing fields in results. A field that is not projected will not appear in the search response. Add it to the INCLUDE list, or fetch it from the base table.
- Cost surprises. Storage scales with dimensions and projected attributes. No workload price, latency, recall, or throughput figure is established in the sources, so measure these with your own data and current AWS pricing.
Build the search path against a small dataset first. Check score direction, partition scoping, and projected fields before you scale the index.
Quick Recap
“
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




