Skip to main content

memory_records

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

Overview

Namememory_records
TypeResource
Idaws.bedrock_agentcore.memory_records

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
contentobjectThe content of the memory record.
created_atstring (date-time)The timestamp when the memory record was created.
memory_record_idstringThe unique identifier of the memory record. (pattern: <code>mem-[a-zA-Z0-9-_]*</code>)
memory_strategy_idstringThe identifier of the memory strategy associated with this record. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-_]*</code>)
metadataobjectA map of metadata key-value pairs associated with a memory record.
namespacesarrayThe namespaces associated with this memory record. Namespaces help organize and categorize memory records.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_memory_recordselectmemory_id, memory_record_id, regionnamespaceRetrieves a specific memory record from an AgentCore Memory resource. To use this operation, you must have the bedrock-agentcore:GetMemoryRecord permission.
list_memory_recordsselectmemory_id, regionLists memory records in an AgentCore Memory resource based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully. To use this operation, you must have the bedrock-agentcore:ListMemoryRecords permission.
delete_memory_recorddeletememory_id, memory_record_id, regionnamespaceDeletes a memory record from an AgentCore Memory resource. When you delete a memory record, it is permanently removed. To use this operation, you must have the bedrock-agentcore:DeleteMemoryRecord permission.
batch_create_memory_recordsexecmemory_id, region, recordsCreates multiple memory records in a single batch operation for the specified memory with custom content.
batch_delete_memory_recordsexecmemory_id, region, recordsDeletes multiple memory records in a single batch operation from the specified memory.
batch_update_memory_recordsexecmemory_id, region, recordsUpdates multiple memory records with custom content in a single batch operation within the specified memory.
retrieve_memory_recordsexecmemory_id, region, searchCriteriaSearches for and retrieves memory records from an AgentCore Memory resource based on specified search criteria. We recommend using pagination to ensure that the operation returns quickly and successfully. To use this operation, you must have the bedrock-agentcore:RetrieveMemoryRecords permission.

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 identifier of the AgentCore Memory resource from which to retrieve memory records.
memory_record_idstringThe identifier of the memory record to delete.
regionstringAWS region (default: us-east-1)
namespacestringThe namespace of the memory record to delete. This value is used for IAM condition key authorization.

SELECT examples

Retrieves a specific memory record from an AgentCore Memory resource. To use this operation, you must have the bedrock-agentcore:GetMemoryRecord permission.

SELECT
content,
created_at,
memory_record_id,
memory_strategy_id,
metadata,
namespaces
FROM aws.bedrock_agentcore.memory_records
WHERE memory_id = '{{ memory_id }}' -- required
AND memory_record_id = '{{ memory_record_id }}' -- required
AND region = '{{ region }}' -- required
AND namespace = '{{ namespace }}'
;

DELETE examples

Deletes a memory record from an AgentCore Memory resource. When you delete a memory record, it is permanently removed. To use this operation, you must have the bedrock-agentcore:DeleteMemoryRecord permission.

DELETE FROM aws.bedrock_agentcore.memory_records
WHERE memory_id = '{{ memory_id }}' --required
AND memory_record_id = '{{ memory_record_id }}' --required
AND region = '{{ region }}' --required
AND namespace = '{{ namespace }}'
;

Lifecycle Methods

Creates multiple memory records in a single batch operation for the specified memory with custom content.

EXEC aws.bedrock_agentcore.memory_records.batch_create_memory_records
@memory_id='{{ memory_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"records": "{{ records }}",
"clientToken": "{{ clientToken }}"
}'
;