memory_records
Creates, updates, deletes, gets or lists a memory_records resource.
Overview
| Name | memory_records |
| Type | Resource |
| Id | aws.bedrock_agentcore.memory_records |
Fields
The following fields are returned by SELECT queries:
- get_memory_record
- list_memory_records
| Name | Datatype | Description |
|---|---|---|
content | object | The content of the memory record. |
created_at | string (date-time) | The timestamp when the memory record was created. |
memory_record_id | string | The unique identifier of the memory record. (pattern: <code>mem-[a-zA-Z0-9-_]*</code>) |
memory_strategy_id | string | The identifier of the memory strategy associated with this record. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-_]*</code>) |
metadata | object | A map of metadata key-value pairs associated with a memory record. |
namespaces | array | The namespaces associated with this memory record. Namespaces help organize and categorize memory records. |
| Name | Datatype | Description |
|---|---|---|
content | object | The content of the memory record. |
created_at | string (date-time) | The timestamp when the memory record was created. |
memory_record_id | string | The unique identifier of the memory record. (pattern: <code>mem-[a-zA-Z0-9-_]*</code>) |
memory_strategy_id | string | The identifier of the memory strategy associated with this record. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-_]*</code>) |
metadata | object | A map of metadata key-value pairs associated with a memory record. |
namespaces | array | The namespaces associated with this memory record. |
score | number (double) | The relevance score of the memory record when returned as part of a search result. Higher values indicate greater relevance to the search query. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_memory_record | select | memory_id, memory_record_id, region | namespace | Retrieves a specific memory record from an AgentCore Memory resource. To use this operation, you must have the bedrock-agentcore:GetMemoryRecord permission. |
list_memory_records | select | memory_id, region | Lists 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_record | delete | memory_id, memory_record_id, region | namespace | 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. |
batch_create_memory_records | exec | memory_id, region, records | Creates multiple memory records in a single batch operation for the specified memory with custom content. | |
batch_delete_memory_records | exec | memory_id, region, records | Deletes multiple memory records in a single batch operation from the specified memory. | |
batch_update_memory_records | exec | memory_id, region, records | Updates multiple memory records with custom content in a single batch operation within the specified memory. | |
retrieve_memory_records | exec | memory_id, region, searchCriteria | Searches 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.
| Name | Datatype | Description |
|---|---|---|
memory_id | string | The identifier of the AgentCore Memory resource from which to retrieve memory records. |
memory_record_id | string | The identifier of the memory record to delete. |
region | string | AWS region (default: us-east-1) |
namespace | string | The namespace of the memory record to delete. This value is used for IAM condition key authorization. |
SELECT examples
- get_memory_record
- list_memory_records
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 }}'
;
Lists 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.
SELECT
content,
created_at,
memory_record_id,
memory_strategy_id,
metadata,
namespaces,
score
FROM aws.bedrock_agentcore.memory_records
WHERE memory_id = '{{ memory_id }}' -- required
AND region = '{{ region }}' -- required
;
DELETE examples
- delete_memory_record
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
- batch_create_memory_records
- batch_delete_memory_records
- batch_update_memory_records
- retrieve_memory_records
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 }}"
}'
;
Deletes multiple memory records in a single batch operation from the specified memory.
EXEC aws.bedrock_agentcore.memory_records.batch_delete_memory_records
@memory_id='{{ memory_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"records": "{{ records }}"
}'
;
Updates multiple memory records with custom content in a single batch operation within the specified memory.
EXEC aws.bedrock_agentcore.memory_records.batch_update_memory_records
@memory_id='{{ memory_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"records": "{{ records }}"
}'
;
Searches 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.
EXEC aws.bedrock_agentcore.memory_records.retrieve_memory_records
@memory_id='{{ memory_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"namespace": "{{ namespace }}",
"namespacePath": "{{ namespacePath }}",
"searchCriteria": "{{ searchCriteria }}",
"nextToken": "{{ nextToken }}",
"maxResults": {{ maxResults }}
}'
;