agent_knowledge_bases
Creates, updates, deletes, gets or lists an agent_knowledge_bases resource.
Overview
| Name | agent_knowledge_bases |
| Type | Resource |
| Id | aws.bedrock_agent.agent_knowledge_bases |
Fields
The following fields are returned by SELECT queries:
- get_agent_knowledge_base
- list_agent_knowledge_bases
| Name | Datatype | Description |
|---|---|---|
agent_id | string | The unique identifier of the agent with which the knowledge base is associated. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
agent_version | string | The version of the agent with which the knowledge base is associated. (pattern: <code>(DRAFT|[0-9]{0,4}[1-9][0-9]{0,4})</code>) |
created_at | string (date-time) | The time at which the association between the agent and the knowledge base was created. |
description | string | The description of the association between the agent and the knowledge base. |
knowledge_base_id | string | The unique identifier of the association between the agent and the knowledge base. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
knowledge_base_state | string | Specifies whether to use the knowledge base or not when sending an InvokeAgent request. (ENABLED, DISABLED) |
updated_at | string (date-time) | The time at which the association between the agent and the knowledge base was last updated. |
| Name | Datatype | Description |
|---|---|---|
description | string | The description of the knowledge base associated with an agent. |
knowledge_base_id | string | The unique identifier of the knowledge base associated with an agent. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
knowledge_base_state | string | Specifies whether the agent uses the knowledge base or not when sending an InvokeAgent request. (ENABLED, DISABLED) |
updated_at | string (date-time) | The time at which the knowledge base associated with an agent was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_agent_knowledge_base | select | agent_id, agent_version, knowledge_base_id, region | Gets information about a knowledge base associated with an agent. | |
list_agent_knowledge_bases | select | agent_id, agent_version, region | Lists knowledge bases associated with an agent and information about each one. | |
associate_agent_knowledge_base | update | agent_id, agent_version, region, knowledgeBaseId, description | Associates a knowledge base with an agent. If a knowledge base is associated and its indexState is set to Enabled, the agent queries the knowledge base for information to augment its response to the user. | |
disassociate_agent_knowledge_base | update | agent_id, agent_version, knowledge_base_id, region | Disassociates a knowledge base from an agent. | |
update_agent_knowledge_base | exec | agent_id, agent_version, knowledge_base_id, region | Updates the configuration for a knowledge base that has been associated with an agent. |
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 |
|---|---|---|
agent_id | string | The unique identifier of the agent associated with the knowledge base that you want to update. |
agent_version | string | The version of the agent associated with the knowledge base that you want to update. |
knowledge_base_id | string | The unique identifier of the knowledge base that has been associated with an agent. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_agent_knowledge_base
- list_agent_knowledge_bases
Gets information about a knowledge base associated with an agent.
SELECT
agent_id,
agent_version,
created_at,
description,
knowledge_base_id,
knowledge_base_state,
updated_at
FROM aws.bedrock_agent.agent_knowledge_bases
WHERE agent_id = '{{ agent_id }}' -- required
AND agent_version = '{{ agent_version }}' -- required
AND knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists knowledge bases associated with an agent and information about each one.
SELECT
description,
knowledge_base_id,
knowledge_base_state,
updated_at
FROM aws.bedrock_agent.agent_knowledge_bases
WHERE agent_id = '{{ agent_id }}' -- required
AND agent_version = '{{ agent_version }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- associate_agent_knowledge_base
- disassociate_agent_knowledge_base
Associates a knowledge base with an agent. If a knowledge base is associated and its indexState is set to Enabled, the agent queries the knowledge base for information to augment its response to the user.
UPDATE aws.bedrock_agent.agent_knowledge_bases
SET
knowledgeBaseId = '{{ knowledgeBaseId }}',
description = '{{ description }}',
knowledgeBaseState = '{{ knowledgeBaseState }}'
WHERE
agent_id = '{{ agent_id }}' --required
AND agent_version = '{{ agent_version }}' --required
AND region = '{{ region }}' --required
AND knowledgeBaseId = '{{ knowledgeBaseId }}' --required
AND description = '{{ description }}' --required
RETURNING
agent_knowledge_base;
Disassociates a knowledge base from an agent.
UPDATE aws.bedrock_agent.agent_knowledge_bases
SET
-- No updatable properties
WHERE
agent_id = '{{ agent_id }}' --required
AND agent_version = '{{ agent_version }}' --required
AND knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required;
Lifecycle Methods
- update_agent_knowledge_base
Updates the configuration for a knowledge base that has been associated with an agent.
EXEC aws.bedrock_agent.agent_knowledge_bases.update_agent_knowledge_base
@agent_id='{{ agent_id }}' --required,
@agent_version='{{ agent_version }}' --required,
@knowledge_base_id='{{ knowledge_base_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"description": "{{ description }}",
"knowledgeBaseState": "{{ knowledgeBaseState }}"
}'
;