create_knowledge_base¶
Operation¶
create_knowledge_base
async
¶
create_knowledge_base(input: CreateKnowledgeBaseInput, plugins: list[Plugin] | None = None) -> CreateKnowledgeBaseOutput
Creates a knowledge base. A knowledge base contains your data sources so that Large Language Models (LLMs) can use your data. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see Set up a knowledge base.
Note
To create a managed knowledge base, provide a
managedKnowledgeBaseConfiguration during creation. For more
information, see Build a managed knowledge
base.
-
Provide the
nameand an optionaldescription. -
Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the
roleArnfield. -
For managed knowledge bases, set
embeddingModelTypetoMANAGEDto use the service-managed embedding model, orCUSTOMwith anembeddingModelArnto use your own. To use your own KMS key for encryption, provide the ARN inserverSideEncryptionConfiguration. No vector store configuration is required for managed knowledge bases. -
For self-managed knowledge bases, provide the embedding model to use in the
embeddingModelArnfield in theknowledgeBaseConfigurationobject. -
For self-managed knowledge bases, provide the configuration for your vector store in the
storageConfigurationobject. -
For an Amazon OpenSearch Service database, use the
opensearchServerlessConfigurationobject. For more information, see Create a vector store in Amazon OpenSearch Service. -
For an Amazon Aurora database, use the
RdsConfigurationobject. For more information, see Create a vector store in Amazon Aurora. -
For a Pinecone database, use the
pineconeConfigurationobject. For more information, see Create a vector store in Pinecone. -
For a Redis Enterprise Cloud database, use the
redisEnterpriseCloudConfigurationobject. For more information, see Create a vector store in Redis Enterprise Cloud.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateKnowledgeBaseInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
CreateKnowledgeBaseOutput
|
An instance of |
Input¶
CreateKnowledgeBaseInput
dataclass
¶
Dataclass for CreateKnowledgeBaseInput structure.
Attributes¶
client_token
class-attribute
instance-attribute
¶
client_token: str | None = None
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
description
class-attribute
instance-attribute
¶
description: str | None = None
A description of the knowledge base.
knowledge_base_configuration
class-attribute
instance-attribute
¶
knowledge_base_configuration: KnowledgeBaseConfiguration | None = None
Contains details about the embeddings model used for the knowledge base.
role_arn
class-attribute
instance-attribute
¶
role_arn: str | None = None
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.
storage_configuration
class-attribute
instance-attribute
¶
storage_configuration: StorageConfiguration | None = None
Contains details about the configuration of the vector database used for the knowledge base.
tags
class-attribute
instance-attribute
¶
tags: dict[str, str] | None = None
Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.
Output¶
CreateKnowledgeBaseOutput
dataclass
¶
Dataclass for CreateKnowledgeBaseOutput structure.
Attributes¶
knowledge_base
instance-attribute
¶
knowledge_base: KnowledgeBase
Contains details about the knowledge base.