class ManagedMemoryStrategy
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.ManagedMemoryStrategy |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#ManagedMemoryStrategy |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.ManagedMemoryStrategy |
Python | aws_cdk.aws_bedrock_agentcore_alpha.ManagedMemoryStrategy |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป ManagedMemoryStrategy |
Implements
IMemory
Managed memory strategy that handles both built-in and override configurations.
This strategy can be used for quick setup with built-in defaults or customized with specific models and prompt templates.
Example
// Create a custom semantic memory strategy
const customSemanticStrategy = agentcore.MemoryStrategy.usingSemantic({
name: "customSemanticStrategy",
description: "Custom semantic memory strategy",
namespaces: ["/custom/strategies/{memoryStrategyId}/actors/{actorId}"],
customConsolidation: {
model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
appendToPrompt: "Custom consolidation prompt for semantic memory",
},
customExtraction: {
model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
appendToPrompt: "Custom extraction prompt for semantic memory",
},
});
// Create memory with custom strategy
const memory = new agentcore.Memory(this, "MyMemory", {
memoryName: "my-custom-memory",
description: "Memory with custom strategy",
expirationDuration: cdk.Duration.days(90),
memoryStrategies: [customSemanticStrategy],
});
Initializer
new ManagedMemoryStrategy(strategyType: MemoryStrategyType, props: ManagedStrategyProps)
Parameters
- strategyType
Memoryโ the strategy type.Strategy Type - props
Managedโ the properties for the strategy.Strategy Props
Constructor to create a new managed memory strategy.
Properties
| Name | Type | Description |
|---|---|---|
| name | string | The name of the memory strategy. |
| namespaces | string[] | The namespaces for the strategy. |
| strategy | Memory | The type of memory strategy. |
| consolidation | Override | The configuration for the custom consolidation. |
| description? | string | The description of the memory strategy. |
| extraction | Override | The configuration for the custom extraction. |
name
Type:
string
The name of the memory strategy.
namespaces
Type:
string[]
The namespaces for the strategy.
strategyType
Type:
Memory
The type of memory strategy.
consolidationOverride?
Type:
Override
(optional)
The configuration for the custom consolidation.
description?
Type:
string
(optional)
The description of the memory strategy.
extractionOverride?
Type:
Override
(optional)
The configuration for the custom extraction.
Methods
| Name | Description |
|---|---|
| grant(grantee) | Grants the necessary permissions to the role. |
| render() | Renders the network configuration as a CloudFormation property. |
grant(grantee)
public grant(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The grantee to grant permissions to.
Returns
Grants the necessary permissions to the role.
render()
public render(): MemoryStrategyProperty
Returns
Renders the network configuration as a CloudFormation property.

.NET
Go
Java
Python
TypeScript (