ManagedStrategyProps

class aws_cdk.aws_bedrockagentcore.ManagedStrategyProps(*, strategy_name, description=None, namespaces, custom_consolidation=None, custom_extraction=None, reflection_configuration=None)

Bases: MemoryStrategyCommonProps

Configuration parameters for a memory strategy that can override existing built-in default prompts/models.

Parameters:
  • strategy_name (str) – The name for the strategy.

  • description (Optional[str]) – The description of the strategy. Default: - No description

  • namespaces (Sequence[str]) – 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-qj7tpd1kvr8

  • custom_consolidation (Union[OverrideConfig, Dict[str, Any], None]) – 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 extraction

  • custom_extraction (Union[OverrideConfig, Dict[str, Any], None]) – 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 extraction

  • reflection_configuration (Union[EpisodicReflectionConfiguration, Dict[str, Any], None]) – Configuration for episodic memory reflection (only applicable for EPISODIC strategy type) Defines additional namespaces for reflection-based episodic recall. Default: - No reflection configuration

ExampleMetadata:

fixture=default infused

Example:

# Create memory with custom strategies
memory = agentcore.Memory(self, "MyMemory",
    memory_name="my_memory",
    description="Memory with custom strategies",
    expiration_duration=cdk.Duration.days(90),
    memory_strategies=[
        agentcore.MemoryStrategy.using_user_preference(
            strategy_name="CustomerPreferences",
            namespaces=["support/customer/{actorId}/preferences"]
        ),
        agentcore.MemoryStrategy.using_semantic(
            strategy_name="CustomerSupportSemantic",
            namespaces=["support/customer/{actorId}/semantic"]
        ),
        agentcore.MemoryStrategy.using_episodic(
            strategy_name="customerJourneyEpisodic",
            namespaces=["/journey/customer/{actorId}/episodes"],
            reflection_configuration=agentcore.EpisodicReflectionConfiguration(
                namespaces=["/journey/customer/{actorId}/reflections"]
            )
        )
    ]
)

Attributes

custom_consolidation

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 extraction

custom_extraction

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 extraction

description

The description of the strategy.

Default:
  • No description

namespaces

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-qj7tpd1kvr8

reflection_configuration

Configuration for episodic memory reflection (only applicable for EPISODIC strategy type) Defines additional namespaces for reflection-based episodic recall.

Default:
  • No reflection configuration

strategy_name

The name for the strategy.