create_knowledge_base
¶
create_knowledge_base(
name: Name,
role_arn: KnowledgeBaseRoleArn,
knowledge_base_configuration: KnowledgeBaseConfiguration,
*,
config_overrides: Optional[BedrockAgentClientConfig] = None,
client_token: Optional[ClientToken] = None,
description: Optional[Description] = None,
storage_configuration: Optional[StorageConfiguration] = None,
tags: Optional[TagsMap] = None,
) -> CreateKnowledgeBaseResponse
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.
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:
-
client_token(Optional[ClientToken], default: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.
-
name(Name) –A name for the knowledge base.
-
description(Optional[Description], default:None) –A description of the knowledge base.
-
role_arn(KnowledgeBaseRoleArn) –The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.
-
knowledge_base_configuration(KnowledgeBaseConfiguration) –Contains details about the embeddings model used for the knowledge base.
-
storage_configuration(Optional[StorageConfiguration], default:None) –Contains details about the configuration of the vector database used for the knowledge base.
-
tags(Optional[TagsMap], default:None) –Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–There was a conflict performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent/_services/bedrock_agent.py
4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 | |