java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IMemoryRef, IEnvironmentAware, IResource, IMemory, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-08-19T15:41:13.626Z") @Stability(Stable) public class Memory extends MemoryBase
Long-term memory store for extracted insights like user preferences, semantic facts and summaries.

Enables knowledge retention across sessions by storing user preferences (e.g. coding style), semantic facts (e.g. learned info) and interaction summaries for context optimization.

Example:

 // Create a Kinesis Data Stream
 Stream stream = Stream.Builder.create(this, "MemoryEventStream")
         .streamName("memory-events")
         .build();
 Memory memory = Memory.Builder.create(this, "MemoryWithStreamDelivery")
         .memoryName("memory_with_stream")
         .description("Memory with Kinesis stream delivery")
         .expirationDuration(Duration.days(90))
         .streamDeliveryResources(List.of(StreamDeliveryResource.kinesis(stream, KinesisStreamDeliveryOptions.builder()
                 .contentConfigurations(List.of(StreamDeliveryContentConfiguration.builder()
                         .type(StreamDeliveryContentType.MEMORY_RECORDS)
                         .level(StreamDeliveryContentLevel.METADATA_ONLY)
                         .build()))
                 .build())))
         .build();
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Stable) public static final String PROPERTY_INJECTION_ID
      Uniquely identifies this class.
  • Constructor Details

    • Memory

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

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

      @Stability(Stable) public Memory(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable MemoryProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • Memory

      @Stability(Stable) public Memory(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromMemoryAttributes

      @Stability(Stable) @NotNull public static IMemory fromMemoryAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull MemoryAttributes attrs)
      Creates an Memory reference from an existing memory's attributes.

      Parameters:
      scope -
      • The construct scope.
      This parameter is required.
      id -
      • Identifier of the construct.
      This parameter is required.
      attrs -
      • Attributes of the existing browser custom.
      This parameter is required.
      Returns:
      An IBrowserCustom reference to the existing browser
    • addMemoryStrategy

      @Stability(Stable) public void addMemoryStrategy(@NotNull IMemoryStrategy memoryStrategy)
      Add memory strategy to the memory.

      Default: - No memory strategies.

      Parameters:
      memoryStrategy - This parameter is required.
    • addStreamDeliveryResource

      @Stability(Stable) public void addStreamDeliveryResource(@NotNull StreamDeliveryResource resource)
      Add a stream delivery resource to the memory.

      Grants Kinesis write permissions to the execution role automatically.

      Parameters:
      resource -
      • The stream delivery resource configuration.
      This parameter is required.
      See Also:
    • getGrantPrincipal

      @Stability(Stable) @NotNull public IPrincipal getGrantPrincipal()
      The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
      Specified by:
      getGrantPrincipal in class MemoryBase
    • getMemoryArn

      @Stability(Stable) @NotNull public String getMemoryArn()
      The ARN of the memory resource.
      Specified by:
      getMemoryArn in interface IMemory
      Specified by:
      getMemoryArn in class MemoryBase
    • getMemoryId

      @Stability(Stable) @NotNull public String getMemoryId()
      The id of the memory.
      Specified by:
      getMemoryId in interface IMemory
      Specified by:
      getMemoryId in class MemoryBase
    • getMemoryName

      @Stability(Stable) @NotNull public String getMemoryName()
      The name of the memory.
    • getMemoryStrategies

      @Stability(Stable) @NotNull public List<IMemoryStrategy> getMemoryStrategies()
      The memory strategies used by the memory.
    • getStreamDeliveryResources

      @Stability(Stable) @NotNull public List<StreamDeliveryResource> getStreamDeliveryResources()
      The stream delivery resources configured for this memory.
    • getCreatedAt

      @Stability(Stable) @Nullable public String getCreatedAt()
      The created timestamp of the memory.
      Specified by:
      getCreatedAt in interface IMemory
      Specified by:
      getCreatedAt in class MemoryBase
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the memory.
    • getExecutionRole

      @Stability(Stable) @Nullable public IRole getExecutionRole()
      The execution role of the memory.
      Specified by:
      getExecutionRole in interface IMemory
      Specified by:
      getExecutionRole in class MemoryBase
    • getExpirationDuration

      @Stability(Stable) @Nullable public Duration getExpirationDuration()
      The expiration days of the memory.
    • getFailureReason

      @Stability(Stable) @Nullable public String getFailureReason()
      The failure reason of the browser.
    • getKmsKey

      @Stability(Stable) @Nullable public IKey getKmsKey()
      The KMS key used to encrypt the memory.
      Specified by:
      getKmsKey in interface IMemory
      Specified by:
      getKmsKey in class MemoryBase
    • getStatus

      @Stability(Stable) @Nullable public String getStatus()
      The status of the memory.
      Specified by:
      getStatus in interface IMemory
      Specified by:
      getStatus in class MemoryBase
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      Tags applied to this browser resource A map of key-value pairs for resource tagging.

      Default: - No tags applied

    • getUpdatedAt

      @Stability(Stable) @Nullable public String getUpdatedAt()
      The updated at timestamp of the memory.
      Specified by:
      getUpdatedAt in interface IMemory
      Specified by:
      getUpdatedAt in class MemoryBase