AWS Security ChangesHomeSearch

AWS bedrock-agentcore documentation change

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

File: bedrock-agentcore/latest/devguide/memory-get-started.md

Summary

Updated documentation to replace AgentCore starter toolkit with AgentCore CLI, added Node.js prerequisite, changed installation and deployment commands, added new section 'Adding memory to an existing agent' with integration steps, and updated cleanup instructions.

Security assessment

The changes are procedural updates for tooling and workflow improvements. No security vulnerabilities, patches, or security incidents are mentioned. The updates focus on changing from a starter toolkit to a CLI tool, adding new integration steps, and updating code examples. No security features or security-related configurations were added or modified.

Diff

diff --git a/bedrock-agentcore/latest/devguide/memory-get-started.md b/bedrock-agentcore/latest/devguide/memory-get-started.md
index 4cd9cafb1..48a2d3310 100644
--- a//bedrock-agentcore/latest/devguide/memory-get-started.md
+++ b//bedrock-agentcore/latest/devguide/memory-get-started.md
@@ -5 +5 @@
-PrerequisitesStep 1: Create an AgentCore MemoryStep 2: Write events to memoryStep 3: Retrieve records from long term memoryCleanupNext steps
+PrerequisitesStep 1: Create an AgentCore MemoryStep 2: Write events to memoryStep 3: Retrieve records from long term memoryAdding memory to an existing agentCleanupNext steps
@@ -9 +9 @@ PrerequisitesStep 1: Create an AgentCore MemoryStep 2: Write events to memorySte
-Amazon Bedrock Amazon Bedrock AgentCore Memory lets you create and manage AgentCore Memory resources that store conversation context for your AI agents. This getting started guides you through installing dependencies and implementing both short-term and long-term memory features. The instructions use the [AgentCore starter toolkit](https://github.com/aws/bedrock-agentcore-starter-toolkit).
+Amazon Bedrock Amazon Bedrock AgentCore Memory lets you create and manage AgentCore Memory resources that store conversation context for your AI agents. This getting started guides you through installing dependencies and implementing both short-term and long-term memory features. The instructions use the AgentCore CLI.
@@ -31,0 +32 @@ Before starting, make sure you have:
+  * Node.js 18+ installed (for the AgentCore CLI)
@@ -35 +35,0 @@ Before starting, make sure you have:
-To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, make a folder for this quick start, create a virtual environment, and install the dependencies. The below command can be run directly in the terminal.
@@ -36,0 +37 @@ To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, make a folde
+To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, install the dependencies, create an AgentCore CLI project, and set up a virtual environment. The below commands can be run directly in the terminal.
@@ -38 +39,4 @@ To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, make a folde
-    mkdir agentcore-memory-quickstart
+    
+    pip install bedrock-agentcore
+    npm install -g @aws/agentcore
+    agentcore create --name agentcore-memory-quickstart --no-agent
@@ -42,2 +45,0 @@ To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, make a folde
-    pip install bedrock-agentcore
-    pip install bedrock-agentcore-starter-toolkit
@@ -45 +47 @@ To get started with Amazon Bedrock Amazon Bedrock AgentCore Memory, make a folde
-The starter toolkit includes a CLI (`agentcore`) for memory resource management. The CLI provides commands for creating, listing, getting, and deleting memory resources. For event operations and session management, use the starter toolkit Python API or AWS SDK.
+The AgentCore CLI provides commands for creating and managing memory resources. Use `agentcore add memory` to create a memory, and `agentcore deploy` to provision it in AWS. For event operations and session management, use the AWS Python SDK (Boto3) (`bedrock-agentcore`).
@@ -49 +51 @@ The starter toolkit includes a CLI (`agentcore`) for memory resource management.
-The Amazon Bedrock AgentCore Starter Toolkit is intended to help developers get started quickly. For the complete set of Amazon Bedrock AgentCore Memory operations, see the Boto3 documentation: [bedrock-agentcore-control](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agentcore-control.html) and [bedrock-agentcore](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agentcore.html).
+The AgentCore CLI helps you create and deploy memory resources. For the complete set of Amazon Bedrock AgentCore Memory operations, see the Boto3 documentation: [bedrock-agentcore-control](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agentcore-control.html) and [bedrock-agentcore](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agentcore.html).
@@ -51 +53 @@ The Amazon Bedrock AgentCore Starter Toolkit is intended to help developers get
-**Full example:** See the [complete code example](https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/documentation/docs/examples/semantic_search.md) that demonstrates steps 1-3.
+**Full example:** See the [Amazon Bedrock AgentCore samples](https://github.com/awslabs/amazon-bedrock-agentcore-samples/tree/main/01-tutorials) that demonstrate steps 1-3.
@@ -59 +61 @@ In this step, you create an AgentCore Memory with a semantic strategy so that bo
-Starter toolkit CLI
+Create memory with semantic strategy:
@@ -60,0 +63 @@ Starter toolkit CLI
+AgentCore CLI
@@ -62 +64,0 @@ Starter toolkit CLI
-Create memory with semantic strategy:
@@ -65,5 +67,2 @@ Create memory with semantic strategy:
-    agentcore memory create CustomerSupportSemantic \
-      --region us-west-2 \
-      --description "Customer support memory store" \
-      --strategies '[{"semanticMemoryStrategy": {"name": "semanticLongTermMemory", "namespaceTemplates": ["/strategies/{memoryStrategyId}/actors/{actorId}/"]}}]' \
-      --wait
+    agentcore add memory --name CustomerSupportSemantic --strategies SEMANTIC
+    agentcore deploy
@@ -71 +70 @@ Create memory with semantic strategy:
-List memories to verify creation:
+Interactive
@@ -74 +73 @@ List memories to verify creation:
-    agentcore memory list --region us-west-2
+Run `agentcore` to open the TUI, then select **add** and choose **Memory** :
@@ -76 +75 @@ List memories to verify creation:
-Starter toolkit
+  1. Enter the memory name:
@@ -77,0 +77 @@ Starter toolkit
+![Memory wizard: enter name](/images/bedrock-agentcore/latest/devguide/images/tui/memory-add-name.png)
@@ -78,0 +79 @@ Starter toolkit
+  2. Select the **Semantic** strategy, then confirm:
@@ -80,5 +81 @@ Starter toolkit
-    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 SemanticStrategy
-    import time
+![Memory wizard: select SEMANTIC strategy](/images/bedrock-agentcore/latest/devguide/images/tui/memory-add-strategies.png)
@@ -86 +82,0 @@ Starter toolkit
-    memory_manager = MemoryManager(region_name="us-west-2")
@@ -88 +83,0 @@ Starter toolkit
-    print("Creating memory resource...")
@@ -90,10 +84,0 @@ Starter toolkit
-    memory = memory_manager.get_or_create_memory(
-        name="CustomerSupportSemantic",
-        description="Customer support memory store",
-        strategies=[
-            SemanticStrategy(
-                name="semanticLongTermMemory",
-                namespace_templates=['/strategies/{memoryStrategyId}/actors/{actorId}/'],
-            )
-        ]
-    )
@@ -101 +86 @@ Starter toolkit
-    print(f"Memory ID: {memory.get('id')}")
+Then run `agentcore deploy` to provision the memory in AWS.
@@ -103 +88 @@ Starter toolkit
-You can call `list_memories` to see that the memory resource has been created with:
+After deployment, verify the memory was created:
@@ -106 +91 @@ You can call `list_memories` to see that the memory resource has been created wi
-    memories = memory_manager.list_memories()
+    agentcore status
@@ -116,0 +102,11 @@ The memory resource id, actor id, and session id are required to create an event
+    import boto3
+    from bedrock_agentcore.memory import MemorySessionManager
+    from bedrock_agentcore.memory.constants import ConversationalMessage, MessageRole
+    
+    control_client = boto3.client('bedrock-agentcore-control', region_name='us-west-2')
+    
+    # Retrieve the memory created in Step 1
+    response = control_client.list_memories()
+    memory = response['memories'][0]
+    memory_id = memory['id']
+    
@@ -119 +115 @@ The memory resource id, actor id, and session id are required to create an event
-        memory_id=memory.get("id"),
+        memory_id=memory_id,
@@ -188 +184 @@ Important information about the user is likely stored is long term memory. Agent
-## Cleanup
+## Adding memory to an existing agent
@@ -190 +186,3 @@ Important information about the user is likely stored is long term memory. Agent
-When you're done with the memory resource, you can delete it:
+If you created a Strands agent without memory and want to add it later, follow these steps:
+
+  1. Add a memory resource to your project:
@@ -192 +190,2 @@ When you're done with the memory resource, you can delete it:
-Starter toolkit CLI
+        agentcore add memory --name MyMemory --strategies SEMANTIC,SUMMARIZATION
+    agentcore deploy
@@ -193,0 +193 @@ Starter toolkit CLI
+  2. Create the `memory/` directory in your agent:
@@ -194,0 +195 @@ Starter toolkit CLI
+        mkdir -p app/MyAgent/memory
@@ -196 +197 @@ Starter toolkit CLI
-    agentcore memory delete <memory-id> --region us-west-2 --wait
+  3. Create `app/`MyAgent`/memory/session.py`:
@@ -198 +199,4 @@ Starter toolkit CLI
-Starter toolkit
+        import os
+    from typing import Optional
+    from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig, RetrievalConfig
+    from bedrock_agentcore.memory.integrations.strands.session_manager import AgentCoreMemorySessionManager
@@ -199,0 +204,54 @@ Starter toolkit
+    MEMORY_ID = os.getenv("MEMORY_MYMEMORY_ID")
+    REGION = os.getenv("AWS_REGION")
+    
+    def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
+        if not MEMORY_ID:
+            return None
+    
+        retrieval_config = {
+            f"/users/{actor_id}/facts": RetrievalConfig(top_k=3, relevance_score=0.5),
+            f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5)
+        }
+    
+        return AgentCoreMemorySessionManager(
+            AgentCoreMemoryConfig(
+                memory_id=MEMORY_ID,
+                session_id=session_id,
+                actor_id=actor_id,
+                retrieval_config=retrieval_config,
+            ),
+            REGION
+        )
+
+  4. Update your `main.py` to use the session manager:
+    
+        from memory.session import get_memory_session_manager
+    
+    @app.entrypoint
+    async def invoke(payload, context):
+        session_id = getattr(context, 'session_id', 'default-session')
+        user_id = getattr(context, 'user_id', 'default-user')
+    
+        agent = Agent(
+            model=load_model(),
+            session_manager=get_memory_session_manager(session_id, user_id),
+            system_prompt="You are a helpful assistant.",
+        )
+    
+        response = agent(payload.get("prompt"))
+        return response
+
+  5. Deploy the updated project:
+    
+        agentcore deploy
+
+
+
+
+###### Note
+
+Each memory resource gets an environment variable `MEMORY_`<NAME>`_ID` (uppercase, with underscores) that is automatically available in your agent's runtime environment after deployment.
+
+## Cleanup
+
+When you're done with the memory resource, you can delete it:
@@ -202,2 +260,2 @@ Starter toolkit
-    # Delete the memory resource
-    memory_manager.delete_memory(memory_id=memory.get("id"))
+    agentcore remove memory --name CustomerSupportSemantic
+    agentcore deploy
@@ -207 +265 @@ Starter toolkit
-Consider the following::
+Consider the following: