java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrock.agentcore.alpha.MemoryBase
All Implemented Interfaces:
IEnvironmentAware, IResource, IMemory, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
Memory

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:27:03.643Z") @Stability(Experimental) public abstract class MemoryBase extends Resource implements IMemory
(experimental) Abstract base class for a Memory.

Contains methods and attributes valid for Memories either created with CDK or imported.

  • Constructor Details

    • MemoryBase

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

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

      @Stability(Experimental) protected MemoryBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • grant

      @Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      (experimental) Grants IAM actions to the IAM Principal.

      Specified by:
      grant in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant permissions to.
      This parameter is required.
      actions -
      • The actions to grant.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantAdmin

      @Stability(Experimental) @NotNull public Grant grantAdmin(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to manage the control plane of this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:CreateMemory', 'bedrock-agentcore:GetMemory', 'bedrock-agentcore:DeleteMemory', 'bedrock-agentcore:UpdateMemory'] on this.memoryArn

      Specified by:
      grantAdmin in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant admin permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantDelete

      @Stability(Experimental) @NotNull public Grant grantDelete(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to delete content on this memory.

      Both Short-Term Memory (STM) and Long-Term Memory (LTM).

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:DeleteEvent', 'bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn

      Specified by:
      grantDelete in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant delete permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantDeleteLongTermMemory

      @Stability(Experimental) @NotNull public Grant grantDeleteLongTermMemory(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn

      Specified by:
      grantDeleteLongTermMemory in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant delete permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantDeleteShortTermMemory

      @Stability(Experimental) @NotNull public Grant grantDeleteShortTermMemory(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:DeleteEvent'] on this.memoryArn

      Specified by:
      grantDeleteShortTermMemory in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant delete permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantFullAccess

      @Stability(Experimental) @NotNull public Grant grantFullAccess(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to do every action on this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:CreateEvent', 'bedrock-agentcore:GetEvent', 'bedrock-agentcore:DeleteEvent', 'bedrock-agentcore:GetMemoryRecord', 'bedrock-agentcore:RetrieveMemoryRecords', 'bedrock-agentcore:ListMemoryRecords', 'bedrock-agentcore:ListActors', 'bedrock-agentcore:ListSessions', 'bedrock-agentcore:CreateMemory', 'bedrock-agentcore:GetMemory', 'bedrock-agentcore:DeleteMemory', 'bedrock-agentcore:UpdateMemory'] on this.memoryArn

      Specified by:
      grantFullAccess in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant full access permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantRead

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to read the contents of this memory.

      Both Short-Term Memory (STM) and Long-Term Memory (LTM).

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:GetMemoryRecord', 'bedrock-agentcore:RetrieveMemoryRecords', 'bedrock-agentcore:ListMemoryRecords', 'bedrock-agentcore:ListActors', 'bedrock-agentcore:ListSessions] on this.memoryArn

      Specified by:
      grantRead in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantReadLongTermMemory

      @Stability(Experimental) @NotNull public Grant grantReadLongTermMemory(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:GetMemoryRecord', 'bedrock-agentcore:RetrieveMemoryRecords', 'bedrock-agentcore:ListMemoryRecords', 'bedrock-agentcore:ListActors', 'bedrock-agentcore:ListSessions',] on this.memoryArn

      Specified by:
      grantReadLongTermMemory in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantReadShortTermMemory

      @Stability(Experimental) @NotNull public Grant grantReadShortTermMemory(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:GetEvent', 'bedrock-agentcore:ListEvents', 'bedrock-agentcore:ListActors', 'bedrock-agentcore:ListSessions',] on this.memoryArn

      Specified by:
      grantReadShortTermMemory in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantWrite

      @Stability(Experimental) @NotNull public Grant grantWrite(@NotNull IGrantable grantee)
      (experimental) Grant the given principal identity permissions to write content to short-term memory.

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:CreateEvent'] on this.memoryArn

      Specified by:
      grantWrite in interface IMemory
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • metric

      @Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName, @NotNull Map<String,String> dimensions, @Nullable MetricOptions props)
      (experimental) Return the given named metric for this memory.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface IMemory
      Parameters:
      metricName - This parameter is required.
      dimensions - This parameter is required.
      props -
    • metric

      @Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName, @NotNull Map<String,String> dimensions)
      (experimental) Return the given named metric for this memory.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface IMemory
      Parameters:
      metricName - This parameter is required.
      dimensions - This parameter is required.
    • metricErrorsForApiOperation

      @Stability(Experimental) @NotNull public Metric metricErrorsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      (experimental) Return a metric containing the number of errors for a specific API operation performed on this memory.

      Specified by:
      metricErrorsForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
      props -
    • metricErrorsForApiOperation

      @Stability(Experimental) @NotNull public Metric metricErrorsForApiOperation(@NotNull String operation)
      (experimental) Return a metric containing the number of errors for a specific API operation performed on this memory.

      Specified by:
      metricErrorsForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
    • metricEventCreationCount

      @Stability(Experimental) @NotNull public Metric metricEventCreationCount(@Nullable MetricOptions props)
      (experimental) Returns the metric containing the number of short-term memory events.

      Specified by:
      metricEventCreationCount in interface IMemory
      Parameters:
      props -
    • metricEventCreationCount

      @Stability(Experimental) @NotNull public Metric metricEventCreationCount()
      (experimental) Returns the metric containing the number of short-term memory events.
      Specified by:
      metricEventCreationCount in interface IMemory
    • metricForApiOperation

      @Stability(Experimental) @NotNull public Metric metricForApiOperation(@NotNull String metricName, @NotNull String operation, @Nullable MetricOptions props)
      (experimental) Return the given named metric related to the API operation performed on this memory.

      Specified by:
      metricForApiOperation in interface IMemory
      Parameters:
      metricName - This parameter is required.
      operation - This parameter is required.
      props -
    • metricForApiOperation

      @Stability(Experimental) @NotNull public Metric metricForApiOperation(@NotNull String metricName, @NotNull String operation)
      (experimental) Return the given named metric related to the API operation performed on this memory.

      Specified by:
      metricForApiOperation in interface IMemory
      Parameters:
      metricName - This parameter is required.
      operation - This parameter is required.
    • metricInvocationsForApiOperation

      @Stability(Experimental) @NotNull public Metric metricInvocationsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      (experimental) Return a metric containing the total number of API requests made for a specific memory operation like CreateEvent, ListEvents, RetrieveMemoryRecords ...

      Specified by:
      metricInvocationsForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
      props -
    • metricInvocationsForApiOperation

      @Stability(Experimental) @NotNull public Metric metricInvocationsForApiOperation(@NotNull String operation)
      (experimental) Return a metric containing the total number of API requests made for a specific memory operation like CreateEvent, ListEvents, RetrieveMemoryRecords ...

      Specified by:
      metricInvocationsForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
    • metricLatencyForApiOperation

      @Stability(Experimental) @NotNull public Metric metricLatencyForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      (experimental) Return a metric measuring the latency of a specific API operation performed on this memory.

      The latency metric represents the total time elapsed between receiving the request and sending the final response token, measuring complete end-to-end processing time.

      For memory creation events specifically, this measures the time from the last CreateEvent that met strategy criteria until memory storage is completed.

      Specified by:
      metricLatencyForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
      props -
    • metricLatencyForApiOperation

      @Stability(Experimental) @NotNull public Metric metricLatencyForApiOperation(@NotNull String operation)
      (experimental) Return a metric measuring the latency of a specific API operation performed on this memory.

      The latency metric represents the total time elapsed between receiving the request and sending the final response token, measuring complete end-to-end processing time.

      For memory creation events specifically, this measures the time from the last CreateEvent that met strategy criteria until memory storage is completed.

      Specified by:
      metricLatencyForApiOperation in interface IMemory
      Parameters:
      operation - This parameter is required.
    • metricMemoryRecordCreationCount

      @Stability(Experimental) @NotNull public Metric metricMemoryRecordCreationCount(@Nullable MetricOptions props)
      (experimental) Returns the metric containing the number of long-term memory records created by the long-term extraction strategies.

      Parameters:
      props -
    • metricMemoryRecordCreationCount

      @Stability(Experimental) @NotNull public Metric metricMemoryRecordCreationCount()
      (experimental) Returns the metric containing the number of long-term memory records created by the long-term extraction strategies.
    • getGrantPrincipal

      @Stability(Experimental) @NotNull public abstract IPrincipal getGrantPrincipal()
      (experimental) The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getMemoryArn

      @Stability(Experimental) @NotNull public abstract String getMemoryArn()
      (experimental) The ARN of the memory resource.
      Specified by:
      getMemoryArn in interface IMemory
    • getMemoryId

      @Stability(Experimental) @NotNull public abstract String getMemoryId()
      (experimental) The id of the memory.
      Specified by:
      getMemoryId in interface IMemory
    • getCreatedAt

      @Stability(Experimental) @Nullable public abstract String getCreatedAt()
      (experimental) Timestamp when the memory was created.
      Specified by:
      getCreatedAt in interface IMemory
    • getExecutionRole

      @Stability(Experimental) @Nullable public abstract IRole getExecutionRole()
      (experimental) The IAM role that provides permissions for the memory to access AWS services.
      Specified by:
      getExecutionRole in interface IMemory
    • getKmsKey

      @Stability(Experimental) @Nullable public abstract IKey getKmsKey()
      (experimental) Custom KMS key for encryption (if provided).
      Specified by:
      getKmsKey in interface IMemory
    • getStatus

      @Stability(Experimental) @Nullable public abstract String getStatus()
      (experimental) The status of the memory.
      Specified by:
      getStatus in interface IMemory
    • getUpdatedAt

      @Stability(Experimental) @Nullable public abstract String getUpdatedAt()
      (experimental) Timestamp when the memory was last updated.
      Specified by:
      getUpdatedAt in interface IMemory