Skip to main content

What kinds of memory can an agent have, and how do you implement them?

Agents and tools · Intermediate 3

Short answer

Short-term memory is the conversation and working state in the context window. Long-term memory persists across sessions: facts about the user, past decisions or summaries, stored in a database or vector store and retrieved when relevant. Some systems separate episodic memory (what happened) from semantic memory (what is true). Write memory selectively and let users see and delete it.

Deeper answer

Implementation choices: keep recent turns verbatim and summarise older ones; extract durable facts with a model call after a session and store them with a timestamp and source; retrieve by similarity or by key when a new session starts. LangGraph, for example, separates thread-level checkpoints from a cross-thread store.

The hard parts are deciding what is worth remembering, updating facts that change, and privacy. Storing everything bloats context and can surface stale or sensitive information.

What a strong answer covers

Answer it out loud in the mock interview about 1.5 min

Follow-ups to expect

Common mistakes

Learn it

Agent memory

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.