ManagedMemoryStrategy
- class aws_cdk.aws_bedrock_agentcore_alpha.ManagedMemoryStrategy(strategy_type, *, namespaces, custom_consolidation=None, custom_extraction=None, reflection_configuration=None, name, description=None)
Bases:
object(experimental) Managed memory strategy that handles both built-in and override configurations.
This strategy can be used for quick setup with built-in defaults or customized with specific models and prompt templates.
- Stability:
experimental
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha import aws_cdk.aws_bedrock_alpha as bedrock_alpha # bedrock_invokable: bedrock_alpha.IBedrockInvokable managed_memory_strategy = bedrock_agentcore_alpha.ManagedMemoryStrategy(bedrock_agentcore_alpha.MemoryStrategyType.SUMMARIZATION, name="name", namespaces=["namespaces"], # the properties below are optional custom_consolidation=bedrock_agentcore_alpha.OverrideConfig( append_to_prompt="appendToPrompt", model=bedrock_invokable ), custom_extraction=bedrock_agentcore_alpha.OverrideConfig( append_to_prompt="appendToPrompt", model=bedrock_invokable ), description="description", reflection_configuration=bedrock_agentcore_alpha.EpisodicReflectionConfiguration( namespaces=["namespaces"] ) )
(experimental) Constructor to create a new managed memory strategy.
- Parameters:
strategy_type (
MemoryStrategyType) – the strategy type.namespaces (
Sequence[str]) – (experimental) The namespaces for the strategy Represents a namespace for organizing memory data Use a hierarchical format separated by forward slashes (/). Use a hierarchical format separated by forward slashes (/) to organize namespaces logically. You can include these defined variables: - {sessionId} - the user identifier to be created in the CreateEvent API - {memoryStrategyId} - an identifier for an extraction strategy - {sessionId} - an identifier for each session Example namespace path: /strategies/{memoryStrategyId}/actions/{actionId}/sessions/{sessionId} After memory creation, this namespace might look like: /actor/actor-3afc5aa8fef9/strategy/summarization-fy5c5fwc7/session/session-qj7tpd1kvr8custom_consolidation (
Union[OverrideConfig,Dict[str,Any],None]) – (experimental) The configuration for the custom consolidation. This configuration provides customization to how the model identifies and extracts relevant information for memory storage. Default: - No custom extractioncustom_extraction (
Union[OverrideConfig,Dict[str,Any],None]) – (experimental) The configuration for the custom extraction. This configuration provides customization to how the model identifies and extracts relevant information for memory storage. Default: - No custom extractionreflection_configuration (
Union[EpisodicReflectionConfiguration,Dict[str,Any],None]) – (experimental) Configuration for episodic memory reflection (only applicable for EPISODIC strategy type) Defines additional namespaces for reflection-based episodic recall. Default: - No reflection configurationname (
str) – (experimental) The name for the strategy.description (
Optional[str]) – (experimental) The description of the strategy. Default: - No description
- Stability:
experimental
Methods
- grant(grantee)
(experimental) Grants the necessary permissions to the role.
[disable-awslint:no-grants]
- Parameters:
grantee (
IGrantable) –The grantee to grant permissions to.
- Return type:
Optional[Grant]- Returns:
The Grant object for chaining
- Stability:
experimental
- render()
(experimental) Renders the network configuration as a CloudFormation property.
- Return type:
- Returns:
The CloudFormation property for the memory strategy.
- Stability:
experimental
Attributes
- consolidation_override
(experimental) The configuration for the custom consolidation.
- Stability:
experimental
- description
(experimental) The description of the memory strategy.
- Stability:
experimental
- extraction_override
(experimental) The configuration for the custom extraction.
- Stability:
experimental
- name
(experimental) The name of the memory strategy.
- Stability:
experimental
- namespaces
(experimental) The namespaces for the strategy.
- Stability:
experimental
- reflection_configuration
(experimental) The configuration for episodic reflection.
- Stability:
experimental
- strategy_type
(experimental) The type of memory strategy.
- Stability:
experimental