AWS bedrock-agentcore documentation change
Summary
Updated documentation to replace references from 'starter toolkit CLI' and 'Amazon Bedrock AgentCore toolkit' to 'AgentCore CLI'. Simplified memory creation example from using multiple strategies (summary and user preference) to a single semantic strategy. Removed detailed starter toolkit Python SDK examples and replaced with AgentCore CLI/TUI instructions and AWS SDK examples.
Security assessment
The changes are focused on updating tooling references and simplifying the user workflow for creating and managing memory resources. There is no mention of security vulnerabilities, patches, or security incidents. The modifications are routine documentation updates to reflect changes in the product's command-line interface and available strategies.
Diff
diff --git a/bedrock-agentcore/latest/devguide/memory-customer-scenario.md b/bedrock-agentcore/latest/devguide/memory-customer-scenario.md index df9989164..a18e2f722 100644 --- a//bedrock-agentcore/latest/devguide/memory-customer-scenario.md +++ b//bedrock-agentcore/latest/devguide/memory-customer-scenario.md @@ -9 +9 @@ Step 1: Create an AgentCore MemoryStep 2: Start the sessionStep 3: Capture the c -In this section you learn how to build a customer support AI agent that uses AgentCore Memory to provide personalized assistance by maintaining conversation history and extracting long-term insights about user preferences. The topic includes code examples for the Amazon Bedrock AgentCore toolkit and the AWS SDK. +In this section you learn how to build a customer support AI agent that uses AgentCore Memory to provide personalized assistance by maintaining conversation history and extracting long-term insights about user preferences. The topic includes code examples for the AgentCore CLI and the AWS SDK. @@ -36 +36 @@ First, you create a memory resource with both short-term and long-term memory ca -Starter toolkit CLI +AgentCore CLI @@ -39 +39 @@ Starter toolkit CLI -Create memory with summary and user preference strategies: +Create memory with a semantic strategy: @@ -42,7 +42,2 @@ Create memory with summary and user preference strategies: - agentcore memory create ShoppingSupportAgentMemory \ - --region us-west-2 \ - --description "Memory for a customer support agent." \ - --strategies '[{"summaryMemoryStrategy": {"name": "SessionSummarizer", "namespaceTemplates": ["/summaries/{actorId}/{sessionId}/"]}}, {"userPreferenceMemoryStrategy": {"name": "PreferenceLearner", "namespaceTemplates": ["/users/{actorId}/preferences/"]}}]' \ - --wait - -Get memory details: + agentcore add memory --name CustomerSupportSemantic --strategies SEMANTIC + agentcore deploy @@ -49,0 +45 @@ Get memory details: +###### Note @@ -51 +47 @@ Get memory details: - agentcore memory get <memory-id> --region us-west-2 +The AgentCore CLI provides memory resource management. For event operations (creating events, listing events, etc.), use the AWS Python SDK (Boto3) or AWS SDK. @@ -53 +49 @@ Get memory details: -###### Note +Interactive @@ -55 +50,0 @@ Get memory details: -The starter toolkit CLI provides memory resource management. For event operations (creating events, listing events, etc.), use the starter toolkit Python API or AWS SDK. @@ -57 +52 @@ The starter toolkit CLI provides memory resource management. For event operation -Starter toolkit +Run `agentcore` to open the TUI, then select **add** and choose **Memory** : @@ -58,0 +54 @@ Starter toolkit + 1. Select the **Semantic** strategy: @@ -59,0 +56 @@ Starter toolkit + @@ -61,5 +58 @@ 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 SummaryStrategy, UserPreferenceStrategy - import time + 2. Review the configuration and press Enter to confirm: @@ -67,2 +60 @@ Starter toolkit - # Create memory manager - memory_manager = MemoryManager(region_name="us-west-2") + @@ -70 +61,0 @@ Starter toolkit - print("Creating a new memory resource and waiting for it to become active...") @@ -72,15 +62,0 @@ Starter toolkit - # 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", - namespace_templates=["/summaries/{actorId}/{sessionId}/"] - ), - UserPreferenceStrategy( - name="PreferenceLearner", - namespace_templates=["/users/{actorId}/preferences/"] - ) - ] - ) @@ -88,2 +63,0 @@ Starter toolkit - memory_id = memory.get('id') - print(f"Memory resource is now ACTIVE with ID: {memory_id}") @@ -96,0 +71 @@ AWS SDK + from datetime import datetime @@ -143,27 +117,0 @@ When Sarah initiates the conversation, the agent creates a new, and unique, sess -Starter toolkit - - - - # Unique identifier for the customer, Sarah - sarah_actor_id = "user-sarah-123" - - # Unique identifier for this specific support session - support_session_id = "customer-support-session-1" - - # Create session manager - session_manager = MemorySessionManager( - memory_id=memory.get("id"), - region_name="us-west-2" - ) - - # Create a session - session = session_manager.create_memory_session( - actor_id=sarah_actor_id, - session_id=support_session_id - ) - - print(f"Session started for Actor ID: {sarah_actor_id}, Session ID: {support_session_id}") - -AWS SDK - - @@ -184,21 +131,0 @@ As Sarah explains her issue, the agent captures each turn of the conversation (b -Starter toolkit - - - - print("Capturing conversational events...") - - # Add all conversation turns - session.add_turns( - messages=[ - ConversationalMessage("Hi, my order #ABC-456 is delayed.", MessageRole.USER), - ConversationalMessage("I am sorry to hear that, Sarah. Let me check the status for you.", MessageRole.ASSISTANT), - ConversationalMessage("By the way, for future orders, please always use FedEx. I've had issues with other carriers.", MessageRole.USER), - ConversationalMessage("Thank you for that information. I have made a note to use FedEx for your future shipments.", MessageRole.ASSISTANT), - ] - ) - - print("Conversation turns added successfully!") - -AWS SDK - - @@ -239 +166 @@ AWS SDK - eventTimestamp=time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), + eventTimestamp=datetime.now(), @@ -253,14 +179,0 @@ To provide context-aware assistance, the agent loads the current conversation hi -Starter toolkit - - - - print("\nRetrieving current conversation history from short-term memory...") - - # Get the last k turns in the session - turns = session.get_last_k_turns(k=7) - for turn in turns: - print(f"Turn: {turn}") - -AWS SDK - - @@ -286,35 +198,0 @@ The agent performs a semantic search across extracted long-term memories to find -Starter toolkit - - - - # Wait for meaningful memories to be extracted from the conversation - print("Waiting 60 seconds for memory extraction...") - time.sleep(60) - - # --- Example 1: Retrieve the user’s shipping preference --- - memories = session.search_long_term_memories( - namespace_prefix=f"/users/{sarah_actor_id}/preferences/", - query="Does the user have a preferred shipping carrier?", - top_k=5 - ) - - print(f"Found {len(memories)} memories:") - for memory_record in memories: - print(f"Memory: {memory_record}") - print("--------------------------------------------------------------------") - - # --- Example 2: Broad query about the user’s issue --- - memories = session.search_long_term_memories( - namespace_prefix=f"/summaries/{sarah_actor_id}/{support_session_id}/", - query="What problem did the user report with their order?", - top_k=5 - ) - - print(f"Found {len(memories)} memories:") - for memory_record in memories: - print(f"Memory: {memory_record}") - print("--------------------------------------------------------------------") - -SDK - -