interface MemoryProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.MemoryProps |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#MemoryProps |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.MemoryProps |
Python | aws_cdk.aws_bedrock_agentcore_alpha.MemoryProps |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป MemoryProps |
Properties for creating a Memory resource.
Example
// Create a custom execution role
const executionRole = new iam.Role(this, "MemoryExecutionRole", {
assumedBy: new iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
managedPolicies: [
iam.ManagedPolicy.fromAwsManagedPolicyName(
"AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy"
),
],
});
// Create memory with custom execution role
const memory = new agentcore.Memory(this, "MyMemory", {
memoryName: "my_memory",
description: "Memory with custom execution role",
expirationDuration: cdk.Duration.days(90),
executionRole: executionRole,
});
Properties
| Name | Type | Description |
|---|---|---|
| memory | string | The name of the memory Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}. |
| description? | string | Optional description for the memory Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters. |
| execution | IRole | The IAM role that provides permissions for the memory to access AWS services when using custom strategies. |
| expiration | Duration | Short-term memory expiration in days (between 7 and 365). |
| kms | IKey | Custom KMS key to use for encryption. |
| memory | IMemory[] | If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events. |
| tags? | { [string]: string } | Tags (optional) A list of key:value pairs of tags to apply to this memory resource. |
memoryName
Type:
string
The name of the memory Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.
description?
Type:
string
(optional, default: No description)
Optional description for the memory Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.
executionRole?
Type:
IRole
(optional, default: A new role will be created.)
The IAM role that provides permissions for the memory to access AWS services when using custom strategies.
expirationDuration?
Type:
Duration
(optional, default: 90)
Short-term memory expiration in days (between 7 and 365).
Sets the short-term (raw event) memory retention. Events older than the specified duration will expire and no longer be stored.
kmsKey?
Type:
IKey
(optional, default: Your data is encrypted with a key that AWS owns and manages for you)
Custom KMS key to use for encryption.
memoryStrategies?
Type:
IMemory[]
(optional, default: No extraction strategies (short term memory only))
If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events.
tags?
Type:
{ [string]: string }
(optional, default: {} no tags)
Tags (optional) A list of key:value pairs of tags to apply to this memory resource.

.NET
Go
Java
Python
TypeScript (