Class SelfManagedMemoryStrategy

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.SelfManagedMemoryStrategy
All Implemented Interfaces:
IMemoryStrategy, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.505Z") @Stability(Stable) public class SelfManagedMemoryStrategy extends software.amazon.jsii.JsiiObject implements IMemoryStrategy
Use AgentCore memory for event storage with custom triggers.

Define memory processing logic in your own environment.

Example:

 Bucket bucket = Bucket.Builder.create(this, "memoryBucket")
         .bucketName("test-memory")
         .removalPolicy(RemovalPolicy.DESTROY)
         .autoDeleteObjects(true)
         .build();
 Topic topic = new Topic(this, "topic");
 // Create a custom semantic memory strategy
 SelfManagedMemoryStrategy selfManagedStrategy = MemoryStrategy.usingSelfManaged(SelfManagedStrategyProps.builder()
         .strategyName("selfManagedStrategy")
         .description("self managed memory strategy")
         .historicalContextWindowSize(5)
         .invocationConfiguration(InvocationConfiguration.builder()
                 .topic(topic)
                 .s3Location(Location.builder()
                         .bucketName(bucket.getBucketName())
                         .objectKey("memory/")
                         .build())
                 .build())
         .triggerConditions(TriggerConditions.builder()
                 .messageBasedTrigger(1)
                 .timeBasedTrigger(Duration.seconds(10))
                 .tokenBasedTrigger(100)
                 .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(selfManagedStrategy))
         .build();
 
  • Constructor Details

    • SelfManagedMemoryStrategy

      protected SelfManagedMemoryStrategy(software.amazon.jsii.JsiiObjectRef objRef)
    • SelfManagedMemoryStrategy

      protected SelfManagedMemoryStrategy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • SelfManagedMemoryStrategy

      @Stability(Stable) public SelfManagedMemoryStrategy(@NotNull MemoryStrategyType strategyType, @NotNull SelfManagedStrategyProps props)
      Parameters:
      strategyType - The type of memory strategy. This parameter is required.
      props - 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 internal attributes to CloudFormation.
      Specified by:
      render in interface IMemoryStrategy
    • getHistoricalContextWindowSize

      @Stability(Stable) @NotNull public Number getHistoricalContextWindowSize()
      Historical context window size for self managed memory strategy.
    • getInvocationConfiguration

      @Stability(Stable) @NotNull public InvocationConfiguration getInvocationConfiguration()
      Invocation configuration for self managed memory 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
    • getTriggerConditions

      @Stability(Stable) @NotNull public TriggerConditions getTriggerConditions()
      Trigger conditions for self managed memory strategy.
    • getDescription

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