AWS Builder Center
Amazon Bedrock AgentCore Memory: Giving AI Agents the Ability to Remember

Amazon Bedrock AgentCore Memory: Giving AI Agents the Ability to Remember

How Amazon Bedrock AgentCore Memory helps AI agents keep context in a chat and remember facts over time, so apps feel more personal and simple to build.

Why AI agents need memory

Modern AI agents can reason, call tools, and finish tasks with many steps. But by default, a large language model has no way to remember anything outside the current prompt. Once a chat ends, everything the agent learned about the user is gone. This creates a frustrating experience. Users have to repeat themselves, agents lose track of tasks that take a long time to finish, and it becomes hard to keep answers personal across sessions.
Amazon Bedrock AgentCore is an AWS platform for building and running AI agents in production. It solves this problem with a feature called AgentCore Memory. Instead of asking developers to build their own database, search logic, and summary system, AgentCore Memory gives them a managed way to store, organize, and recall information that an agent has seen.

Two types of memory

AgentCore Memory has two parts that work together. The first is short term memory. It tracks the back and forth of a single chat session so an agent can understand follow up questions without the user repeating themselves. For example, if someone asks about the weather in Seattle and then asks what about tomorrow, short term memory lets the agent connect that question to Seattle.
The second part is long term memory. It looks across many sessions to find lasting facts, such as things a user prefers, choices that were made, or a summary of past chats. This is what lets an agent remember that a returning customer likes window seats, without the customer saying so every time.

How it works

AgentCore Memory uses a few simple building blocks. Each interaction is saved as an event, linked to a session and to an actor, which can be the user, another agent, or a system. This way the service always knows who said what and when. These raw events form short term memory. Memory strategies are rules that decide how this raw chat history turns into useful, structured knowledge. The results are saved as memory records inside a namespace, which is simply a path used to group related memories together.
Developers can choose how memories get created. AgentCore offers built in strategies that handle everything automatically using AWS tuned methods. It also offers built in strategies with overrides, which keep the managed pipeline but allow custom prompts or models. And it offers fully self managed strategies for teams that want complete control over how memories are made and stored. A single memory resource can even use more than one of these methods at the same time.

A simple example

Here is a simple example of how a developer might use AgentCore Memory in code. This is only meant to show the idea, not the exact syntax.
# Save a new event from the user
memory.create_event(
actor_id="user_123",
session_id="session_1",
content="I like window seats when I fly."
)

# Later, in a new session, the agent looks for memories about seating
memories = memory.retrieve_memories(
actor_id="user_123",
query="seat preference"
)

# The agent uses that memory to give a personal reply
if memories:
reply = "I remember you like window seats. I will book one for you."
else:
reply = "Do you have a seat preference?"
In this example the agent stores a small fact during one chat and then uses it later to give a more personal answer, without the user needing to repeat the preference.

Why it matters

This design brings a few clear benefits. Chats feel more natural because the agent does not lose track between turns. Experiences feel more personal because facts and preferences carry over on their own. And development teams spend less time building their own memory system, so they can focus on what makes their agent useful.

Where it fits in real use

These features are useful in many real situations. A support chatbot can remember a customer's past issues so people do not have to explain the same problem again. An agent that manages a process with many steps, like an approval flow, can use memory to track progress so the task state is not lost between steps. In systems with many agents, a shared memory store helps them stay in sync on the same facts. Agents that plan ahead can also use past results to make better choices in the future.

Getting started

AgentCore Memory is one of several services inside Amazon Bedrock AgentCore, along with Runtime, Gateway, Identity, and Observability. It is built to work with common agent frameworks instead of locking developers into one option. For teams building agents that need to hold a conversation, remember a customer, or track a long task, it offers an easy way to add memory without building that infrastructure from scratch.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article