By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
LLMs are stateless. They have no memory of previous conversations. If a customer tells your support agent their shoe size on Monday, the agent will ask again on Friday because nothing persists between sessions. Memory is how you give an agent continuity across time and conversations.
Bedrock Agent Core provides two distinct memory layers. Short-term memory holds raw events—messages, tool calls, everything that happens in a single conversation. Long-term memory holds structured knowledge extracted from those events: facts, preferences, summaries, episodes. They work together.
Short-term memory stores events scoped by actor and session. An actor is usually a user ID. A session is one conversation. Events expire after N days, so they don't stick around forever. You create events with the CreateEvent API call.
Think of short-term memory as the transcript of what just happened. It's unprocessed. It's temporary. It's what the agent can see right now in the current conversation.
Long-term memory is different. It stores facts, preferences, summaries, and episodes extracted from short-term events by configured strategies. These records persist across sessions. They are structured, not raw.
Extraction happens asynchronously in the background. There's a delay between when an event is created and when long-term records appear. This is eventually consistent—the system will catch up, but not instantly. You query long-term memory with retrieve_memories(query).
Monday: a customer says 'I wear size 9 and love Nike.' Your agent calls CreateEvent to save this. In the background, a strategy extracts two long-term records: a preference (Nike) and a fact (size 9). These get consolidated with any older records in the same namespace.
Friday, new session: the same customer asks 'any running shoes?' Your agent searches long-term memory for relevant facts. It retrieves 'Nike, size 9' and recommends accordingly. The customer never has to repeat themselves.
Long-term memory stores extractions, not a dump of everything said. The model may even store an inferred fact the user never literally wrote.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.