# Understanding Memory in Mastra

In this lesson, we'll explore how to enhance your Mastra agents with memory capabilities. Memory allows agents to maintain context across conversations, remember user preferences, and provide more personalized responses.

## What is Agent Memory?

Memory in Mastra is how agents manage the context that's available to them during conversations. It's essentially a condensation of chat messages and relevant information into the agent's context window.

The context window is divided into three main parts:

1. **System instructions and user information** (working memory)
2. **Recent messages** (conversation history)
3. **Older relevant messages** (semantic recall)
