Annotation Type DynamoDbVectorAttribute
Marks an attribute as the vector embedding for a named vector index. The annotated getter should return a
List<Float>
representing the vector embedding.
Each vector index requires exactly one attribute annotated with @DynamoDbVectorAttribute. Multiple
vector indexes on the same bean require separate annotated attributes, each with a distinct indexName.
Example usage:
@DynamoDbBean
public class Product {
@DynamoDbVectorAttribute(
indexName = "product-embedding-index",
dimensions = 1536,
distanceFunction = DistanceFunction.COSINE)
public List<Float> productEmbedding() { return productEmbedding; }
}
Vector indexes defined via annotations default to ProjectionType.ALL. For KEYS_ONLY or
INCLUDE projections, use the programmatic CreateTableEnhancedRequest.vectorIndexes() API with explicit
EnhancedVectorIndex definitions.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionintThe number of dimensions in the vector embedding.The distance function used for similarity search on this index.The name of the vector index this embedding attribute belongs to.
-
Element Details
-
indexName
String indexNameThe name of the vector index this embedding attribute belongs to. -
dimensions
int dimensionsThe number of dimensions in the vector embedding. -
distanceFunction
DistanceFunction distanceFunctionThe distance function used for similarity search on this index.
-