Agents for Amazon Bedrock

2024/05/30 - Agents for Amazon Bedrock - 3 updated api methods

Changes  With this release, Knowledge bases for Bedrock adds support for Titan Text Embedding v2.

CreateKnowledgeBase (updated) Link ¶
Changes (request, response)
Request
{'knowledgeBaseConfiguration': {'vectorKnowledgeBaseConfiguration': {'embeddingModelConfiguration': {'bedrockEmbeddingModelConfiguration': {'dimensions': 'integer'}}}}}
Response
{'knowledgeBase': {'knowledgeBaseConfiguration': {'vectorKnowledgeBaseConfiguration': {'embeddingModelConfiguration': {'bedrockEmbeddingModelConfiguration': {'dimensions': 'integer'}}}}}}

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.

  • 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',
            'embeddingModelConfiguration': {
                'bedrockEmbeddingModelConfiguration': {
                    'dimensions': 123
                }
            }
        }
    },
    name='string',
    roleArn='string',
    storageConfiguration={
        'mongoDbAtlasConfiguration': {
            'collectionName': 'string',
            'credentialsSecretArn': 'string',
            'databaseName': 'string',
            'endpoint': 'string',
            'endpointServiceName': 'string',
            'fieldMapping': {
                'metadataField': 'string',
                'textField': 'string',
                'vectorField': 'string'
            },
            'vectorIndexName': 'string'
        },
        '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'|'MONGO_DB_ATLAS'
    },
    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.

    • embeddingModelConfiguration (dict) --

      The embeddings model configuration details for the vector model used in Knowledge Base.

      • bedrockEmbeddingModelConfiguration (dict) --

        The vector configuration details on the Bedrock embeddings model.

        • dimensions (integer) --

          The dimensions details for the vector configuration used on the Bedrock embeddings model.

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.

  • mongoDbAtlasConfiguration (dict) --

    Contains the storage configuration of the knowledge base in MongoDB Atlas.

    • collectionName (string) -- [REQUIRED]

      The collection name of the knowledge base in MongoDB Atlas.

    • credentialsSecretArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

    • databaseName (string) -- [REQUIRED]

      The database name in your MongoDB Atlas cluster for your knowledge base.

    • endpoint (string) -- [REQUIRED]

      The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

    • endpointServiceName (string) --

      The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

    • 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 MongoDB Atlas vector search index.

  • 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',
                'embeddingModelConfiguration': {
                    'bedrockEmbeddingModelConfiguration': {
                        'dimensions': 123
                    }
                }
            }
        },
        'knowledgeBaseId': 'string',
        'name': 'string',
        'roleArn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED'|'DELETE_UNSUCCESSFUL',
        'storageConfiguration': {
            'mongoDbAtlasConfiguration': {
                'collectionName': 'string',
                'credentialsSecretArn': 'string',
                'databaseName': 'string',
                'endpoint': 'string',
                'endpointServiceName': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'vectorIndexName': 'string'
            },
            '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'|'MONGO_DB_ATLAS'
        },
        '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.

          • embeddingModelConfiguration (dict) --

            The embeddings model configuration details for the vector model used in Knowledge Base.

            • bedrockEmbeddingModelConfiguration (dict) --

              The vector configuration details on the Bedrock embeddings model.

              • dimensions (integer) --

                The dimensions details for the vector configuration used on the Bedrock embeddings model.

      • 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.

        • mongoDbAtlasConfiguration (dict) --

          Contains the storage configuration of the knowledge base in MongoDB Atlas.

          • collectionName (string) --

            The collection name of the knowledge base in MongoDB Atlas.

          • credentialsSecretArn (string) --

            The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

          • databaseName (string) --

            The database name in your MongoDB Atlas cluster for your knowledge base.

          • endpoint (string) --

            The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

          • endpointServiceName (string) --

            The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

          • 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 MongoDB Atlas vector search index.

        • 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.

GetKnowledgeBase (updated) Link ¶
Changes (response)
{'knowledgeBase': {'knowledgeBaseConfiguration': {'vectorKnowledgeBaseConfiguration': {'embeddingModelConfiguration': {'bedrockEmbeddingModelConfiguration': {'dimensions': 'integer'}}}}}}

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',
                'embeddingModelConfiguration': {
                    'bedrockEmbeddingModelConfiguration': {
                        'dimensions': 123
                    }
                }
            }
        },
        'knowledgeBaseId': 'string',
        'name': 'string',
        'roleArn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED'|'DELETE_UNSUCCESSFUL',
        'storageConfiguration': {
            'mongoDbAtlasConfiguration': {
                'collectionName': 'string',
                'credentialsSecretArn': 'string',
                'databaseName': 'string',
                'endpoint': 'string',
                'endpointServiceName': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'vectorIndexName': 'string'
            },
            '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'|'MONGO_DB_ATLAS'
        },
        '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.

          • embeddingModelConfiguration (dict) --

            The embeddings model configuration details for the vector model used in Knowledge Base.

            • bedrockEmbeddingModelConfiguration (dict) --

              The vector configuration details on the Bedrock embeddings model.

              • dimensions (integer) --

                The dimensions details for the vector configuration used on the Bedrock embeddings model.

      • 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.

        • mongoDbAtlasConfiguration (dict) --

          Contains the storage configuration of the knowledge base in MongoDB Atlas.

          • collectionName (string) --

            The collection name of the knowledge base in MongoDB Atlas.

          • credentialsSecretArn (string) --

            The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

          • databaseName (string) --

            The database name in your MongoDB Atlas cluster for your knowledge base.

          • endpoint (string) --

            The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

          • endpointServiceName (string) --

            The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

          • 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 MongoDB Atlas vector search index.

        • 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.

UpdateKnowledgeBase (updated) Link ¶
Changes (request, response)
Request
{'knowledgeBaseConfiguration': {'vectorKnowledgeBaseConfiguration': {'embeddingModelConfiguration': {'bedrockEmbeddingModelConfiguration': {'dimensions': 'integer'}}}}}
Response
{'knowledgeBase': {'knowledgeBaseConfiguration': {'vectorKnowledgeBaseConfiguration': {'embeddingModelConfiguration': {'bedrockEmbeddingModelConfiguration': {'dimensions': 'integer'}}}}}}

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',
            'embeddingModelConfiguration': {
                'bedrockEmbeddingModelConfiguration': {
                    'dimensions': 123
                }
            }
        }
    },
    knowledgeBaseId='string',
    name='string',
    roleArn='string',
    storageConfiguration={
        'mongoDbAtlasConfiguration': {
            'collectionName': 'string',
            'credentialsSecretArn': 'string',
            'databaseName': 'string',
            'endpoint': 'string',
            'endpointServiceName': 'string',
            'fieldMapping': {
                'metadataField': 'string',
                'textField': 'string',
                'vectorField': 'string'
            },
            'vectorIndexName': 'string'
        },
        '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'|'MONGO_DB_ATLAS'
    }
)
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.

    • embeddingModelConfiguration (dict) --

      The embeddings model configuration details for the vector model used in Knowledge Base.

      • bedrockEmbeddingModelConfiguration (dict) --

        The vector configuration details on the Bedrock embeddings model.

        • dimensions (integer) --

          The dimensions details for the vector configuration used on the Bedrock embeddings model.

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.

  • mongoDbAtlasConfiguration (dict) --

    Contains the storage configuration of the knowledge base in MongoDB Atlas.

    • collectionName (string) -- [REQUIRED]

      The collection name of the knowledge base in MongoDB Atlas.

    • credentialsSecretArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

    • databaseName (string) -- [REQUIRED]

      The database name in your MongoDB Atlas cluster for your knowledge base.

    • endpoint (string) -- [REQUIRED]

      The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

    • endpointServiceName (string) --

      The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

    • 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 MongoDB Atlas vector search index.

  • 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',
                'embeddingModelConfiguration': {
                    'bedrockEmbeddingModelConfiguration': {
                        'dimensions': 123
                    }
                }
            }
        },
        'knowledgeBaseId': 'string',
        'name': 'string',
        'roleArn': 'string',
        'status': 'CREATING'|'ACTIVE'|'DELETING'|'UPDATING'|'FAILED'|'DELETE_UNSUCCESSFUL',
        'storageConfiguration': {
            'mongoDbAtlasConfiguration': {
                'collectionName': 'string',
                'credentialsSecretArn': 'string',
                'databaseName': 'string',
                'endpoint': 'string',
                'endpointServiceName': 'string',
                'fieldMapping': {
                    'metadataField': 'string',
                    'textField': 'string',
                    'vectorField': 'string'
                },
                'vectorIndexName': 'string'
            },
            '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'|'MONGO_DB_ATLAS'
        },
        '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.

          • embeddingModelConfiguration (dict) --

            The embeddings model configuration details for the vector model used in Knowledge Base.

            • bedrockEmbeddingModelConfiguration (dict) --

              The vector configuration details on the Bedrock embeddings model.

              • dimensions (integer) --

                The dimensions details for the vector configuration used on the Bedrock embeddings model.

      • 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.

        • mongoDbAtlasConfiguration (dict) --

          Contains the storage configuration of the knowledge base in MongoDB Atlas.

          • collectionName (string) --

            The collection name of the knowledge base in MongoDB Atlas.

          • credentialsSecretArn (string) --

            The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

          • databaseName (string) --

            The database name in your MongoDB Atlas cluster for your knowledge base.

          • endpoint (string) --

            The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

          • endpointServiceName (string) --

            The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

          • 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 MongoDB Atlas vector search index.

        • 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.