aws / aws/bedrock-agentcore-starter-toolkit
[BUG] MemoryClient.update_memory_strategies does not pass memoryExecutionRoleArn to UpdateMemory API
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
Describe the bug
MemoryClient.update_memory_strategies() calls self.gmcp_client.update_memory() but never includes the memoryExecutionRoleArn parameter. The UpdateMemory API now requires this field when
adding strategies that invoke models (e.g., custom episodic strategies with extraction/consolidation/reflection prompts). This causes all add_custom_episodic_strategy calls to fail with a
ValidationException.
The same issue affects add_custom_episodic_strategy_and_wait since it delegates to update_memory_strategies.
To Reproduce
1. Install bedrock-agentcore==0.3.5
2. Create a memory resource with mode=STM_AND_LTM
3. Attempt to add a custom episodic strategy:
from bedrock_agentcore.memory.client import MemoryClient
client = MemoryClient(region_name="us-east-1")
client.add_custom_episodic_strategy_and_wait(
memory_id="",
name="my_episodic",
extraction_config={"prompt": "...", "modelId": "us.anthropic.claude-haiku-4-5-20251001-v1:0"},
consolidation_config={"prompt": "...", "modelId": "us.anthropic.claude-haiku-4-5-20251001-v1:0"},
reflection_config={
"prompt": "...",
"modelId": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
"namespaces": ["/strategies/{memoryStrategyId}/actors/{actorId}/"],
},
description="Cross-session pattern learning",
namespaces=["/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}/"],
)
4. See error
Expected behavior
The episodic strategy should be created successfully. The update_memory call in update_memory_strategies should pass memoryExecutionRoleArn (either from the memory resource's existing
config, or as a new parameter on update_memory_strategies / add_custom_episodic_strategy).
Error Output
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the UpdateMemory operation: Validation failed during UpdateMemory: Please provide
memoryExecutionRoleArn
Environment:
- OS: Amazon Linux 2023 (AgentCore runtime) / macOS 15.5
- Python version: 3.13
- Package version: bedrock-agentcore 0.3.5 (also reproduced on 0.1.0)
- Installation method: pip
Additional context
The root cause is in MemoryClient.update_memory_strategies() — the update_memory call only passes memoryId, memoryStrategies, and clientToken:
response = self.gmcp_client.update_memory(
memoryId=memory_id,
memoryStrategies=memory_strategies,
clientToken=str(uuid.uuid4()),
)
The UpdateMemory API accepts memoryExecutionRoleArn as a parameter (confirmed via boto3 bedrock-agentcore-control service model), and it's required when adding strategies that invoke
models.
Workaround: Call boto3.client("bedrock-agentcore-control").update_memory() directly with memoryExecutionRoleArn included.
Contributor guide
Research direction
Start at MemoryClient.update_memory_strategies, then trace add_custom_episodic_strategy_and_wait and add_custom_episodic_strategy, which delegate to it. Compare the client call with the boto3 bedrock-agentcore-control service model and determine how memoryExecutionRoleArn should be obtained or exposed. Done means custom episodic strategies can be added without the reported ValidationException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100