AgentsforBedrock / Client / get_knowledge_base

get_knowledge_base#

AgentsforBedrock.Client.get_knowledge_base(**kwargs)#

Get an existing knowledge base

See also: AWS API Documentation

Request Syntax

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

knowledgeBaseId (string) –

[REQUIRED]

Identifier for a resource.

Return type:

dict

Returns:

Response Syntax

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

Response Structure

  • (dict) –

    • knowledgeBase (dict) –

      Contains the information of a knowledge base.

      • knowledgeBaseId (string) –

        Identifier for a resource.

      • name (string) –

        Name for a resource.

      • knowledgeBaseArn (string) –

        ARN of a KnowledgeBase

      • description (string) –

        Description of the Resource.

      • roleArn (string) –

        ARN of a IAM role.

      • knowledgeBaseConfiguration (dict) –

        Configures a bedrock knowledge base.

        • type (string) –

          The type of a knowledge base.

        • vectorKnowledgeBaseConfiguration (dict) –

          Configurations for a vector knowledge base.

          • embeddingModelArn (string) –

            Arn of a Bedrock model.

      • storageConfiguration (dict) –

        Configures the physical storage of ingested data in a knowledge base.

        • type (string) –

          The storage type of a knowledge base.

        • opensearchServerlessConfiguration (dict) –

          Contains the configurations to use OpenSearch Serverless to store knowledge base data.

          • collectionArn (string) –

            Arn of an OpenSearch Serverless collection.

          • vectorIndexName (string) –

            Arn of an OpenSearch Serverless index.

          • fieldMapping (dict) –

            A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field names

            • vectorField (string) –

              Name of the field

            • textField (string) –

              Name of the field

            • metadataField (string) –

              Name of the field

        • pineconeConfiguration (dict) –

          Contains the configurations to use Pinecone to store knowledge base data.

          • connectionString (string) –

            Pinecone connection string

          • credentialsSecretArn (string) –

            Arn of a SecretsManager Secret.

          • namespace (string) –

            Pinecone namespace

          • fieldMapping (dict) –

            A mapping of Bedrock Knowledge Base fields to Pinecone field names

            • textField (string) –

              Name of the field

            • metadataField (string) –

              Name of the field

        • redisEnterpriseCloudConfiguration (dict) –

          Contains the configurations to use Redis Enterprise Cloud to store knowledge base data.

          • endpoint (string) –

            Redis enterprise cloud endpoint

          • vectorIndexName (string) –

            Name of a redis enterprise cloud index

          • credentialsSecretArn (string) –

            Arn of a SecretsManager Secret.

          • fieldMapping (dict) –

            A mapping of Bedrock Knowledge Base fields to Redis Cloud field names

            • vectorField (string) –

              Name of the field

            • textField (string) –

              Name of the field

            • metadataField (string) –

              Name of the field

        • rdsConfiguration (dict) –

          Contains the configurations to use RDS to store knowledge base data.

          • resourceArn (string) –

            Arn of a RDS Resource.

          • credentialsSecretArn (string) –

            Arn of a SecretsManager Secret.

          • databaseName (string) –

            Name of the database within RDS

          • tableName (string) –

            Name of the table within RDS

          • fieldMapping (dict) –

            A mapping of Bedrock Knowledge Base fields to RDS column names

            • primaryKeyField (string) –

              Name of the column

            • vectorField (string) –

              Name of the column

            • textField (string) –

              Name of the column

            • metadataField (string) –

              Name of the column

      • status (string) –

        The status of a knowledge base.

      • createdAt (datetime) –

        Time Stamp.

      • updatedAt (datetime) –

        Time Stamp.

      • failureReasons (list) –

        Failure Reasons for Error.

        • (string) –

          Failure Reason for Error.

Exceptions

  • AgentsforBedrock.Client.exceptions.ThrottlingException

  • AgentsforBedrock.Client.exceptions.AccessDeniedException

  • AgentsforBedrock.Client.exceptions.ValidationException

  • AgentsforBedrock.Client.exceptions.InternalServerException

  • AgentsforBedrock.Client.exceptions.ResourceNotFoundException