hands-on lab

Managing Short-Term and Long-Term Memory With Amazon Bedrock AgentCore

Difficulty: Intermediate
Duration: Up to 45 minutes
Students: 5
On average, students complete this lab in10m
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Without memory, an AI agent treats each question independently. If you ask it to find flights from Seattle to Tokyo and then follow up with, "what about business class?", it will not know what you mean. Amazon Bedrock AgentCore Memory addresses this in two ways: short-term memory preserves context within a session, while long-term memory extracts durable facts and preferences for use across sessions.

In this lab, you will build an Amazon Bedrock AgentCore harness with memory enabled and put both mechanisms to the test. You will attach a pre-configured gateway that gives the agent a flight search tool, hold a multi-turn conversation that only works if the agent remembers, and then verify that a stated travel preference survives into a brand new session. Finally, you will inspect the raw memory events and extracted memory records in CloudWatch Logs.

Learning objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Configure an Amazon Bedrock AgentCore harness with memory enabled
  • Test short-term and long-term memory behavior in the harness playground
  • Inspect memory events and extracted memory records

Intended audience

  • Candidates for the AWS Certified Generative AI Developer - Professional certification
  • Cloud Architects
  • Software Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Amazon Bedrock AgentCore

The following content can be used to fulfill the prerequisites:

Environment before

Environment after

Covered topics

Hands-on Lab UUID

Lab steps

0 of 4 steps completed.Use arrow keys to navigate between steps. Press Enter to go to a step if available.
  1. Logging In to the Amazon Web Services Console
  2. Configuring an Amazon Bedrock AgentCore Harness With Memory
  3. Tracing Short-Term Memory in a Session
  4. Verifying Long-Term Memory Across Sessions