memories
Creates, updates, deletes, gets or lists a memories resource.
Overview
| Name | memories |
| Type | Resource |
| Id | aws.bedrock_agentcore_control.memories |
Fields
The following fields are returned by SELECT queries:
- get_memory
- list_memories
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the memory. (pattern: <code>[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>) |
name | string | The name of the memory. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>) |
arn | string | The 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_at | string (date-time) | The timestamp when the memory was created. |
description | string | The description of the memory. |
encryption_key_arn | string | The 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_duration | integer | The number of days after which memory events will expire. |
failure_reason | string | The reason for failure if the memory is in a failed state. |
indexed_keys | array | The indexed metadata keys for this memory. Only indexed keys can be used in metadata filters. |
managed_by_resource_arn | string | ARN 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_arn | string | The 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_keys | array | The namespace variable key definitions for this memory. Namespace keys define custom variables used in namespaceTemplates with optional validation rules. |
status | string | The current status of the memory. (CREATING, ACTIVE, FAILED, DELETING, UPDATING) |
strategies | array | The list of memory strategies associated with this memory. |
stream_delivery_resources | object | Configuration for streaming memory record data to external resources. |
updated_at | string (date-time) | The timestamp when the memory was last updated. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the memory. (pattern: <code>[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>) |
arn | string | The 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_at | string (date-time) | The timestamp when the memory was created. |
managed_by_resource_arn | string | ARN of the resource managing this memory (e.g. a harness). Null if not managed. (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>) |
status | string | The current status of the memory. (CREATING, ACTIVE, FAILED, DELETING, UPDATING) |
updated_at | string (date-time) | The timestamp when the memory was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_memory | select | memory_id, region | view | Retrieve an existing Amazon Bedrock AgentCore Memory resource. |
list_memories | select | region | Lists the available Amazon Bedrock AgentCore Memory resources in the current Amazon Web Services Region. | |
create_memory | insert | region, name, eventExpiryDuration | Creates a new Amazon Bedrock AgentCore Memory resource. | |
update_memory | update | memory_id, region | Update an Amazon Bedrock AgentCore Memory resource memory. | |
delete_memory | delete | memory_id, region | clientToken | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
memory_id | string | The unique identifier of the memory to delete. |
region | string | AWS region (default: us-east-1) |
clientToken | string | A 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. |
view | string | The level of detail to return for the memory. |
SELECT examples
- get_memory
- list_memories
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 }}'
;
Lists the available Amazon Bedrock AgentCore Memory resources in the current Amazon Web Services Region.
SELECT
id,
arn,
created_at,
managed_by_resource_arn,
status,
updated_at
FROM aws.bedrock_agentcore_control.memories
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_memory
- Manifest
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
;
# Description fields are for documentation purposes
- name: memories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the memories resource.
- name: clientToken
value: "{{ clientToken }}"
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: encryptionKeyArn
value: "{{ encryptionKeyArn }}"
- name: memoryExecutionRoleArn
value: "{{ memoryExecutionRoleArn }}"
- name: eventExpiryDuration
value: {{ eventExpiryDuration }}
- name: memoryStrategies
value:
- semanticMemoryStrategy:
name: "{{ name }}"
description: "{{ description }}"
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
summaryMemoryStrategy:
name: "{{ name }}"
description: "{{ description }}"
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
userPreferenceMemoryStrategy:
name: "{{ name }}"
description: "{{ description }}"
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
customMemoryStrategy:
name: "{{ name }}"
description: "{{ description }}"
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
configuration:
semanticOverride:
extraction:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
consolidation:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
summaryOverride:
consolidation:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
userPreferenceOverride:
extraction:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
consolidation:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
episodicOverride:
extraction:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
consolidation:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
reflection:
appendToPrompt: "{{ appendToPrompt }}"
modelId: "{{ modelId }}"
namespaces: "{{ namespaces }}"
namespaceTemplates: "{{ namespaceTemplates }}"
memoryRecordSchema: "{{ memoryRecordSchema }}"
selfManagedConfiguration:
triggerConditions:
- messageBasedTrigger:
messageCount: {{ messageCount }}
tokenBasedTrigger:
tokenCount: {{ tokenCount }}
timeBasedTrigger:
idleSessionTimeout: {{ idleSessionTimeout }}
invocationConfiguration:
topicArn: "{{ topicArn }}"
payloadDeliveryBucketName: "{{ payloadDeliveryBucketName }}"
historicalContextWindowSize: {{ historicalContextWindowSize }}
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
episodicMemoryStrategy:
name: "{{ name }}"
description: "{{ description }}"
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
reflectionConfiguration:
namespaces:
- "{{ namespaces }}"
namespaceTemplates:
- "{{ namespaceTemplates }}"
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
memoryRecordSchema:
metadataSchema:
- key: "{{ key }}"
type_: "{{ type_ }}"
extractionType: "{{ extractionType }}"
extractionConfig:
llmExtractionConfig: "{{ llmExtractionConfig }}"
- name: indexedKeys
value:
- key: "{{ key }}"
type_: "{{ type_ }}"
- name: namespaceKeys
value:
- key: "{{ key }}"
validation:
allowedValues:
- "{{ allowedValues }}"
regexPattern: "{{ regexPattern }}"
- name: streamDeliveryResources
description: |
Configuration for streaming memory record data to external resources.
value:
resources:
- kinesis:
dataStreamArn: "{{ dataStreamArn }}"
contentConfigurations:
- type_: "{{ type_ }}"
level: "{{ level }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_memory
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
- delete_memory
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 }}'
;