AWS Security ChangesHomeSearch

AWS bedrock-agentcore documentation change

Service: bedrock-agentcore · 2025-10-19 · Documentation medium

File: bedrock-agentcore/latest/devguide/memory-create-a-memory-store.md

Summary

Rewrote documentation with expanded code examples for creating AgentCore Memory using Python SDK, AWS SDK, and console. Added detailed encryption configuration using KMS keys and memory strategy implementations.

Security assessment

Added documentation about encrypting memory stores using AWS KMS keys (step 6.2 in console instructions), which demonstrates security feature usage. However, there's no evidence this addresses a specific security vulnerability - it's standard security documentation.

Diff

diff --git a/bedrock-agentcore/latest/devguide/memory-create-a-memory-store.md b/bedrock-agentcore/latest/devguide/memory-create-a-memory-store.md
index 495ec3876..b527fc9cb 100644
--- a//bedrock-agentcore/latest/devguide/memory-create-a-memory-store.md
+++ b//bedrock-agentcore/latest/devguide/memory-create-a-memory-store.md
@@ -19 +19 @@ When creating an AgentCore Memory, consider the following factors to maintain it
-For examples that show how to create a AgentCore Memory, see the following:
+Starter toolkit
@@ -21 +20,0 @@ For examples that show how to create a AgentCore Memory, see the following:
-  * [Get started with AgentCore Memory](./memory-get-started.html)
@@ -23 +22 @@ For examples that show how to create a AgentCore Memory, see the following:
-  * [Enable long-term memory](./long-term-enabling-long-term-memory.html)
+for the full example, see [Get started with AgentCore Memory](./memory-get-started.html).
@@ -25 +24,140 @@ For examples that show how to create a AgentCore Memory, see the following:
-  * [Amazon Bedrock AgentCore Memory examples](./memory-examples.html)
+    
+    from bedrock_agentcore_starter_toolkit.operations.memory.manager import MemoryManager
+    from bedrock_agentcore.memory.session import MemorySessionManager
+    from bedrock_agentcore.memory.constants import ConversationalMessage, MessageRole
+    from bedrock_agentcore_starter_toolkit.operations.memory.models.strategies import SummaryStrategy, UserPreferenceStrategy
+    import time
+    
+    # Create memory manager
+    memory_manager = MemoryManager(region_name="us-west-2")
+    
+    print("Creating a new memory resource and waiting for it to become active...")
+    
+    # Create memory resource with summary and user preference strategy
+    memory = memory_manager.get_or_create_memory(
+        name="ShoppingSupportAgentMemory",
+        description="Memory for a customer support agent.",
+        strategies=[
+            SummaryStrategy(
+                name="SessionSummarizer",
+                namespaces=["/summaries/{actorId}/{sessionId}"]
+            ),
+            UserPreferenceStrategy(
+                name="PreferenceLearner",
+                namespaces=["/users/{actorId}/preferences"]
+            )
+        ]
+    )
+    
+    memory_id = memory.get('id')
+    print(f"Memory resource is now ACTIVE with ID: {memory_id}")
+
+AgentCore python SDK
+    
+
+For more information, see [Amazon Bedrock AgentCore SDK](./agentcore-sdk-memory.html).
+    
+    
+    from bedrock_agentcore.memory import MemoryClient
+    import time
+    
+    client = MemoryClient(region_name="us-east-1")
+    
+    memory = client.create_memory_and_wait(
+        name="MyAgentMemory",
+        strategies=[{
+            "summaryMemoryStrategy": {
+                # Name of the extraction model/strategy
+                "name": "SessionSummarizer",
+                # Organize facts by session ID for easy retrieval
+                # Example: "summaries/session123" contains summary of session123
+                "namespaces": ["/summaries/{actorId}/{sessionId}"]
+            }
+        }]
+    )
+                        
+
+AWS SDK
+    
+
+For more information, see [AWS SDK](./aws-sdk-memory.html).
+    
+    
+    import boto3
+    import time
+    
+    # Initialize the Boto3 clients for control plane and data plane operations
+    control_client = boto3.client('bedrock-agentcore-control')
+    data_client = boto3.client('bedrock-agentcore')
+    
+    print("Creating a new memory resource...")
+    
+    # Create the memory resource with defined strategies
+    response = control_client.create_memory(
+        name="ShoppingSupportAgentMemory",
+        description="Memory for a customer support agent.",
+        memoryStrategies=[
+            {
+                'summaryMemoryStrategy': {
+                    'name': 'SessionSummarizer',
+                    'namespaces': ['/summaries/{actorId}/{sessionId}']
+                }
+            },
+            {
+                'userPreferenceMemoryStrategy': {
+                    'name': 'UserPreferenceExtractor',
+                    'namespaces': ['/users/{actorId}/preferences']
+                }
+            }
+        ]
+    )
+    
+    memory_id = response['memory']['id']
+    print(f"Memory resource created with ID: {memory_id}")
+    
+    # Poll the memory status until it becomes ACTIVE
+    while True:
+        mem_status_response = control_client.get_memory(memoryId=memory_id)
+        status = mem_status_response.get('memory', {}).get('status')
+        if status == 'ACTIVE':
+            print("Memory resource is now ACTIVE.")
+            break
+        elif status == 'FAILED':
+            raise Exception("Memory resource creation FAILED.")
+        print("Waiting for memory to become active...")
+        time.sleep(10)
+
+Console
+    
+
+###### To create an AgentCore memory
+
+  1. Open the [Amazon Bedrock AgentCore](https://console.aws.amazon.com/bedrock-agentcore/) console.
+
+  2. In the left navigation pane, choose **Memory**.
+
+  3. Choose **Create memory**.
+
+  4. For **Memory name** enter a name for the AgentCore Memory.
+
+  5. (Optional) For **Short-term memory (raw event) expiration** set the duration (days), for which the AgentCore Memory will store events.
+
+  6. (Optional) In **Additional configurations** set the following:
+
+    1. For **Memory description** , enter a description for the AgentCore Memory. 
+
+    2. If you want to use your own AWS KMS key to encrypt your data, do the following:
+
+      1. In **KMS key** , choose **Customize encryption settings (advanced)**.
+
+      2. In **Choose an AWS KMS key** choose or enter the ARN of an existing AWS KMS key. Alternatively, choose **Create an AWS KMS** to create a new AWS KMS key.
+
+  7. (Optional) For **Long-term memory extraction strategies** choose one or more [memory strategies](./memory-strategies.html). For more information: 
+
+     * [Built-in strategies](./built-in-strategies.html)
+
+     * [Built-in with overrides strategy](./memory-custom-strategy.html)
+
+     * [Self-managed strategy](./memory-self-managed-strategies.html)
+
+  8. Choose **Create memory** to create the AgentCore Memory.
@@ -38 +176 @@ Get started with AgentCore Memory
-Use short-term memory
+Encrypt your Amazon Bedrock AgentCore Memory