Skip to content
v2.274.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

KnowledgeBaseProps Struct Added in v2.274.0-alpha.0 ​

Properties for a knowledge base.

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 ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string#
A description of the knowledge base.

Default: no description

Must be 1-200 characters.

knowledgeBaseNamestringknowledge_base_namestrknowledgeBaseNameStringKnowledgeBaseNamestringKnowledgeBaseName*string#
The name of the knowledge base.

Default: a unique name is generated

Must be 1-100 characters of letters, digits, hyphens and underscores, and must not contain consecutive hyphens or underscores.

roleanyroleanyroleanyRoleanyRoleany#
The service role that Amazon Bedrock assumes to operate the knowledge base.

Default: a new role is created, trusted by bedrock.amazonaws.com and scoped to knowledge bases in this account

The permissions the knowledge base needs to reach its data store and models are granted to this role.

tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string#
Tags to apply to the knowledge base.

Default: no tags

The type of the knowledge base and its type-specific configuration.