AgentsforBedrock / Client / get_knowledge_base

get_knowledge_base#

AgentsforBedrock.Client.get_knowledge_base(**kwargs)#

Gets information about a knoweldge base.

See also: AWS API Documentation

Request Syntax

response = client.get_knowledge_base(
    knowledgeBaseId='string'
)
Parameters:

knowledgeBaseId (string) –

[REQUIRED]

The unique identifier of the knowledge base for which to get information.

Return type:

dict

Returns:

Response Syntax

{
    'knowledgeBase': {
        'createdAt': datetime(2015, 1, 1),
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseArn': 'string',
        'knowledgeBaseConfiguration': {
            'type': 'VECTOR',
            'vectorKnowledgeBaseConfiguration': {
                'embeddingModelArn': 'string'
            }
        },
        'knowledgeBaseId': 'string',
        'name': 'string',
        'roleArn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED',
        'storageConfiguration': {
            'opensearchServerlessConfiguration': {
                'collectionArn': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'vectorIndexName': 'string'
            },
            'pineconeConfiguration': {
                'connectionString': 'string',
                'credentialsSecretArn': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string'
                },
                'namespace': 'string'
            },
            'rdsConfiguration': {
                'credentialsSecretArn': 'string',
                'databaseName': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'primaryKeyField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'resourceArn': 'string',
                'tableName': 'string'
            },
            'redisEnterpriseCloudConfiguration': {
                'credentialsSecretArn': 'string',
                'endpoint': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'vectorIndexName': 'string'
            },
            'type': 'OPENSEARCH_SERVERLESS'|'PINECONE'|'REDIS_ENTERPRISE_CLOUD'|'RDS'
        },
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • knowledgeBase (dict) –

      Contains details about the knowledge base.

      • createdAt (datetime) –

        The time at which the knowledge base was created.

      • description (string) –

        The description of the knowledge base.

      • failureReasons (list) –

        A list of reasons that the API operation on the knowledge base failed.

        • (string) –

      • knowledgeBaseArn (string) –

        The ARN of the knowledge base.

      • knowledgeBaseConfiguration (dict) –

        Contains details about the embeddings configuration of the knowledge base.

        • type (string) –

          The type of data that the data source is converted into for the knowledge base.

        • vectorKnowledgeBaseConfiguration (dict) –

          Contains details about the embeddings model that’sused to convert the data source.

          • embeddingModelArn (string) –

            The ARN of the model used to create vector embeddings for the knowledge base.

      • knowledgeBaseId (string) –

        The unique identifier of the knowledge base.

      • name (string) –

        The name of the knowledge base.

      • roleArn (string) –

        The ARN of the IAM role with permissions to invoke API operations on the knowledge base. The ARN must begin with AmazonBedrockExecutionRoleForKnowledgeBase_.

      • status (string) –

        The status of the knowledge base. The following statuses are possible:

        • CREATING – The knowledge base is being created.

        • ACTIVE – The knowledge base is ready to be queried.

        • DELETING – The knowledge base is being deleted.

        • UPDATING – The knowledge base is being updated.

        • FAILED – The knowledge base API operation failed.

      • storageConfiguration (dict) –

        Contains details about the storage configuration of the knowledge base.

        • opensearchServerlessConfiguration (dict) –

          Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

          • collectionArn (string) –

            The ARN of the OpenSearch Service vector store.

          • fieldMapping (dict) –

            Contains the names of the fields to which to map information about the vector store.

            • metadataField (string) –

              The name of the field in which Amazon Bedrock stores metadata about the vector store.

            • textField (string) –

              The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • vectorField (string) –

              The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

          • vectorIndexName (string) –

            The name of the vector store.

        • pineconeConfiguration (dict) –

          Contains the storage configuration of the knowledge base in Pinecone.

          • connectionString (string) –

            The endpoint URL for your index management page.

          • credentialsSecretArn (string) –

            The ARN of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

          • fieldMapping (dict) –

            Contains the names of the fields to which to map information about the vector store.

            • metadataField (string) –

              The name of the field in which Amazon Bedrock stores metadata about the vector store.

            • textField (string) –

              The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • namespace (string) –

            The namespace to be used to write new data to your database.

        • rdsConfiguration (dict) –

          Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

          • credentialsSecretArn (string) –

            The ARN of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

          • databaseName (string) –

            The name of your Amazon RDS database.

          • fieldMapping (dict) –

            Contains the names of the fields to which to map information about the vector store.

            • metadataField (string) –

              The name of the field in which Amazon Bedrock stores metadata about the vector store.

            • primaryKeyField (string) –

              The name of the field in which Amazon Bedrock stores the ID for each entry.

            • textField (string) –

              The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • vectorField (string) –

              The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

          • resourceArn (string) –

            The ARN of the vector store.

          • tableName (string) –

            The name of the table in the database.

        • redisEnterpriseCloudConfiguration (dict) –

          Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

          • credentialsSecretArn (string) –

            The ARN of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

          • endpoint (string) –

            The endpoint URL of the Redis Enterprise Cloud database.

          • fieldMapping (dict) –

            Contains the names of the fields to which to map information about the vector store.

            • metadataField (string) –

              The name of the field in which Amazon Bedrock stores metadata about the vector store.

            • textField (string) –

              The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • vectorField (string) –

              The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

          • vectorIndexName (string) –

            The name of the vector index.

        • type (string) –

          The vector store service in which the knowledge base is stored.

      • updatedAt (datetime) –

        The time at which the knowledge base was last updated.

Exceptions

  • AgentsforBedrock.Client.exceptions.ThrottlingException

  • AgentsforBedrock.Client.exceptions.AccessDeniedException

  • AgentsforBedrock.Client.exceptions.ValidationException

  • AgentsforBedrock.Client.exceptions.InternalServerException

  • AgentsforBedrock.Client.exceptions.ResourceNotFoundException