AgentsforBedrock / Client / get_knowledge_base
get_knowledge_base#
- AgentsforBedrock.Client.get_knowledge_base(**kwargs)#
Gets information about a knoweldge base.
See also: AWS API Documentation
Request Syntax
response = client.get_knowledge_base( knowledgeBaseId='string' )
- Parameters:
knowledgeBaseId (string) –
[REQUIRED]
The unique identifier of the knowledge base you want to get information on.
- Return type:
dict
- Returns:
Response Syntax
{ 'knowledgeBase': { 'createdAt': datetime(2015, 1, 1), 'description': 'string', 'failureReasons': [ 'string', ], 'knowledgeBaseArn': 'string', 'knowledgeBaseConfiguration': { 'kendraKnowledgeBaseConfiguration': { 'kendraIndexArn': 'string' }, 'sqlKnowledgeBaseConfiguration': { 'redshiftConfiguration': { 'queryEngineConfiguration': { 'provisionedConfiguration': { 'authConfiguration': { 'databaseUser': 'string', 'type': 'IAM'|'USERNAME_PASSWORD'|'USERNAME', 'usernamePasswordSecretArn': 'string' }, 'clusterIdentifier': 'string' }, 'serverlessConfiguration': { 'authConfiguration': { 'type': 'IAM'|'USERNAME_PASSWORD', 'usernamePasswordSecretArn': 'string' }, 'workgroupArn': 'string' }, 'type': 'SERVERLESS'|'PROVISIONED' }, 'queryGenerationConfiguration': { 'executionTimeoutSeconds': 123, 'generationContext': { 'curatedQueries': [ { 'naturalLanguage': 'string', 'sql': 'string' }, ], 'tables': [ { 'columns': [ { 'description': 'string', 'inclusion': 'INCLUDE'|'EXCLUDE', 'name': 'string' }, ], 'description': 'string', 'inclusion': 'INCLUDE'|'EXCLUDE', 'name': 'string' }, ] } }, 'storageConfigurations': [ { 'awsDataCatalogConfiguration': { 'tableNames': [ 'string', ] }, 'redshiftConfiguration': { 'databaseName': 'string' }, 'type': 'REDSHIFT'|'AWS_DATA_CATALOG' }, ] }, 'type': 'REDSHIFT' }, 'type': 'VECTOR'|'KENDRA'|'SQL', 'vectorKnowledgeBaseConfiguration': { 'embeddingModelArn': 'string', 'embeddingModelConfiguration': { 'bedrockEmbeddingModelConfiguration': { 'dimensions': 123, 'embeddingDataType': 'FLOAT32'|'BINARY' } }, 'supplementalDataStorageConfiguration': { 'storageLocations': [ { 's3Location': { 'uri': 'string' }, 'type': 'S3' }, ] } } }, '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 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.
kendraKnowledgeBaseConfiguration (dict) –
Settings for an Amazon Kendra knowledge base.
kendraIndexArn (string) –
The ARN of the Amazon Kendra index.
sqlKnowledgeBaseConfiguration (dict) –
Specifies configurations for a knowledge base connected to an SQL database.
redshiftConfiguration (dict) –
Specifies configurations for a knowledge base connected to an Amazon Redshift database.
queryEngineConfiguration (dict) –
Specifies configurations for an Amazon Redshift query engine.
provisionedConfiguration (dict) –
Specifies configurations for a provisioned Amazon Redshift query engine.
authConfiguration (dict) –
Specifies configurations for authentication to Amazon Redshift.
databaseUser (string) –
The database username for authentication to an Amazon Redshift provisioned data warehouse.
type (string) –
The type of authentication to use.
usernamePasswordSecretArn (string) –
The ARN of an Secrets Manager secret for authentication.
clusterIdentifier (string) –
The ID of the Amazon Redshift cluster.
serverlessConfiguration (dict) –
Specifies configurations for a serverless Amazon Redshift query engine.
authConfiguration (dict) –
Specifies configurations for authentication to an Amazon Redshift provisioned data warehouse.
type (string) –
The type of authentication to use.
usernamePasswordSecretArn (string) –
The ARN of an Secrets Manager secret for authentication.
workgroupArn (string) –
The ARN of the Amazon Redshift workgroup.
type (string) –
The type of query engine.
queryGenerationConfiguration (dict) –
Specifies configurations for generating queries.
executionTimeoutSeconds (integer) –
The time after which query generation will time out.
generationContext (dict) –
Specifies configurations for context to use during query generation.
curatedQueries (list) –
An array of objects, each of which defines information about example queries to help the query engine generate appropriate SQL queries.
(dict) –
Contains configurations for a query, each of which defines information about example queries to help the query engine generate appropriate SQL queries.
naturalLanguage (string) –
An example natural language query.
sql (string) –
The SQL equivalent of the natural language query.
tables (list) –
An array of objects, each of which defines information about a table in the database.
(dict) –
Contains information about a table for the query engine to consider.
columns (list) –
An array of objects, each of which defines information about a column in the table.
(dict) –
Contains information about a column in the current table for the query engine to consider.
description (string) –
A description of the column that helps the query engine understand the contents of the column.
inclusion (string) –
Specifies whether to include or exclude the column during query generation. If you specify
EXCLUDE
, the column will be ignored. If you specifyINCLUDE
, all other columns in the table will be ignored.name (string) –
The name of the column for which the other fields in this object apply.
description (string) –
A description of the table that helps the query engine understand the contents of the table.
inclusion (string) –
Specifies whether to include or exclude the table during query generation. If you specify
EXCLUDE
, the table will be ignored. If you specifyINCLUDE
, all other tables will be ignored.name (string) –
The name of the table for which the other fields in this object apply.
storageConfigurations (list) –
Specifies configurations for Amazon Redshift database storage.
(dict) –
Contains configurations for Amazon Redshift data storage. Specify the data storage service to use in the
type
field and include the corresponding field. For more information, see Build a knowledge base by connecting to a structured data source in the Amazon Bedrock User Guide.awsDataCatalogConfiguration (dict) –
Specifies configurations for storage in Glue Data Catalog.
tableNames (list) –
A list of names of the tables to use.
(string) –
redshiftConfiguration (dict) –
Specifies configurations for storage in Amazon Redshift.
databaseName (string) –
The name of the Amazon Redshift database.
type (string) –
The data storage service to use.
type (string) –
The type of SQL database to connect to 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 model that’s used to convert the data source into vector embeddings.
embeddingModelArn (string) –
The Amazon Resource Name (ARN) of the model or inference profile 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.
embeddingDataType (string) –
The data type for the vectors when using a model to convert text into vector embeddings. The model must support the specified data type for vector embeddings. Floating-point (float32) is the default data type, and is supported by most models for vector embeddings. See Supported embeddings models for information on the available models and their vector data types.
supplementalDataStorageConfiguration (dict) –
If you include multimodal data from your data source, use this object to specify configurations for the storage location of the images extracted from your documents. These images can be retrieved and returned to the end user. They can also be used in generation when using RetrieveAndGenerate.
storageLocations (list) –
A list of objects specifying storage locations for images extracted from multimodal documents in your data source.
(dict) –
Contains information about a storage location for images extracted from multimodal documents in your data source.
s3Location (dict) –
Contains information about the Amazon S3 location for the extracted images.
uri (string) –
The location’s URI. For example,
s3://my-bucket/chunk-processor/
.
type (string) –
Specifies the storage service used for this location.
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 the knowledge base was last updated.
Exceptions