Core Components of LLM Agent Memory: What Each Stores and How It Is Written and Read
SnowflakeMachine Learning Engineer · OnsiteLast updated
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.
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.
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?
Hints
Hint 1
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 2
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.
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?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.