Menu
AWS Architecture Blog·August 21, 2026

Unified AI Agent Architecture with DynamoDB Vector Search

This article presents a unified AI agent architecture leveraging Amazon DynamoDB's native vector search capability to store both operational data and vector embeddings within a single table. This approach simplifies data management, reduces infrastructure complexity, and enhances data consistency for AI-powered applications like knowledge management platforms. The architecture integrates Amazon Bedrock for agent orchestration and AWS Lambda for action groups and embedding generation.

Read original on AWS Architecture Blog

Traditionally, building AI agents on AWS often involved fragmented data architectures where operational data (e.g., document metadata) resided in Amazon DynamoDB, and vector embeddings for semantic search were stored in a separate vector database. This led to increased costs, synchronization challenges, and potential data staleness. The introduction of native vector search in DynamoDB addresses these issues by allowing embeddings to be stored directly alongside operational data.

Architectural Components and Data Flow

The proposed architecture unifies these data types within a single DynamoDB table. Here's a breakdown of the core components and their interactions:

  • Amazon Bedrock Agent: Orchestrates user conversations, selects appropriate tools, and synthesizes responses.
  • Action Group AWS Lambda: Executes semantic search using DynamoDB's `SearchVectors` API for natural language queries and standard CRUD operations for operational lookups against the same DynamoDB table.
  • DynamoDB Table with Vector Index: Stores documents, metadata, and 1,024-dimension embeddings. The vector index partitions search results by a specified attribute (e.g., `category` or `tenant_id`).
  • Embedding Pipeline AWS Lambda: Triggered by DynamoDB Streams, this Lambda automatically generates embeddings for new or modified content using Amazon Titan Text Embeddings V2 and writes them back to the same DynamoDB item, ensuring the vector index is always synchronized.

Key Data Flow Steps

  1. A user submits a natural language query to the Bedrock agent.
  2. The agent invokes the appropriate action group Lambda function.
  3. For semantic search, the Lambda generates a query embedding and calls the DynamoDB `SearchVectors` API.
  4. For new or updated content, DynamoDB Streams triggers the embedding pipeline Lambda.
  5. The embedding pipeline Lambda generates a vector and writes it back to the DynamoDB item, which is then indexed.
💡

Single-Table Design Considerations for Vector Search

When designing your DynamoDB table for vector search, consider using a composite primary key and a `SearchSchema` HASH attribute with moderate cardinality for optimal performance. For multi-tenant systems, `tenant_id` is often a good choice. DynamoDB vector indexes require on-demand capacity mode and support up to five indexes per table with up to 4,096 dimensions each. Remember that `SearchVectors` responses are limited to 16 MB and do not support pagination, so project only necessary attributes and keep `TopK` modest.

bash
aws dynamodb update-table \
 --table-name unified-agent-data \
 --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \
 --attribute-definitions \
 AttributeName=category,AttributeType=S \
 --vector-index-updates \
 '[{"Create": { "IndexName": "content-embedding-index", "VectorAttribute": {"AttributeName": "embedding"}, "Dimensions": 1024, "DistanceFunction": "COSINE", "SearchSchema": [ {"AttributeName": "category", "SearchSchemaElementType": "HASH"} ], "Projection": {"ProjectionType": "INCLUDE", "NonKeyAttributes": ["title", "category"]} }}]'
DynamoDBVector SearchAI AgentsAmazon BedrockAWS LambdaServerlessRAGKnowledge Management

Comments

Loading comments...