Class ManagedMemoryStrategy
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.ManagedMemoryStrategy
- All Implemented Interfaces:
IMemoryStrategy,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.130.0 (build 048a5ee)",
date="2026-05-19T19:44:37.150Z")
@Stability(Stable)
public class ManagedMemoryStrategy
extends software.amazon.jsii.JsiiObject
implements IMemoryStrategy
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
ManagedMemoryStrategy customSemanticStrategy = MemoryStrategy.usingSemantic(ManagedStrategyProps.builder()
.strategyName("customSemanticStrategy")
.description("Custom semantic memory strategy")
.namespaces(List.of("/custom/strategies/{memoryStrategyId}/actors/{actorId}"))
.customConsolidation(OverrideConfig.builder()
.model(FoundationModel.fromFoundationModelId(this, "ConsolidationModel", FoundationModelIdentifier.ANTHROPIC_CLAUDE_3_5_SONNET_20241022_V2_0))
.appendToPrompt("Custom consolidation prompt for semantic memory")
.build())
.customExtraction(OverrideConfig.builder()
.model(FoundationModel.fromFoundationModelId(this, "ExtractionModel", FoundationModelIdentifier.ANTHROPIC_CLAUDE_3_5_SONNET_20241022_V2_0))
.appendToPrompt("Custom extraction prompt for semantic memory")
.build())
.build());
// Create memory with custom strategy
Memory memory = Memory.Builder.create(this, "MyMemory")
.memoryName("my-custom-memory")
.description("Memory with custom strategy")
.expirationDuration(Duration.days(90))
.memoryStrategies(List.of(customSemanticStrategy))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrockagentcore.IMemoryStrategy
IMemoryStrategy.Jsii$Default, IMemoryStrategy.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionManagedMemoryStrategy(MemoryStrategyType strategyType, ManagedStrategyProps props) Constructor to create a new managed memory strategy.protectedManagedMemoryStrategy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedManagedMemoryStrategy(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe configuration for the custom consolidation.The description of the memory strategy.The configuration for the custom extraction.The namespaces for the strategy.The configuration for episodic reflection.The name of the memory strategy.The type of memory strategy.grant(IGrantable grantee) Grants the necessary permissions to the role.render()Renders the network configuration as a CloudFormation property.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ManagedMemoryStrategy
protected ManagedMemoryStrategy(software.amazon.jsii.JsiiObjectRef objRef) -
ManagedMemoryStrategy
protected ManagedMemoryStrategy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ManagedMemoryStrategy
@Stability(Stable) public ManagedMemoryStrategy(@NotNull MemoryStrategyType strategyType, @NotNull ManagedStrategyProps props) Constructor to create a new managed memory strategy.- Parameters:
strategyType- the strategy type. This parameter is required.props- the properties for the strategy. This parameter is required.
-
-
Method Details
-
grant
Grants the necessary permissions to the role.[disable-awslint:no-grants]
- Specified by:
grantin interfaceIMemoryStrategy- Parameters:
grantee-- The grantee to grant permissions to.
- Returns:
- The Grant object for chaining
-
render
Renders the network configuration as a CloudFormation property.- Specified by:
renderin interfaceIMemoryStrategy- Returns:
- The CloudFormation property for the memory strategy.
-
getNamespaces
The namespaces for the strategy. -
getStrategyName
The name of the memory strategy.- Specified by:
getStrategyNamein interfaceIMemoryStrategy
-
getStrategyType
The type of memory strategy.- Specified by:
getStrategyTypein interfaceIMemoryStrategy
-
getConsolidationOverride
The configuration for the custom consolidation. -
getDescription
The description of the memory strategy.- Specified by:
getDescriptionin interfaceIMemoryStrategy
-
getExtractionOverride
The configuration for the custom extraction. -
getReflectionConfiguration
The configuration for episodic reflection.
-