interface MemoryProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.BedrockAgentCore.MemoryProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbedrockagentcore#MemoryProps |
Java | software.amazon.awscdk.services.bedrockagentcore.MemoryProps |
Python | aws_cdk.aws_bedrockagentcore.MemoryProps |
TypeScript (source) | aws-cdk-lib » aws_bedrockagentcore » MemoryProps |
Properties for creating a Memory resource.
Example
// Create a Kinesis Data Stream
const stream = new kinesis.Stream(this, 'MemoryEventStream', {
streamName: 'memory-events',
});
const memory = new agentcore.Memory(this, 'MemoryWithStreamDelivery', {
memoryName: 'memory_with_stream',
description: 'Memory with Kinesis stream delivery',
expirationDuration: cdk.Duration.days(90),
streamDeliveryResources: [
agentcore.StreamDeliveryResource.kinesis(stream, {
contentConfigurations: [
{
type: agentcore.StreamDeliveryContentType.MEMORY_RECORDS,
level: agentcore.StreamDeliveryContentLevel.METADATA_ONLY,
},
],
}),
],
});
Properties
| Name | Type | Description |
|---|---|---|
| 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 | 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}. |
| 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. |
| stream | Stream[] | Stream delivery resources for real-time push-based streaming of memory record lifecycle events (created, updated, deleted) to Amazon Kinesis Data Streams. |
| tags? | { [string]: string } | Tags (optional) A list of key:value pairs of tags to apply to this memory resource. |
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 days)
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.
memoryName?
Type:
string
(optional, default: auto generate)
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}.
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.
streamDeliveryResources?
Type:
Stream[]
(optional, default: No stream delivery (events are not pushed to Kinesis))
Stream delivery resources for real-time push-based streaming of memory record lifecycle events (created, updated, deleted) to Amazon Kinesis Data Streams.
The memory execution role will automatically be granted write permissions to each stream.
Only one stream delivery resource is currently supported (CloudFormation maximum);
providing more than one fails at synth with TooManyStreamDeliveryResources:
declare const stream: kinesis.IStream;
new agentcore.Memory(this, 'Memory', {
streamDeliveryResources: [
agentcore.StreamDeliveryResource.kinesis(stream, {
contentConfigurations: [{
type: agentcore.StreamDeliveryContentType.MEMORY_RECORDS,
level: agentcore.StreamDeliveryContentLevel.METADATA_ONLY,
}],
}),
],
});
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 (