
Amazon DynamoDB Native Vector Search: Building Real-Time AI Applications Without a Separate Vector Database
Explore how DynamoDB’s native vector search combines operational data and embeddings in one serverless database, simplifying AI agent memory, semantic search, RAG and recommendation architectures.
Amazon DynamoDB Native Vector Search: Building Real-Time AI Applications Without a Separate Vector Database
AWS has announced the general availability of native vector search in Amazon DynamoDB.
Developers can now store vector embeddings alongside operational data and perform similarity searches directly in DynamoDB. For applications already built on DynamoDB, this can remove the need to copy data into a separate vector database and maintain a synchronization pipeline.
According to AWS, DynamoDB vector search provides single-digit millisecond latency with more than 99% recall and is designed to scale to trillions of vectors.
Let’s examine what this capability offers, how it changes existing architectures and where it fits best.
What is vector search?
Traditional database queries search for exact values or defined ranges.
For example:
- Find the product with ID
P1001
- Find orders where the status is
DELIVERED
- Find products in the
Footwearcategory
Vector search works differently. It searches for items that are conceptually similar.
An embedding model converts text, images, audio or other content into a numerical vector. Content with a similar meaning produces vectors located close together within the embedding space.
A customer could therefore search for:
Lightweight shoes suitable for running during summer
Even if a product description does not contain those exact words, vector search can retrieve products with a similar meaning.
What has changed in DynamoDB?
Previously, an application using DynamoDB might need the following architecture:
- Store operational data in DynamoDB.
- Capture changes using DynamoDB Streams.
- Process those changes using Lambda or an ingestion pipeline.
- Copy embeddings and metadata into a vector database.
- Monitor synchronization between both data stores.
- Query the vector database and retrieve additional information from DynamoDB.
This remains a useful design when an application needs advanced search and analytics features. However, it introduces additional infrastructure, data movement and operational complexity.
With native vector search, the architecture can be reduced to:
- Generate an embedding using Amazon Bedrock or another embedding model.
- Store the embedding with the corresponding item in DynamoDB.
- Create a vector index on the embedding attribute.
- Generate an embedding for the user’s query.
- Call the DynamoDB
SearchVectorsAPI.
- Return the most similar results.
The operational record, its metadata and its embedding can now remain together.
How DynamoDB vector indexes work
DynamoDB introduces a dedicated vector index designed for approximate nearest-neighbour searches.
When creating the index, developers configure:
- The attribute containing the vector
- The number of vector dimensions
- The distance function
- An optional vector-index partition key
- Optional inline filter attributes
- The attributes projected into the index
Applications perform searches using the
SearchVectors API. The request contains the query vector, the number of desired results and any applicable search conditions.DynamoDB ranks and returns the most similar items. A single request can return up to 100 results.
Supported similarity functions
DynamoDB supports three distance functions.
Cosine
Cosine distance compares the direction of two vectors while largely ignoring their magnitude.
It is a strong default for:
- Semantic text search
- RAG retrieval
- FAQ matching
- AI agent memory
It is commonly used with text-embedding models such as Amazon Titan Text Embeddings and Cohere Embed.
Dot product
Dot product considers both direction and magnitude.
It can be useful for:
- Recommendation systems
- Popularity-weighted results
- Embedding models that specifically recommend dot product
When vectors are normalized, dot-product ranking behaves similarly to cosine ranking.
Euclidean
Euclidean distance measures the straight-line distance between vectors.
It can be useful for:
- Image similarity
- Audio similarity
- Near-duplicate detection
- Clustering
- Anomaly detection
The distance function cannot be changed after creating the index, so it should be selected according to the embedding model and validated with representative data.
Partitioning and filtering
A vector index can define one partition key.
This is particularly important for large-scale workloads because every vector search can be restricted to a relevant segment of the index.
Possible partition keys include:
- Country
- Marketplace
- Tenant
- Product category
- Data classification
Consider a global product catalogue. Instead of searching every product worldwide, an application could search only the
Canada marketplace.DynamoDB also supports inline filter attributes. These filters are applied during the search instead of filtering the results after retrieval.
For example, an application could search for semantically similar products while filtering by:
- Marketplace =
CA
- Category =
Footwear
- Availability =
InStock
At launch, inline filters support equality conditions. Advanced conditions such as ranges,
IN and BETWEEN are not supported.Example: Serverless semantic product search
Consider an e-commerce platform whose product catalogue is already stored in DynamoDB.
Each item could contain:
-
productId
-
marketplace
-
category
-
name
-
description
-
price
-
descriptionEmbedding
When a product is created or its description changes:
- The application sends the description to an embedding model.
- The model returns an embedding vector.
- The application stores the product and vector in DynamoDB.
- DynamoDB updates the vector index.
When a customer searches for “lightweight running shoes for summer”:
- The application converts the query into an embedding using the same model.
- It calls
SearchVectors.
- The request is scoped to the customer’s marketplace.
- An inline filter restricts results to footwear.
- DynamoDB returns the most semantically similar products.
The application no longer needs to keep the product catalogue synchronized with another vector store.
Important use cases
AI agent memory
An AI agent can store conversation summaries, user preferences, previous actions and their embeddings in DynamoDB.
When a new request arrives, the agent retrieves the most relevant memories instead of loading the complete conversation history.
DynamoDB TTL can also automatically expire short-term memories.
Retrieval-Augmented Generation
Document chunks, metadata and embeddings can be stored in DynamoDB. The application retrieves relevant chunks through vector search and includes them in the prompt sent to a foundation model.
This approach may work well for operational knowledge that changes frequently and already lives in DynamoDB.
Recommendation systems
User, product or content embeddings can be compared to identify similar items and generate personalized recommendations.
Fraud and anomaly detection
A new transaction can be compared with embeddings representing normal or suspicious behaviour. Unusual similarity scores can be incorporated into a larger risk-evaluation workflow.
Semantic application search
Users can search by meaning instead of relying exclusively on exact keywords, product codes or predefined categories.
Architecture with Amazon Bedrock
A serverless generative AI architecture could include:
Write path
Application → Amazon Bedrock embedding model → DynamoDB table and vector index
Retrieval path
User query → API Gateway → Lambda → Bedrock embedding model → DynamoDB
SearchVectors Generation path
Retrieved context → Amazon Bedrock foundation model → Generated response
Services such as AWS Lambda and API Gateway are helpful, but not mandatory. Containers, EC2 applications and other compute environments can call the same Bedrock and DynamoDB APIs.
DynamoDB vector search or OpenSearch?
Native DynamoDB vector search does not eliminate the need for Amazon OpenSearch Service.
DynamoDB is a strong option when:
- Operational data already resides in DynamoDB
- The application needs low-latency similarity search
- A serverless, pay-per-request architecture is preferred
- Developers want to avoid data synchronization
- Queries can be designed around partition keys and equality filters
OpenSearch may remain more appropriate when the workload requires:
- Advanced full-text search
- Keyword and vector hybrid search
- Fuzzy matching
- Faceted navigation
- Complex filtering
- Aggregations and analytics
- Specialized search-ranking controls
The right question is not which service is universally better. It is whether vector search is part of the operational access pattern or part of a broader search and analytics platform.
Design considerations
Before using DynamoDB vector search, consider the following:
- Vector indexes require DynamoDB on-demand capacity mode.
- A table can have up to five vector indexes.
- Vectors can contain up to 4,096 dimensions.
-
SearchVectorsreturns up to 100 results.
- Inline filters currently support equality conditions.
- DAX does not support the
SearchVectorsoperation.
- Index updates and global-table replication are asynchronous.
- Use the same embedding model for stored content and search queries.
- Select a partition key aligned with actual search patterns.
- Project only the attributes needed in search results.
- Evaluate retrieval quality with representative production data.
- Monitor the cost of embedding generation, vector writes, storage and searches.
Availability
DynamoDB vector search is generally available across commercial AWS Regions, including AWS GovCloud (US) Regions.
The feature maintains DynamoDB’s serverless operational model: there are no vector-search servers to provision, software versions to maintain or maintenance windows to schedule.
Final thoughts
This release brings two traditionally separate data access patterns together:
- Key-value access for operational application data
- Similarity search for AI-powered retrieval
For teams already using DynamoDB, native vector search can reduce the number of systems required to build AI agents, semantic search, RAG and recommendation applications.
The biggest benefit may not simply be faster search. It is architectural simplification: fewer data pipelines, fewer copies of operational data and fewer systems to scale and monitor.
DynamoDB is no longer limited to answering, “Which item has this key?”
It can now help answer, “Which items are most similar to what the user actually means?”
References
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article