To enable memory for AgentCore, follow the steps below.
In the memory creation interface, you will see the following sections:
Set the name for the memory that AgentCore will use.
The number of days detailed conversation history is stored. For this demo, you can keep the default 90 days.


Function: Summarizes the conversation after it ends or periodically. Purpose: Keeps long-term context while using minimal storage.
Example: You have 100 messages about AWS CLI errors → later the Agent remembers:
“The user was experiencing AWS CLI connection issues.”
Function: Stores key facts or knowledge independent of context. Purpose: Used to answer questions based on previously mentioned information.
Example:
“Project A uses Python 3.9.” Ask again later → Agent responds with Python 3.9 immediately.
Function: Learns user habits and communication style. Purpose: Personalizes responses.
Example: If you often say:
“Keep the answer short.” The Agent will consistently respond concisely.
Function: Stores sequences of events and analyzes success/failure through Reflections. Purpose: Helps the Agent learn from past experiences.
Example: A previous flight booking failed due to missing dates → the Agent remembers. Next time, it asks for the date first.
For the demo, you only need:
Choose Summarization and click Create to complete the setup.
After creating a Memory, you will receive a Memory ID.
Add it to your Python file:
# AgentCore Memory Configuration
REGION = "ap-southeast-1"
MEMORY_ID = "memory_j98zj-4LFDxqB2o1"
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
Be sure to update the Memory ID and Region to match your configuration.