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();
 
  • 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

      @Stability(Stable) @Nullable public Grant grant(@NotNull IGrantable grantee)
      Grants the necessary permissions to the role.

      [disable-awslint:no-grants]

      Specified by:
      grant in interface IMemoryStrategy
      Parameters:
      grantee -
      • The grantee to grant permissions to.
      This parameter is required.
      Returns:
      The Grant object for chaining
    • render

      @Stability(Stable) @NotNull public CfnMemory.MemoryStrategyProperty render()
      Renders the network configuration as a CloudFormation property.

      Specified by:
      render in interface IMemoryStrategy
      Returns:
      The CloudFormation property for the memory strategy.
    • getNamespaces

      @Stability(Stable) @NotNull public List<String> getNamespaces()
      The namespaces for the strategy.
    • getStrategyName

      @Stability(Stable) @NotNull public String getStrategyName()
      The name of the memory strategy.
      Specified by:
      getStrategyName in interface IMemoryStrategy
    • getStrategyType

      @Stability(Stable) @NotNull public MemoryStrategyType getStrategyType()
      The type of memory strategy.
      Specified by:
      getStrategyType in interface IMemoryStrategy
    • getConsolidationOverride

      @Stability(Stable) @Nullable public OverrideConfig getConsolidationOverride()
      The configuration for the custom consolidation.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the memory strategy.
      Specified by:
      getDescription in interface IMemoryStrategy
    • getExtractionOverride

      @Stability(Stable) @Nullable public OverrideConfig getExtractionOverride()
      The configuration for the custom extraction.
    • getReflectionConfiguration

      @Stability(Stable) @Nullable public EpisodicReflectionConfiguration getReflectionConfiguration()
      The configuration for episodic reflection.