knowledge_bases
Creates, updates, deletes, gets or lists a knowledge_bases resource.
Overview
| Name | knowledge_bases |
| Type | Resource |
| Id | aws.qconnect.knowledge_bases |
Fields
The following fields are returned by SELECT queries:
- get_knowledge_base
- list_knowledge_bases
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the knowledge base. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
description | string | The description. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
ingestion_failure_reasons | array | List of failure reasons on ingestion per file. |
ingestion_status | string | Status of ingestion on data source. (SYNC_FAILED, SYNCING_IN_PROGRESS, SYNC_SUCCESS, CREATE_IN_PROGRESS) |
knowledge_base_arn | string | The Amazon Resource Name (ARN) of the knowledge base. (pattern: <code>arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}){0,2}</code>) |
knowledge_base_id | string | The identifier of the knowledge base. (pattern: <code>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}</code>) |
knowledge_base_type | string | The type of knowledge base. (EXTERNAL, CUSTOM, QUICK_RESPONSES, MESSAGE_TEMPLATES, MANAGED) |
last_content_modification_time | string (date-time) | An epoch timestamp indicating the most recent content modification inside the knowledge base. If no content exists in a knowledge base, this value is unset. |
rendering_configuration | object | Information about how to render the content. |
server_side_encryption_configuration | object | The configuration information for the customer managed key used for encryption. |
source_configuration | object | Configuration information about the external data source. |
status | string | The status of the knowledge base. (CREATE_IN_PROGRESS, CREATE_FAILED, ACTIVE, DELETE_IN_PROGRESS, DELETE_FAILED, DELETED) |
tags | object | The tags used to organize, track, or control access for this resource. |
vector_ingestion_configuration | object | Contains details about how to ingest the documents in a data source. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the knowledge base. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
description | string | The description of the knowledge base. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
knowledge_base_arn | string | The Amazon Resource Name (ARN) of the knowledge base. (pattern: <code>arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}){0,2}</code>) |
knowledge_base_id | string | The identifier of the knowledge base. (pattern: <code>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}</code>) |
knowledge_base_type | string | The type of knowledge base. (EXTERNAL, CUSTOM, QUICK_RESPONSES, MESSAGE_TEMPLATES, MANAGED) |
rendering_configuration | object | Information about how to render the content. |
server_side_encryption_configuration | object | The configuration information for the customer managed key used for encryption. |
source_configuration | object | Configuration information about the external data source. |
status | string | The status of the knowledge base summary. (CREATE_IN_PROGRESS, CREATE_FAILED, ACTIVE, DELETE_IN_PROGRESS, DELETE_FAILED, DELETED) |
tags | object | The tags used to organize, track, or control access for this resource. |
vector_ingestion_configuration | object | Contains details about how to ingest the documents in a data source. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_knowledge_base | select | knowledge_base_id, region | Retrieves information about the knowledge base. | |
list_knowledge_bases | select | region | nextToken, maxResults | Lists the knowledge bases. |
create_knowledge_base | insert | region, name, knowledgeBaseType | Creates a knowledge base. When using this API, you cannot reuse Amazon AppIntegrations DataIntegrations with external knowledge bases such as Salesforce and ServiceNow. If you do, you'll get an InvalidRequestException error. For example, you're programmatically managing your external knowledge base, and you want to add or remove one of the fields that is being ingested from Salesforce. Do the following: Call DeleteKnowledgeBase. Call DeleteDataIntegration. Call CreateDataIntegration to recreate the DataIntegration or a create different one. Call CreateKnowledgeBase. | |
update_knowledge_base_template_uri | update | knowledge_base_id, region, templateUri | Updates the template URI of a knowledge base. This is only supported for knowledge bases of type EXTERNAL. Include a single variable in ${variable} format; this interpolated by Amazon Q in Connect using ingested content. For example, if you ingest a Salesforce article, it has an Id value, and you can set the template URI to https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/${Id}/view. | |
remove_knowledge_base_template_uri | update | knowledge_base_id, region | Removes a URI template from a knowledge base. | |
delete_knowledge_base | delete | knowledge_base_id, region | Deletes the knowledge base. When you use this API to delete an external knowledge base such as Salesforce or ServiceNow, you must also delete the Amazon AppIntegrations DataIntegration. This is because you can't reuse the DataIntegration after it's been associated with an external knowledge base. However, you can delete and recreate it. See DeleteDataIntegration and CreateDataIntegration in the Amazon AppIntegrations API Reference. | |
start_import_job | exec | knowledge_base_id, region, importJobType, uploadId | Start an asynchronous job to import Amazon Q in Connect resources from an uploaded source file. Before calling this API, use StartContentUpload to upload an asset that contains the resource data. For importing Amazon Q in Connect quick responses, you need to upload a csv file including the quick responses. For information about how to format the csv file for importing quick responses, see Import quick responses. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
knowledge_base_id | string | The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN. For importing Amazon Q in Connect quick responses, this should be a QUICK_RESPONSES type knowledge base. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return per page. |
nextToken | string | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
SELECT examples
- get_knowledge_base
- list_knowledge_bases
Retrieves information about the knowledge base.
SELECT
name,
description,
ingestion_failure_reasons,
ingestion_status,
knowledge_base_arn,
knowledge_base_id,
knowledge_base_type,
last_content_modification_time,
rendering_configuration,
server_side_encryption_configuration,
source_configuration,
status,
tags,
vector_ingestion_configuration
FROM aws.qconnect.knowledge_bases
WHERE knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the knowledge bases.
SELECT
name,
description,
knowledge_base_arn,
knowledge_base_id,
knowledge_base_type,
rendering_configuration,
server_side_encryption_configuration,
source_configuration,
status,
tags,
vector_ingestion_configuration
FROM aws.qconnect.knowledge_bases
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_knowledge_base
- Manifest
Creates a knowledge base. When using this API, you cannot reuse Amazon AppIntegrations DataIntegrations with external knowledge bases such as Salesforce and ServiceNow. If you do, you'll get an InvalidRequestException error. For example, you're programmatically managing your external knowledge base, and you want to add or remove one of the fields that is being ingested from Salesforce. Do the following: Call DeleteKnowledgeBase. Call DeleteDataIntegration. Call CreateDataIntegration to recreate the DataIntegration or a create different one. Call CreateKnowledgeBase.
INSERT INTO aws.qconnect.knowledge_bases (
clientToken,
name,
knowledgeBaseType,
sourceConfiguration,
renderingConfiguration,
vectorIngestionConfiguration,
serverSideEncryptionConfiguration,
description,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ knowledgeBaseType }}' /* required */,
'{{ sourceConfiguration }}',
'{{ renderingConfiguration }}',
'{{ vectorIngestionConfiguration }}',
'{{ serverSideEncryptionConfiguration }}',
'{{ description }}',
'{{ tags }}',
'{{ region }}'
RETURNING
knowledge_base
;
# Description fields are for documentation purposes
- name: knowledge_bases
props:
- name: region
value: "{{ region }}"
description: Required parameter for the knowledge_bases resource.
- name: clientToken
value: "{{ clientToken }}"
- name: name
value: "{{ name }}"
- name: knowledgeBaseType
value: "{{ knowledgeBaseType }}"
valid_values: ['EXTERNAL', 'CUSTOM', 'QUICK_RESPONSES', 'MESSAGE_TEMPLATES', 'MANAGED']
- name: sourceConfiguration
description: |
Configuration information about the external data source.
value:
appIntegrations:
appIntegrationArn: "{{ appIntegrationArn }}"
objectFields:
- "{{ objectFields }}"
managedSourceConfiguration:
webCrawlerConfiguration:
urlConfiguration:
seedUrls:
- url: "{{ url }}"
crawlerLimits:
rateLimit: {{ rateLimit }}
inclusionFilters:
- "{{ inclusionFilters }}"
exclusionFilters:
- "{{ exclusionFilters }}"
scope: "{{ scope }}"
- name: renderingConfiguration
description: |
Information about how to render the content.
value:
templateUri: "{{ templateUri }}"
- name: vectorIngestionConfiguration
description: |
Contains details about how to ingest the documents in a data source.
value:
chunkingConfiguration:
chunkingStrategy: "{{ chunkingStrategy }}"
fixedSizeChunkingConfiguration:
maxTokens: {{ maxTokens }}
overlapPercentage: {{ overlapPercentage }}
hierarchicalChunkingConfiguration:
levelConfigurations:
- maxTokens: {{ maxTokens }}
overlapTokens: {{ overlapTokens }}
semanticChunkingConfiguration:
maxTokens: {{ maxTokens }}
bufferSize: {{ bufferSize }}
breakpointPercentileThreshold: {{ breakpointPercentileThreshold }}
parsingConfiguration:
parsingStrategy: "{{ parsingStrategy }}"
bedrockFoundationModelConfiguration:
modelArn: "{{ modelArn }}"
parsingPrompt:
parsingPromptText: "{{ parsingPromptText }}"
- name: serverSideEncryptionConfiguration
description: |
The configuration information for the customer managed key used for encryption.
value:
kmsKeyId: "{{ kmsKeyId }}"
- name: description
value: "{{ description }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_knowledge_base_template_uri
- remove_knowledge_base_template_uri
Updates the template URI of a knowledge base. This is only supported for knowledge bases of type EXTERNAL. Include a single variable in ${variable} format; this interpolated by Amazon Q in Connect using ingested content. For example, if you ingest a Salesforce article, it has an Id value, and you can set the template URI to https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/*${Id}*/view.
UPDATE aws.qconnect.knowledge_bases
SET
templateUri = '{{ templateUri }}'
WHERE
knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required
AND templateUri = '{{ templateUri }}' --required
RETURNING
knowledge_base;
Removes a URI template from a knowledge base.
UPDATE aws.qconnect.knowledge_bases
SET
-- No updatable properties
WHERE
knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_knowledge_base
Deletes the knowledge base. When you use this API to delete an external knowledge base such as Salesforce or ServiceNow, you must also delete the Amazon AppIntegrations DataIntegration. This is because you can't reuse the DataIntegration after it's been associated with an external knowledge base. However, you can delete and recreate it. See DeleteDataIntegration and CreateDataIntegration in the Amazon AppIntegrations API Reference.
DELETE FROM aws.qconnect.knowledge_bases
WHERE knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- start_import_job
Start an asynchronous job to import Amazon Q in Connect resources from an uploaded source file. Before calling this API, use StartContentUpload to upload an asset that contains the resource data. For importing Amazon Q in Connect quick responses, you need to upload a csv file including the quick responses. For information about how to format the csv file for importing quick responses, see Import quick responses.
EXEC aws.qconnect.knowledge_bases.start_import_job
@knowledge_base_id='{{ knowledge_base_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"importJobType": "{{ importJobType }}",
"uploadId": "{{ uploadId }}",
"clientToken": "{{ clientToken }}",
"metadata": "{{ metadata }}",
"externalSourceConfiguration": "{{ externalSourceConfiguration }}"
}'
;