Core Components of LLM Agent Memory: What Each Stores and How It Is Written and Read
Company: Snowflake
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Onsite
In the same agent-focused expertise round, after a design question, the interviewer moved to agent memory: **what are the common components of an LLM agent's memory?**
For each component, explain what it stores, how information is written into it and read back out, and how the components work together over the life of a long-running agent that talks to users across many sessions.
```hint Sort by lifetime and by kind
Group what an agent must remember by how long it has to survive (this step, this session, or across sessions) and by what kind of thing it is: an event that happened, a fact, or a way of doing something.
```
```hint Writing is the hard part
Retrieval gets most of the attention, but decide also what is worth remembering, what happens when a new memory contradicts an old one, and what gets forgotten.
```
### Clarifying Questions
- Does the agent serve one user, or many users whose memories must be kept apart?
- How long do sessions run, and how much of a session's history fits in the model's context window?
- Is memory meant to personalize the agent (remember preferences and facts about the user), to improve its task performance (remember what worked), or both?
- Are there requirements to show a user what the agent remembers about them, or to delete it on request?
### What a Strong Answer Covers
- A taxonomy of memory components, distinguished by lifetime and by the kind of content
- For each component: how it is represented and stored, and its write and read policies
- Memory management over time: consolidation, updating contradicted facts, and forgetting
- How retrieved memories are selected and fitted into a limited context window
- Isolation, privacy, security against poisoned memories, and how to evaluate whether memory helps
### Follow-up Questions
- A user states a preference and later contradicts it. What happens in your design, and what does the agent say next time?
- How would you measure whether memory makes the agent better rather than worse?
- How do you stop instructions injected through a web page or a document from being saved to long-term memory and replayed in later sessions?
- Retrieval returns 50 relevant memories, but the prompt budget allows 5. How do you choose?
Overview: Explain the common components of an LLM agent's memory, from the context window to session, episodic, semantic and procedural memory, and how each is written, retrieved and maintained. It tests agent architecture knowledge, context budgeting, conflict handling, forgetting and memory security.
Read the full Snowflake Machine Learning Engineer interview experience this question came from