Class: AWSCDK::BedrockAgentCore::MemoryProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/memory_props.rb

Overview

Properties for creating a Memory resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, execution_role: nil, expiration_duration: nil, kms_key: nil, memory_name: nil, memory_strategies: nil, tags: nil) ⇒ MemoryProps

Returns a new instance of MemoryProps.

Parameters:

  • description (String, nil) (defaults to: nil)

    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.

  • execution_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

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

  • expiration_duration (AWSCDK::Duration, nil) (defaults to: nil)

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

  • kms_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    Custom KMS key to use for encryption.

  • memory_name (String, nil) (defaults to: nil)

    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.

  • memory_strategies (Array<AWSCDK::BedrockAgentCore::IMemoryStrategy>, nil) (defaults to: nil)

    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.

  • tags (Hash{String => String}, nil) (defaults to: nil)

    Tags (optional) A list of key:value pairs of tags to apply to this memory resource.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'bedrock_agent_core/memory_props.rb', line 14

def initialize(description: nil, execution_role: nil, expiration_duration: nil, kms_key: nil, memory_name: nil, memory_strategies: nil, tags: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @execution_role = execution_role
  Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil?
  @expiration_duration = expiration_duration
  Jsii::Type.check_type(@expiration_duration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "expirationDuration") unless @expiration_duration.nil?
  @kms_key = kms_key
  Jsii::Type.check_type(@kms_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "kmsKey") unless @kms_key.nil?
  @memory_name = memory_name
  Jsii::Type.check_type(@memory_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "memoryName") unless @memory_name.nil?
  @memory_strategies = memory_strategies
  Jsii::Type.check_type(@memory_strategies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLklNZW1vcnlTdHJhdGVneSJ9LCJraW5kIjoiYXJyYXkifX0=")), "memoryStrategies") unless @memory_strategies.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - No description

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.

Returns:

  • (String, nil)


35
36
37
# File 'bedrock_agent_core/memory_props.rb', line 35

def description
  @description
end

#execution_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A new role will be created.

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

Returns:



40
41
42
# File 'bedrock_agent_core/memory_props.rb', line 40

def execution_role
  @execution_role
end

#expiration_durationAWSCDK::Duration? (readonly)

Note:

Default: - 90 days

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.

Returns:



48
49
50
# File 'bedrock_agent_core/memory_props.rb', line 48

def expiration_duration
  @expiration_duration
end

#kms_keyAWSCDK::KMS::IKey? (readonly)

Note:

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

Custom KMS key to use for encryption.

Returns:



53
54
55
# File 'bedrock_agent_core/memory_props.rb', line 53

def kms_key
  @kms_key
end

#memory_nameString? (readonly)

Note:

Default: - auto generate

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.

Returns:

  • (String, nil)


58
59
60
# File 'bedrock_agent_core/memory_props.rb', line 58

def memory_name
  @memory_name
end

#memory_strategiesArray<AWSCDK::BedrockAgentCore::IMemoryStrategy>? (readonly)

Note:

Default: - No extraction strategies (short term memory only)

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.



63
64
65
# File 'bedrock_agent_core/memory_props.rb', line 63

def memory_strategies
  @memory_strategies
end

#tagsHash{String => String}? (readonly)

Note:

Default: - no tags

Tags (optional) A list of key:value pairs of tags to apply to this memory resource.

Returns:

  • (Hash{String => String}, nil)


68
69
70
# File 'bedrock_agent_core/memory_props.rb', line 68

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



70
71
72
73
74
75
76
77
78
79
80
# File 'bedrock_agent_core/memory_props.rb', line 70

def self.jsii_properties
  {
    :description => "description",
    :execution_role => "executionRole",
    :expiration_duration => "expirationDuration",
    :kms_key => "kmsKey",
    :memory_name => "memoryName",
    :memory_strategies => "memoryStrategies",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'bedrock_agent_core/memory_props.rb', line 82

def to_jsii
  result = {}
  result.merge!({
    "description" => @description,
    "executionRole" => @execution_role,
    "expirationDuration" => @expiration_duration,
    "kmsKey" => @kms_key,
    "memoryName" => @memory_name,
    "memoryStrategies" => @memory_strategies,
    "tags" => @tags,
  })
  result.compact
end