Distinguish short-term vs long-term agent memory and name a failure mode specific to each
Explain the difference between short-term and long-term memory in an agent system. Give one failure mode that is unique to each type.
Short-term memory is the live context window for the current task; long-term memory is an external store retrieved as needed. Each fails differently: overflow versus staleness.
Imagine you are cooking from a recipe. Short-term memory is the open recipe card on the counter right now: you can read every word at a glance, but the moment you clear the counter for the next dish, it is gone. Long-term memory is the cookbook on the shelf. It holds far more than one card could, and it stays there for years, but you have to walk over, find the right page, and trust that the recipe has not gone out of date since it was printed. An agent works the same way. What it can see this instant lives in its short-term memory. What it has to go fetch from a database or a file lives in its long-term memory. Knowing which goes where, and what each forgets, is most of the job.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define each tier by location, persistence, and access path, give the write and forget policy that decides what goes where, then name the two distinct failure modes, overflow for short-term and staleness for long-term, and close with the mitigation each one demands.
Real products, models, and research that use this idea.
- ChatGPT's memory feature persists user facts to a long-term store across chats, while each conversation's running context is the short-term window.
- LangGraph separates a per-session checkpointer for short-term thread state from a long-term store keyed by user id that survives across threads.
- Claude's projects and memory let durable instructions persist long-term, while the active conversation lives in the context window for that session.
- MemGPT and the Letta framework explicitly page facts between an in-context working memory and an external archival store, treating the window like RAM and the store like disk.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you keep an agent's long-term memory from serving stale facts on retrieval?
QWhere exactly does the boundary sit between short-term and long-term memory in a framework like LangGraph or MemGPT?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Calling the vector store the agent's only memory. The context window is itself short-term memory, and conflating the two hides the distinct overflow and staleness failure modes.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.