Agents for Amazon Bedrock

2024/04/23 - Agents for Amazon Bedrock - 10 updated api methods

Changes  This release introduces Model Evaluation and Guardrails for Amazon Bedrock.

CreateDataSource (updated) Link ¶
Changes (request, response)
Request
{'dataDeletionPolicy': 'RETAIN | DELETE',
 'dataSourceConfiguration': {'s3Configuration': {'bucketOwnerAccountId': 'string'}}}
Response
{'dataSource': {'dataDeletionPolicy': 'RETAIN | DELETE',
                'dataSourceConfiguration': {'s3Configuration': {'bucketOwnerAccountId': 'string'}},
                'failureReasons': ['string'],
                'status': {'DELETE_UNSUCCESSFUL'}}}

Sets up a data source to be added to a knowledge base.

Warning

You can't change the chunkingConfiguration after you create the data source.

See also: AWS API Documentation

Request Syntax

client.create_data_source(
    clientToken='string',
    dataDeletionPolicy='RETAIN'|'DELETE',
    dataSourceConfiguration={
        's3Configuration': {
            'bucketArn': 'string',
            'bucketOwnerAccountId': 'string',
            'inclusionPrefixes': [
                'string',
            ]
        },
        'type': 'S3'
    },
    description='string',
    knowledgeBaseId='string',
    name='string',
    serverSideEncryptionConfiguration={
        'kmsKeyArn': 'string'
    },
    vectorIngestionConfiguration={
        'chunkingConfiguration': {
            'chunkingStrategy': 'FIXED_SIZE'|'NONE',
            'fixedSizeChunkingConfiguration': {
                'maxTokens': 123,
                'overlapPercentage': 123
            }
        }
    }
)
type clientToken

string

param clientToken

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.

This field is autopopulated if not provided.

type dataDeletionPolicy

string

param dataDeletionPolicy

The deletion policy for the requested data source

type dataSourceConfiguration

dict

param dataSourceConfiguration

[REQUIRED]

Contains metadata about where the data source is stored.

  • s3Configuration (dict) --

    Contains details about the configuration of the S3 object containing the data source.

    • bucketArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the bucket that contains the data source.

    • bucketOwnerAccountId (string) --

      The account ID for the owner of the S3 bucket.

    • inclusionPrefixes (list) --

      A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

      • (string) --

  • type (string) -- [REQUIRED]

    The type of storage for the data source.

type description

string

param description

A description of the data source.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base to which to add the data source.

type name

string

param name

[REQUIRED]

The name of the data source.

type serverSideEncryptionConfiguration

dict

param serverSideEncryptionConfiguration

Contains details about the server-side encryption for the data source.

  • kmsKeyArn (string) --

    The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

type vectorIngestionConfiguration

dict

param vectorIngestionConfiguration

Contains details about how to ingest the documents in the data source.

  • chunkingConfiguration (dict) --

    Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

    • chunkingStrategy (string) -- [REQUIRED]

      Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

      • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration .

      • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

    • fixedSizeChunkingConfiguration (dict) --

      Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE , exclude this field.

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens to include in a chunk.

      • overlapPercentage (integer) -- [REQUIRED]

        The percentage of overlap between adjacent chunks of a data source.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'type': 'S3'
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        Contains details about how the data source is stored.

        • s3Configuration (dict) --

          Contains details about the configuration of the S3 object containing the data source.

          • bucketArn (string) --

            The Amazon Resource Name (ARN) of the bucket that contains the data source.

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

            A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

            • (string) --

        • type (string) --

          The type of storage for the data source.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

        The details of the failure reasons related to the data source.

        • (string) --

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source belongs.

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        Contains details about the configuration of the server-side encryption.

        • kmsKeyArn (string) --

          The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

      • status (string) --

        The status of the data source. The following statuses are possible:

        • Available – The data source has been created and is ready for ingestion into the knowledge base.

        • Deleting – The data source is being deleted.

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

        Contains details about how to ingest the documents in the data source.

        • chunkingConfiguration (dict) --

          Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

          • chunkingStrategy (string) --

            Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

            • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration .

            • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          • fixedSizeChunkingConfiguration (dict) --

            Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE , exclude this field.

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

              The percentage of overlap between adjacent chunks of a data source.

CreateKnowledgeBase (updated) Link ¶
Changes (response)
{'knowledgeBase': {'status': {'DELETE_UNSUCCESSFUL'}}}

Creates a knowledge base that contains data sources from which information can be queried and used by LLMs. 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 your data for ingestion.

Note

If you prefer to let Amazon Bedrock create and manage a vector store for you in Amazon OpenSearch Service, use the console. For more information, see Create a knowledge base.

  • Provide the name and an optional description .

  • Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the roleArn field.

  • Provide the embedding model to use in the embeddingModelArn field in the knowledgeBaseConfiguration object.

  • Provide the configuration for your vector store in the storageConfiguration object.

See also: AWS API Documentation

Request Syntax

client.create_knowledge_base(
    clientToken='string',
    description='string',
    knowledgeBaseConfiguration={
        'type': 'VECTOR',
        'vectorKnowledgeBaseConfiguration': {
            'embeddingModelArn': 'string'
        }
    },
    name='string',
    roleArn='string',
    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'
    },
    tags={
        'string': 'string'
    }
)
type clientToken

string

param clientToken

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.

This field is autopopulated if not provided.

type description

string

param description

A description of the knowledge base.

type knowledgeBaseConfiguration

dict

param knowledgeBaseConfiguration

[REQUIRED]

Contains details about the embeddings model used for the knowledge base.

  • type (string) -- [REQUIRED]

    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) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

type name

string

param name

[REQUIRED]

A name for the knowledge base.

type roleArn

string

param roleArn

[REQUIRED]

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

type storageConfiguration

dict

param storageConfiguration

[REQUIRED]

Contains details about the configuration of the vector database used for the knowledge base.

  • opensearchServerlessConfiguration (dict) --

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

    • collectionArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • vectorIndexName (string) -- [REQUIRED]

      The name of the vector store.

  • pineconeConfiguration (dict) --

    Contains the storage configuration of the knowledge base in Pinecone.

    • connectionString (string) -- [REQUIRED]

      The endpoint URL for your index management page.

    • credentialsSecretArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • databaseName (string) -- [REQUIRED]

      The name of your Amazon RDS database.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • primaryKeyField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • resourceArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the vector store.

    • tableName (string) -- [REQUIRED]

      The name of the table in the database.

  • redisEnterpriseCloudConfiguration (dict) --

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

    • credentialsSecretArn (string) -- [REQUIRED]

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

    • endpoint (string) -- [REQUIRED]

      The endpoint URL of the Redis Enterprise Cloud database.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • vectorIndexName (string) -- [REQUIRED]

      The name of the vector index.

  • type (string) -- [REQUIRED]

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

type tags

dict

param tags

Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.

  • (string) --

    • (string) --

rtype

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'|'DELETE_UNSUCCESSFUL',
        '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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

      • 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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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.

DeleteDataSource (updated) Link ¶
Changes (response)
{'status': {'DELETE_UNSUCCESSFUL'}}

Deletes a data source from a knowledge base.

See also: AWS API Documentation

Request Syntax

client.delete_data_source(
    dataSourceId='string',
    knowledgeBaseId='string'
)
type dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source to delete.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base from which to delete the data source.

rtype

dict

returns

Response Syntax

{
    'dataSourceId': 'string',
    'knowledgeBaseId': 'string',
    'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL'
}

Response Structure

  • (dict) --

    • dataSourceId (string) --

      The unique identifier of the data source that was deleted.

    • knowledgeBaseId (string) --

      The unique identifier of the knowledge base to which the data source that was deleted belonged.

    • status (string) --

      The status of the data source.

DeleteKnowledgeBase (updated) Link ¶
Changes (response)
{'status': {'DELETE_UNSUCCESSFUL'}}

Deletes a knowledge base. Before deleting a knowledge base, you should disassociate the knowledge base from any agents that it is associated with by making a DisassociateAgentKnowledgeBase request.

See also: AWS API Documentation

Request Syntax

client.delete_knowledge_base(
    knowledgeBaseId='string'
)
type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base to delete.

rtype

dict

returns

Response Syntax

{
    'knowledgeBaseId': 'string',
    'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED'|'DELETE_UNSUCCESSFUL'
}

Response Structure

  • (dict) --

    • knowledgeBaseId (string) --

      The unique identifier of the knowledge base that was deleted.

    • status (string) --

      The status of the knowledge base and whether it has been successfully deleted.

GetDataSource (updated) Link ¶
Changes (response)
{'dataSource': {'dataDeletionPolicy': 'RETAIN | DELETE',
                'dataSourceConfiguration': {'s3Configuration': {'bucketOwnerAccountId': 'string'}},
                'failureReasons': ['string'],
                'status': {'DELETE_UNSUCCESSFUL'}}}

Gets information about a data source.

See also: AWS API Documentation

Request Syntax

client.get_data_source(
    dataSourceId='string',
    knowledgeBaseId='string'
)
type dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base that the data source was added to.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'type': 'S3'
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        Contains details about how the data source is stored.

        • s3Configuration (dict) --

          Contains details about the configuration of the S3 object containing the data source.

          • bucketArn (string) --

            The Amazon Resource Name (ARN) of the bucket that contains the data source.

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

            A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

            • (string) --

        • type (string) --

          The type of storage for the data source.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

        The details of the failure reasons related to the data source.

        • (string) --

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source belongs.

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        Contains details about the configuration of the server-side encryption.

        • kmsKeyArn (string) --

          The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

      • status (string) --

        The status of the data source. The following statuses are possible:

        • Available – The data source has been created and is ready for ingestion into the knowledge base.

        • Deleting – The data source is being deleted.

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

        Contains details about how to ingest the documents in the data source.

        • chunkingConfiguration (dict) --

          Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

          • chunkingStrategy (string) --

            Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

            • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration .

            • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          • fixedSizeChunkingConfiguration (dict) --

            Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE , exclude this field.

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

              The percentage of overlap between adjacent chunks of a data source.

GetKnowledgeBase (updated) Link ¶
Changes (response)
{'knowledgeBase': {'status': {'DELETE_UNSUCCESSFUL'}}}

Gets information about a knoweldge base.

See also: AWS API Documentation

Request Syntax

client.get_knowledge_base(
    knowledgeBaseId='string'
)
type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

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

rtype

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'|'DELETE_UNSUCCESSFUL',
        '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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

      • 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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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.

ListDataSources (updated) Link ¶
Changes (response)
{'dataSourceSummaries': {'status': {'DELETE_UNSUCCESSFUL'}}}

Lists the data sources in a knowledge base and information about each one.

See also: AWS API Documentation

Request Syntax

client.list_data_sources(
    knowledgeBaseId='string',
    maxResults=123,
    nextToken='string'
)
type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base for which to return a list of information.

type maxResults

integer

param maxResults

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

type nextToken

string

param nextToken

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

rtype

dict

returns

Response Syntax

{
    'dataSourceSummaries': [
        {
            'dataSourceId': 'string',
            'description': 'string',
            'knowledgeBaseId': 'string',
            'name': 'string',
            'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
            'updatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • dataSourceSummaries (list) --

      A list of objects, each of which contains information about a data source.

      • (dict) --

        Contains details about a data source.

        • dataSourceId (string) --

          The unique identifier of the data source.

        • description (string) --

          The description of the data source.

        • knowledgeBaseId (string) --

          The unique identifier of the knowledge base to which the data source belongs.

        • name (string) --

          The name of the data source.

        • status (string) --

          The status of the data source.

        • updatedAt (datetime) --

          The time at which the data source was last updated.

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

ListKnowledgeBases (updated) Link ¶
Changes (response)
{'knowledgeBaseSummaries': {'status': {'DELETE_UNSUCCESSFUL'}}}

Lists the knowledge bases in an account and information about each of them.

See also: AWS API Documentation

Request Syntax

client.list_knowledge_bases(
    maxResults=123,
    nextToken='string'
)
type maxResults

integer

param maxResults

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

type nextToken

string

param nextToken

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

rtype

dict

returns

Response Syntax

{
    'knowledgeBaseSummaries': [
        {
            'description': 'string',
            'knowledgeBaseId': 'string',
            'name': 'string',
            'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED'|'DELETE_UNSUCCESSFUL',
            'updatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • knowledgeBaseSummaries (list) --

      A list of objects, each of which contains information about a knowledge base.

      • (dict) --

        Contains details about a knowledge base.

        • description (string) --

          The description of the knowledge base.

        • knowledgeBaseId (string) --

          The unique identifier of the knowledge base.

        • name (string) --

          The name of the knowledge base.

        • status (string) --

          The status of the knowledge base.

        • updatedAt (datetime) --

          The time at which the knowledge base was last updated.

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

UpdateDataSource (updated) Link ¶
Changes (request, response)
Request
{'dataDeletionPolicy': 'RETAIN | DELETE',
 'dataSourceConfiguration': {'s3Configuration': {'bucketOwnerAccountId': 'string'}}}
Response
{'dataSource': {'dataDeletionPolicy': 'RETAIN | DELETE',
                'dataSourceConfiguration': {'s3Configuration': {'bucketOwnerAccountId': 'string'}},
                'failureReasons': ['string'],
                'status': {'DELETE_UNSUCCESSFUL'}}}

Updates configurations for a data source.

Warning

You can't change the chunkingConfiguration after you create the data source. Specify the existing chunkingConfiguration .

See also: AWS API Documentation

Request Syntax

client.update_data_source(
    dataDeletionPolicy='RETAIN'|'DELETE',
    dataSourceConfiguration={
        's3Configuration': {
            'bucketArn': 'string',
            'bucketOwnerAccountId': 'string',
            'inclusionPrefixes': [
                'string',
            ]
        },
        'type': 'S3'
    },
    dataSourceId='string',
    description='string',
    knowledgeBaseId='string',
    name='string',
    serverSideEncryptionConfiguration={
        'kmsKeyArn': 'string'
    },
    vectorIngestionConfiguration={
        'chunkingConfiguration': {
            'chunkingStrategy': 'FIXED_SIZE'|'NONE',
            'fixedSizeChunkingConfiguration': {
                'maxTokens': 123,
                'overlapPercentage': 123
            }
        }
    }
)
type dataDeletionPolicy

string

param dataDeletionPolicy

The data deletion policy of the updated data source.

type dataSourceConfiguration

dict

param dataSourceConfiguration

[REQUIRED]

Contains details about the storage configuration of the data source.

  • s3Configuration (dict) --

    Contains details about the configuration of the S3 object containing the data source.

    • bucketArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the bucket that contains the data source.

    • bucketOwnerAccountId (string) --

      The account ID for the owner of the S3 bucket.

    • inclusionPrefixes (list) --

      A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

      • (string) --

  • type (string) -- [REQUIRED]

    The type of storage for the data source.

type dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source.

type description

string

param description

Specifies a new description for the data source.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base to which the data source belongs.

type name

string

param name

[REQUIRED]

Specifies a new name for the data source.

type serverSideEncryptionConfiguration

dict

param serverSideEncryptionConfiguration

Contains details about server-side encryption of the data source.

  • kmsKeyArn (string) --

    The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

type vectorIngestionConfiguration

dict

param vectorIngestionConfiguration

Contains details about how to ingest the documents in the data source.

  • chunkingConfiguration (dict) --

    Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

    • chunkingStrategy (string) -- [REQUIRED]

      Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

      • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration .

      • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

    • fixedSizeChunkingConfiguration (dict) --

      Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE , exclude this field.

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens to include in a chunk.

      • overlapPercentage (integer) -- [REQUIRED]

        The percentage of overlap between adjacent chunks of a data source.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'type': 'S3'
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        Contains details about how the data source is stored.

        • s3Configuration (dict) --

          Contains details about the configuration of the S3 object containing the data source.

          • bucketArn (string) --

            The Amazon Resource Name (ARN) of the bucket that contains the data source.

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

            A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

            • (string) --

        • type (string) --

          The type of storage for the data source.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

        The details of the failure reasons related to the data source.

        • (string) --

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source belongs.

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        Contains details about the configuration of the server-side encryption.

        • kmsKeyArn (string) --

          The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

      • status (string) --

        The status of the data source. The following statuses are possible:

        • Available – The data source has been created and is ready for ingestion into the knowledge base.

        • Deleting – The data source is being deleted.

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

        Contains details about how to ingest the documents in the data source.

        • chunkingConfiguration (dict) --

          Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

          • chunkingStrategy (string) --

            Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

            • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration .

            • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          • fixedSizeChunkingConfiguration (dict) --

            Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE , exclude this field.

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

              The percentage of overlap between adjacent chunks of a data source.

UpdateKnowledgeBase (updated) Link ¶
Changes (response)
{'knowledgeBase': {'status': {'DELETE_UNSUCCESSFUL'}}}

Updates the configuration of a knowledge base with the fields that you specify. Because all fields will be overwritten, you must include the same values for fields that you want to keep the same.

You can change the following fields:

  • name

  • description

  • roleArn

You can't change the knowledgeBaseConfiguration or storageConfiguration fields, so you must specify the same configurations as when you created the knowledge base. You can send a GetKnowledgeBase request and copy the same configurations.

See also: AWS API Documentation

Request Syntax

client.update_knowledge_base(
    description='string',
    knowledgeBaseConfiguration={
        'type': 'VECTOR',
        'vectorKnowledgeBaseConfiguration': {
            'embeddingModelArn': 'string'
        }
    },
    knowledgeBaseId='string',
    name='string',
    roleArn='string',
    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'
    }
)
type description

string

param description

Specifies a new description for the knowledge base.

type knowledgeBaseConfiguration

dict

param knowledgeBaseConfiguration

[REQUIRED]

Specifies the configuration for the embeddings model used for the knowledge base. You must use the same configuration as when the knowledge base was created.

  • type (string) -- [REQUIRED]

    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) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base to update.

type name

string

param name

[REQUIRED]

Specifies a new name for the knowledge base.

type roleArn

string

param roleArn

[REQUIRED]

Specifies a different Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

type storageConfiguration

dict

param storageConfiguration

[REQUIRED]

Specifies the configuration for the vector store used for the knowledge base. You must use the same configuration as when the knowledge base was created.

  • opensearchServerlessConfiguration (dict) --

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

    • collectionArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • vectorIndexName (string) -- [REQUIRED]

      The name of the vector store.

  • pineconeConfiguration (dict) --

    Contains the storage configuration of the knowledge base in Pinecone.

    • connectionString (string) -- [REQUIRED]

      The endpoint URL for your index management page.

    • credentialsSecretArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • databaseName (string) -- [REQUIRED]

      The name of your Amazon RDS database.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • primaryKeyField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • resourceArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the vector store.

    • tableName (string) -- [REQUIRED]

      The name of the table in the database.

  • redisEnterpriseCloudConfiguration (dict) --

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

    • credentialsSecretArn (string) -- [REQUIRED]

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

    • endpoint (string) -- [REQUIRED]

      The endpoint URL of the Redis Enterprise Cloud database.

    • fieldMapping (dict) -- [REQUIRED]

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

      • metadataField (string) -- [REQUIRED]

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

      • textField (string) -- [REQUIRED]

        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) -- [REQUIRED]

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

    • vectorIndexName (string) -- [REQUIRED]

      The name of the vector index.

  • type (string) -- [REQUIRED]

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

rtype

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'|'DELETE_UNSUCCESSFUL',
        '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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

      • 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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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.