Amazon Bedrock AgentCore is in preview release and is subject to change.

Add memory to your AI agent

AgentCore Memory lets your AI agents deliver intelligent, context-aware, and personalized interactions by maintaining both immediate and long-term knowledge. AgentCore Memory offers two types of memory:

  • Short-term memory: Stores conversations to keep track of immediate context.

    For example, imagine your coding agent is helping you debug. During the session, you ask it to check variable names, correct syntax errors, and find unused imports. The agent stores the interactions as short term events in AgentCore Memory. Later the agent can retrieve the events so that it can converse without you having to repeat previous information.

    Short-term memory captures raw interaction events, maintains immediate context, powers real-time conversations, enriches long-term memory systems, and enables building advanced contextual solutions such as multi-step task completion, in-session knowledge accumulation, and context-aware decision making.

  • Long-term memory: Stores extracted insights - such as user preferences, semantic facts, and summaries - for knowledge retention across sessions.

    • User Preferences – Think of your coding agent which uses AgentCore Memory as your long-time coding partner. Over many days, it notices you always write clean code with comments, prefer snake_case naming, use pandas for data analysis, and test functions before finalizing them. Next time, even after many sessions, when you ask it to write a data analysis function, it automatically follows these preferences stored in AgentCore Memory without you telling it again.

    • Semantic facts – The coding agent also remembers that “Pandas is a Python Library for data analysis and handling tables”. When you ask, “Which library is best for table data?”, it immediately suggests Pandas because it understands what Pandas are from the semantic memory.

    • Summary – The coding agent generates session summaries such as “During this interaction, you created a data cleaning function, fixed two syntax errors, and tested your linear regression model.” These summaries both track completed work and compress conversation context, enabling efficient reference to past activities while optimizing context window usage.

Memory AgentCore Memory

You can use AgentCore Memory with the AWS SDK or with any popular agent framework, such as Strands Agents. For code examples, see https://github.com/awslabs/amazon-bedrock-agentcore-samples/tree/main/01-tutorials/04-AgentCore-memory.