Interface SelfManagedStrategyProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, MemoryStrategyCommonProps
All Known Implementing Classes:
SelfManagedStrategyProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.506Z") @Stability(Stable) public interface SelfManagedStrategyProps extends software.amazon.jsii.JsiiSerializable, MemoryStrategyCommonProps
Configuration parameters for a self managed memory strategy existing built-in default prompts/models.

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

    • getInvocationConfiguration

      @Stability(Stable) @NotNull InvocationConfiguration getInvocationConfiguration()
      Invocation configuration for self managed memory strategy.
    • getHistoricalContextWindowSize

      @Stability(Stable) @Nullable default Number getHistoricalContextWindowSize()
      Define the number of previous events to be included when processing memory.

      A larger history window provides more context from past conversations.

      Default: 4

    • getTriggerConditions

      @Stability(Stable) @Nullable default TriggerConditions getTriggerConditions()
      Trigger conditions for self managed memory strategy.

      Default: - undefined

    • builder

      @Stability(Stable) static SelfManagedStrategyProps.Builder builder()
      Returns:
      a SelfManagedStrategyProps.Builder of SelfManagedStrategyProps