Lab 06

Lab 6: AgentCore Memory

Turn your Mortgage Assistant into a truly intelligent agent that remembers past interactions, learns user preferences, and maintains context across multiple conversations using Amazon Bedrock AgentCore Memory.

Memory Types

  • Short-term Memory — stores conversations to track immediate context within sessions
  • Long-term Memory — stores extracted insights — preferences, facts, and summaries — across sessions
  • Semantic Retrieval — retrieve relevant memories using natural language
  • User Preference Strategy — extract and persist user preferences automatically

Two Implementation Options

Option 1: Strands Agents Hooks

Fine-grained control over memory store and retrieval. Notebook: option_1_agentcore_memory_with_strands_agents_hooks.ipynb

Option 2: Session Manager

Quick to set up and easy to use. Notebook: option_2_agentcore_memory_with_strands_session_manager.ipynb

Lab 07

Lab 7: AgentCore Observability

AgentCore Observability helps you trace, debug, and monitor agent performance in production. Emits telemetry in OpenTelemetry (OTEL)-compatible format with detailed visualizations of each step in the agent workflow.

Key Components

  • Service Metrics — 1-minute aggregations for invocations, latency, token usage, and errors
  • Structured Logs — JSON lines capturing all agent events and operations in CloudWatch
  • Spans & Traces — OTEL spans for full execution graphs via CloudWatch Transaction Search
  • GenAI Dashboard — pre-built visualizations for runtime metrics and trace drill-downs

Notebook

07-agentcore-observability/Observability.ipynb

How It Works

  1. Enable Transaction Search once per account to allow span ingestion
  2. Create runtime resources — automatically provisions log groups and metric namespaces
  3. Instrument code with ADOT: install aws-opentelemetry-distro
  4. Agent invocation generates service metrics automatically
  5. Telemetry flows to CloudWatch — metrics, spans, and logs
  6. Use the built-in Observability page or build CloudWatch alarms