Concept guide · Agents, tools, and MCP
How do you give an agent memory?
A slower explanation for when the short interview answer is not enough. Start with the intuition, then connect it to the technical idea and the way an interviewer expects you to reason about it.
ML area
Generative AI → Agent memory
Interview format
Core · Scenario
Question
GENAI-082
Start with the idea
In simple terms
Short-term memory is the state of the current task. Long-term memory contains selected facts or past events that may help future tasks. Store only useful, permissioned information and retrieve it when relevant.
Make it concrete
Keep the current order lookup in thread state, but store a user’s confirmed language preference separately with a timestamp and a way to correct or delete it.
Build the answer
How to approach it
- 1Define what must survive the current run and what should expire.
- 2Store provenance, scope, confidence, and lifecycle metadata.
- 3Retrieve only relevant memory and test poisoning, leakage, correction, and deletion.
Go one level deeper
The technical explanation
Memory should be designed as an application data model, not as an ever-growing chat transcript. Separate raw events, summaries, durable facts, and embeddings; attach provenance, confidence, timestamps, scope, and expiry; and isolate users and tenants. The system must support correction, deletion, and resistance to malicious instructions being written into memory.
Say this in the interview
Separate thread memory from durable application memory. Keep current task state in checkpoints, store selected user preferences or facts separately, retrieve only relevant memories, attach provenance and timestamps, and support correction, expiry, deletion, and tenant isolation. Never treat the whole chat transcript as a memory strategy.
Keep preparing