AMAZON BEDROCK / SERVICE DETAIL S03
AGENTCORE MEMORY
CHAPTER 09 / 36
IN ONE LINE so the agent does not forget
REV 2026.07
By default an AI model forgets everything between calls. Memory fixes that: it stores the conversation as it happens, and quietly learns lasting facts about the user, so the agent can be helpful over time instead of starting blank each time.
New to these words? Read chapter 02 "Key terms" (session, namespace, tool).
[ 1 ] WHAT MEMORY IS
Memory is a fully managed place to keep what the agent should remember. There are two kinds, working together: short-term (the current conversation) and long-term (useful facts and preferences kept for the future). You do not build or run any database; AgentCore handles it.
[ 2 ] THE TWO KINDS OF MEMORY
SHORT-TERM the conversation
Every message in the current chat, saved as it happens.
Each turn is one event (it can hold several messages): it never changes and is timestamped.
Filed under the user (actorId) and the conversation (sessionId).
Why: the agent can reload the chat and understand follow-ups like "what about tomorrow?"
LONG-TERM learned facts
Short notes pulled from past chats: facts, summaries, preferences.
Kept across many conversations, not just the current one.
Built automatically in the background.
Why: next time, the agent already knows the user likes window seats.
[ 3 ] HOW A CHAT TURNS INTO LASTING MEMORY
STEP 01
SAVE THE TURN
The message is stored as a short-term event right away. This never slows the chat.
==>
STEP 02
EXTRACT
In the background, AgentCore reads the events and pulls out useful insights.
==>
STEP 03
CONSOLIDATE
It merges each insight with what it already knew, instead of duplicating.
==>
STEP 04
STORE
The result is saved as a long-term note under a namespace (a folder-like path).
==>
STEP 05
RECALL
Later, the agent searches by meaning and pulls the most relevant notes into the chat.
STEPS 02 TO 04 HAPPEN IN THE BACKGROUND, AFTER THE MESSAGE IS SAVED
Because this runs in the background, allow a short delay before new long-term notes appear. It is not retroactive: only chats that happen after you turn a strategy on are processed.
[ 4 ] STRATEGIES, WHAT THE AGENT CHOOSES TO REMEMBER
SEMANTIC
Plain facts and knowledge (an order number, a deadline).
USER PREFERENCE
What the user likes (window seats, a tone of voice).
SUMMARY
A short recap of each conversation.
EPISODIC
Meaningful interaction sequences (episodes), plus reflection across them.
You pick one or more strategies (the rules for what to keep). Choose built-in (managed for you), built-in with your own wording, or fully custom. If you pick no strategy, only short-term memory is kept and nothing long-term is learned.
[ 5 ] HOW THE AGENT ASKS FOR A MEMORY
To recall, the agent runs a search by meaning (not by exact words): it gives a question and a namespace, and gets back the closest notes. You can ask for the top few results (for example the 3 most relevant). The match score is a measure of how close in meaning the note is, not a percentage.
// CAUTION The small labels you can attach to an event ("metadata") are not encrypted with your own key. Never store passwords or secrets there.