OverrideConfig

class aws_cdk.aws_bedrock_agentcore_alpha.OverrideConfig(*, append_to_prompt, model)

Bases: object

(experimental) Configuration for overriding model and prompt template.

Parameters:
  • append_to_prompt (str) – (experimental) The prompt that will be appended to the system prompt to define the model’s memory consolidation/extraction strategy. This configuration provides customization to how the model identifies and extracts relevant information for memory storage. You can use the default user prompt or create a customized one.

  • model (IBedrockInvokable) – (experimental) The model to use for consolidation/extraction.

Stability:

experimental

ExampleMetadata:

fixture=default infused

Example:

# Create a custom semantic memory strategy
custom_semantic_strategy = agentcore.MemoryStrategy.using_semantic(
    name="customSemanticStrategy",
    description="Custom semantic memory strategy",
    namespaces=["/custom/strategies/{memoryStrategyId}/actors/{actorId}"],
    custom_consolidation=agentcore.OverrideConfig(
        model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
        append_to_prompt="Custom consolidation prompt for semantic memory"
    ),
    custom_extraction=agentcore.OverrideConfig(
        model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
        append_to_prompt="Custom extraction prompt for semantic memory"
    )
)

# Create memory with custom strategy
memory = agentcore.Memory(self, "MyMemory",
    memory_name="my-custom-memory",
    description="Memory with custom strategy",
    expiration_duration=cdk.Duration.days(90),
    memory_strategies=[custom_semantic_strategy]
)

Attributes

append_to_prompt

(experimental) The prompt that will be appended to the system prompt to define the model’s memory consolidation/extraction strategy.

This configuration provides customization to how the model identifies and extracts relevant information for memory storage. You can use the default user prompt or create a customized one.

See:

https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/system-prompts.html

Stability:

experimental

model

(experimental) The model to use for consolidation/extraction.

Stability:

experimental