Experimental
@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
OpenSearchServerlessVectorStoreProps Struct Added in v2.274.0-alpha.0
Properties for an Amazon OpenSearch Serverless vector store.
The collection and its vector index must already exist. Amazon Bedrock validates at creation time that the index exists in the collection and that its vector field matches the embeddings model. Specify the field names exactly as they are defined in the index.
Example
ts
declare const collection: opensearchserverless.ICollectionRef;
const knowledgeBase = new bedrock.KnowledgeBase(this, 'KnowledgeBase', {
type: bedrock.KnowledgeBaseType.vector({
embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V2_1024,
vectorStore: bedrock.VectorStore.openSearchServerless({
collection,
vectorIndexName: 'bedrock-knowledge-base-default-index',
vectorField: 'bedrock-knowledge-base-default-vector',
textField: 'AMAZON_BEDROCK_TEXT_CHUNK',
metadataField: 'AMAZON_BEDROCK_METADATA',
}),
}),
});
Properties
collectionICollectionRefcollectionICollectionRefcollectionICollectionRefCollectionICollectionRefCollectionICollectionRefrequired#The OpenSearch Serverless collection that contains the vector index.
metadataFieldstringmetadata_fieldstrmetadataFieldStringMetadataFieldstringMetadataField*stringrequired#The name of the index field that stores the metadata of each chunk.
The name of the index field that stores the raw text of each chunk.
The name of the index field that stores the vector embeddings.
vectorIndexNamestringvector_index_namestrvectorIndexNameStringVectorIndexNamestringVectorIndexName*stringrequired#The name of the vector index in the collection.