AWS Security ChangesHomeSearch

AWS bedrock-agentcore documentation change

Service: bedrock-agentcore · 2026-04-01 · Documentation low

File: bedrock-agentcore/latest/devguide/long-term-enabling-long-term-memory.md

Summary

Updated documentation for enabling long-term memory in AgentCore, changing from starter toolkit examples to AgentCore CLI and AWS SDK (boto3) examples, with updated method names and workflow changes.

Security assessment

The changes are primarily about updating API method names (get_or_create_memory to create_memory, update_memory_strategies to update_memory) and switching from a starter toolkit to official AWS SDK examples. There is no mention of security vulnerabilities, patches, or security incidents. The changes appear to be routine documentation updates for API changes or tooling improvements.

Diff

diff --git a/bedrock-agentcore/latest/devguide/long-term-enabling-long-term-memory.md b/bedrock-agentcore/latest/devguide/long-term-enabling-long-term-memory.md
index 3833d7dbc..4cc4dbeeb 100644
--- a//bedrock-agentcore/latest/devguide/long-term-enabling-long-term-memory.md
+++ b//bedrock-agentcore/latest/devguide/long-term-enabling-long-term-memory.md
@@ -13 +13 @@ You can enable long-term memory in two ways: by adding strategies when you first
-The most direct method is to include strategies when you create a new AgentCore Memory. After calling `get_or_create_memory`, you must wait for the AgentCore Memory status to become `ACTIVE` before you can use it.
+The most direct method is to include strategies when you create a new AgentCore Memory. After calling `create_memory`, you must wait for the AgentCore Memory status to become `ACTIVE` before you can use it.
@@ -15 +15 @@ The most direct method is to include strategies when you create a new AgentCore
-###### Example Create a new AgentCore Memory
+AgentCore CLI
@@ -17 +16,0 @@ The most direct method is to include strategies when you create a new AgentCore
-Starter toolkit CLI
@@ -19,0 +19,2 @@ Starter toolkit CLI
+    agentcore add memory --name PersonalizedShoppingAgentMemory --strategies USER_PREFERENCE
+    agentcore deploy
@@ -21,4 +22 @@ Starter toolkit CLI
-    agentcore memory create PersonalizedShoppingAgentMemory \
-      --region us-west-2 \
-      --strategies '[{"userPreferenceMemoryStrategy": {"name": "UserShoppingPreferences", "namespaceTemplates": ["/users/{actorId}/preferences/"]}}]' \
-      --wait
+Interactive
@@ -26 +23,0 @@ Starter toolkit CLI
-Starter toolkit
@@ -27,0 +25 @@ Starter toolkit
+Run `agentcore` to open the TUI, then select **add** and choose **Memory** :
@@ -28,0 +27 @@ Starter toolkit
+  1. Select the **User preference** strategy:
@@ -30,2 +29 @@ Starter toolkit
-    from bedrock_agentcore_starter_toolkit.operations.memory.manager import MemoryManager
-    from bedrock_agentcore_starter_toolkit.operations.memory.models.strategies import UserPreferenceStrategy
+![Memory wizard: select USER_PREFERENCE strategy](/images/bedrock-agentcore/latest/devguide/images/tui/memory-add-strategies.png)
@@ -33,2 +31 @@ Starter toolkit
-    # Create memory manager
-    memory_manager = MemoryManager(region_name="us-west-2")
+  2. Review the configuration and press Enter to confirm:
@@ -36,10 +33 @@ Starter toolkit
-    # Create memory resource with user preference strategy
-    memory = memory_manager.get_or_create_memory(
-        name="PersonalizedShoppingAgentMemory",
-        strategies=[
-            UserPreferenceStrategy(
-                name="UserShoppingPreferences",
-                namespace_templates=["/users/{actorId}/preferences/"]
-            )
-        ]
-    )
+![Memory wizard: confirm memory configuration](/images/bedrock-agentcore/latest/devguide/images/tui/memory-add-confirm.png)
@@ -47,2 +34,0 @@ Starter toolkit
-    memory_id = memory.get('id')
-    print(f"Memory resource is now ACTIVE with ID: {memory_id}")
@@ -51,0 +38 @@ Starter toolkit
+Then run `agentcore deploy` to provision the memory in AWS.
@@ -55 +42 @@ Starter toolkit
-To add long-term capabilities to an existing AgentCore Memory, you use the `update_memory_strategies` operation. You can add, modify or delete strategies for an existing memory.
+To add long-term capabilities to an existing AgentCore Memory, you use the `update_memory` operation. You can add, modify or delete strategies for an existing memory.
@@ -59 +46 @@ To add long-term capabilities to an existing AgentCore Memory, you use the `upda
-The starter toolkit CLI currently supports creating and managing memory resources. To update memory strategies on an existing memory, use the starter toolkit Python API or AWS SDK.
+The AgentCore CLI supports creating and managing memory resources. To update memory strategies on an existing memory, use the AWS SDK.
@@ -64,2 +51 @@ The starter toolkit CLI currently supports creating and managing memory resource
-    from bedrock_agentcore_starter_toolkit.operations.memory.manager import MemoryManager
-    from bedrock_agentcore_starter_toolkit.operations.memory.models.strategies import SummaryStrategy
+    import boto3
@@ -67,2 +53,2 @@ The starter toolkit CLI currently supports creating and managing memory resource
-    # Create memory manager
-    memory_manager = MemoryManager(region_name="us-west-2")
+    # Initialize the Boto3 client for control plane operations
+    control_client = boto3.client('bedrock-agentcore-control', region_name='us-west-2')
@@ -73,9 +59,12 @@ The starter toolkit CLI currently supports creating and managing memory resource
-    summaryStrategy = SummaryStrategy(
-        name="SessionSummarizer",
-        description="Summarizes conversation sessions for context",
-        namespace_templates=["/summaries/{actorId}/{sessionId}/"]
-    )
-                      
-    memory = memory_manager.update_memory_strategies(
-        memory_id=memory_id,
-        add_strategies=[summaryStrategy]
+    # Update the memory to add a summary strategy
+    response = control_client.update_memory(
+        memoryId=memory_id,
+        memoryStrategies=[
+            {
+                'summaryMemoryStrategy': {
+                    'name': 'SessionSummarizer',
+                    'description': 'Summarizes conversation sessions for context',
+                    'namespaceTemplates': ['/summaries/{actorId}/{sessionId}/']
+                }
+            }
+        ]
@@ -86,3 +75,4 @@ The starter toolkit CLI currently supports creating and managing memory resource
-    # Validate startegy was added to the memory
-    memory_strategies = memory_manager.get_memory_strategies(memoryId=memory_id)
-    print(f"Memory strategies for memoryID: {memory_id} are: {memory_strategies}")
+    # Validate strategy was added to the memory
+    memory_response = control_client.get_memory(memoryId=memory_id)
+    strategies = memory_response.get('memory', {}).get('strategies', [])
+    print(f"Memory strategies for memoryID: {memory_id} are: {strategies}")