MemoryProps

class aws_cdk.aws_bedrock_agentcore_alpha.MemoryProps(*, memory_name, description=None, execution_role=None, expiration_duration=None, kms_key=None, memory_strategies=None, tags=None)

Bases: object

(experimental) Properties for creating a Memory resource.

Parameters:
  • memory_name (str) – (experimental) The name of the memory Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.

  • description (Optional[str]) – (experimental) Optional description for the memory Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters. Default: No description

  • execution_role (Optional[IRole]) – (experimental) The IAM role that provides permissions for the memory to access AWS services when using custom strategies. Default: A new role will be created.

  • expiration_duration (Optional[Duration]) – (experimental) Short-term memory expiration in days (between 7 and 365). Sets the short-term (raw event) memory retention. Events older than the specified duration will expire and no longer be stored. Default: 90

  • kms_key (Optional[IKey]) – (experimental) Custom KMS key to use for encryption. Default: Your data is encrypted with a key that AWS owns and manages for you

  • memory_strategies (Optional[Sequence[IMemoryStrategy]]) – (experimental) If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events. Default: No extraction strategies (short term memory only)

  • tags (Optional[Mapping[str, str]]) – (experimental) Tags (optional) A list of key:value pairs of tags to apply to this memory resource. Default: {} no tags

Stability:

experimental

ExampleMetadata:

fixture=default infused

Example:

# Create a custom execution role
execution_role = iam.Role(self, "MemoryExecutionRole",
    assumed_by=iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
    managed_policies=[
        iam.ManagedPolicy.from_aws_managed_policy_name("AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy")
    ]
)

# Create memory with custom execution role
memory = agentcore.Memory(self, "MyMemory",
    memory_name="my_memory",
    description="Memory with custom execution role",
    expiration_duration=cdk.Duration.days(90),
    execution_role=execution_role
)

Attributes

description

(experimental) Optional description for the memory Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.

Default:

No description

Stability:

experimental

Required:
  • No

execution_role

(experimental) The IAM role that provides permissions for the memory to access AWS services when using custom strategies.

Default:

A new role will be created.

Stability:

experimental

Required:
  • No

expiration_duration

(experimental) Short-term memory expiration in days (between 7 and 365).

Sets the short-term (raw event) memory retention. Events older than the specified duration will expire and no longer be stored.

Default:

90

Stability:

experimental

Required:
  • No

kms_key

(experimental) Custom KMS key to use for encryption.

Default:

Your data is encrypted with a key that AWS owns and manages for you

Stability:

experimental

Required:
  • No

memory_name

[a-zA-Z][a-zA-Z0-9_]{0,47}.

Stability:

experimental

Required:
  • No

Type:

(experimental) The name of the memory Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern

memory_strategies

(experimental) If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events.

Default:

No extraction strategies (short term memory only)

Stability:

experimental

Required:
  • No

tags

value pairs of tags to apply to this memory resource.

Default:

{} no tags

Stability:

experimental

Required:
  • No

Type:

(experimental) Tags (optional) A list of key