Skip to main content

memories

Creates, updates, deletes, gets or lists a memories resource.

Overview

Namememories
TypeResource
Idaws.bedrock_agentcore_control.memories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the memory. (pattern: <code>[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>)
namestringThe name of the memory. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>)
arnstringThe Amazon Resource Name (ARN) of the memory. (pattern: <code>arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:memory/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>)
created_atstring (date-time)The timestamp when the memory was created.
descriptionstringThe description of the memory.
encryption_key_arnstringThe ARN of the KMS key used to encrypt the memory. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
event_expiry_durationintegerThe number of days after which memory events will expire.
failure_reasonstringThe reason for failure if the memory is in a failed state.
indexed_keysarrayThe indexed metadata keys for this memory. Only indexed keys can be used in metadata filters.
managed_by_resource_arnstringARN of the resource managing this memory (e.g. a harness). When set, strategy modifications and deletion are only allowed through the managing resource. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
memory_execution_role_arnstringThe ARN of the IAM role that provides permissions for the memory. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
namespace_keysarrayThe namespace variable key definitions for this memory. Namespace keys define custom variables used in namespaceTemplates with optional validation rules.
statusstringThe current status of the memory. (CREATING, ACTIVE, FAILED, DELETING, UPDATING)
strategiesarrayThe list of memory strategies associated with this memory.
stream_delivery_resourcesobjectConfiguration for streaming memory record data to external resources.
updated_atstring (date-time)The timestamp when the memory was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_memoryselectmemory_id, regionviewRetrieve an existing Amazon Bedrock AgentCore Memory resource.
list_memoriesselectregionLists the available Amazon Bedrock AgentCore Memory resources in the current Amazon Web Services Region.
create_memoryinsertregion, name, eventExpiryDurationCreates a new Amazon Bedrock AgentCore Memory resource.
update_memoryupdatememory_id, regionUpdate an Amazon Bedrock AgentCore Memory resource memory.
delete_memorydeletememory_id, regionclientTokenDeletes an Amazon Bedrock AgentCore Memory resource.

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.

NameDatatypeDescription
memory_idstringThe unique identifier of the memory to delete.
regionstringAWS region (default: us-east-1)
clientTokenstringA client token is used for keeping track of idempotent requests. It can contain a session id which can be around 250 chars, combined with a unique AWS identifier.
viewstringThe level of detail to return for the memory.

SELECT examples

Retrieve an existing Amazon Bedrock AgentCore Memory resource.

SELECT
id,
name,
arn,
created_at,
description,
encryption_key_arn,
event_expiry_duration,
failure_reason,
indexed_keys,
managed_by_resource_arn,
memory_execution_role_arn,
namespace_keys,
status,
strategies,
stream_delivery_resources,
updated_at
FROM aws.bedrock_agentcore_control.memories
WHERE memory_id = '{{ memory_id }}' -- required
AND region = '{{ region }}' -- required
AND view = '{{ view }}'
;

INSERT examples

Creates a new Amazon Bedrock AgentCore Memory resource.

INSERT INTO aws.bedrock_agentcore_control.memories (
clientToken,
name,
description,
encryptionKeyArn,
memoryExecutionRoleArn,
eventExpiryDuration,
memoryStrategies,
indexedKeys,
namespaceKeys,
streamDeliveryResources,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ description }}',
'{{ encryptionKeyArn }}',
'{{ memoryExecutionRoleArn }}',
{{ eventExpiryDuration }} /* required */,
'{{ memoryStrategies }}',
'{{ indexedKeys }}',
'{{ namespaceKeys }}',
'{{ streamDeliveryResources }}',
'{{ tags }}',
'{{ region }}'
RETURNING
memory
;

UPDATE examples

Update an Amazon Bedrock AgentCore Memory resource memory.

UPDATE aws.bedrock_agentcore_control.memories
SET
clientToken = '{{ clientToken }}',
description = '{{ description }}',
eventExpiryDuration = {{ eventExpiryDuration }},
memoryExecutionRoleArn = '{{ memoryExecutionRoleArn }}',
memoryStrategies = '{{ memoryStrategies }}',
addIndexedKeys = '{{ addIndexedKeys }}',
namespaceKeys = '{{ namespaceKeys }}',
streamDeliveryResources = '{{ streamDeliveryResources }}'
WHERE
memory_id = '{{ memory_id }}' --required
AND region = '{{ region }}' --required
RETURNING
memory;

DELETE examples

Deletes an Amazon Bedrock AgentCore Memory resource.

DELETE FROM aws.bedrock_agentcore_control.memories
WHERE memory_id = '{{ memory_id }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;