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.130.0 (build 048a5ee)", date="2026-05-19T19:44:37.154Z") @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 custom execution role
 Role executionRole = Role.Builder.create(this, "MemoryExecutionRole")
         .assumedBy(new ServicePrincipal("bedrock-agentcore.amazonaws.com"))
         .managedPolicies(List.of(ManagedPolicy.fromAwsManagedPolicyName("AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy")))
         .build();
 // Create memory with custom execution role
 Memory memory = Memory.Builder.create(this, "MyMemory")
         .memoryName("my_memory")
         .description("Memory with custom execution role")
         .expirationDuration(Duration.days(90))
         .executionRole(executionRole)
         .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.
    • 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.
    • 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