# What's the difference between short-term and long-term memory in an AI agent?

Short-term memory is the running message history checkpointed inside one conversation thread, visible only there; long-term memory is written to a separate, namespaced store that any thread, including ones that haven't started yet, can load back in. LangGraph persists that thread history to a database so the thread can resume later: the limit is visibility, not survival, since it never reaches another thread.

LangGraph's docs split long-term memory three ways, borrowing labels from human memory research: semantic memory holds facts, usually about the user; episodic memory holds [the record of what the agent actually did](/answers/tool-calling/what-is-an-agent-trajectory), written as experiences it can recall later; procedural memory is the rules it follows, which for an agent means its own prompt and code rather than a stored note.

Writing to long-term memory is where it gets fragile. Updating one stored profile means passing in the whole previous version each time, which the docs say gets error-prone as the profile grows. Updating a list of separate memories means the model has to decide what to delete or change on its own, and the docs say different models default to over-inserting or over-updating, in ways that need their own evaluation to catch.

---

Sources:
- LangChain Docs, "Memory" (LangGraph concepts): https://docs.langchain.com/oss/python/concepts/memory (fetched 2026-10-20)

Source: https://tessary.ai/answers/agent-memory/whats-the-difference-between-short-term-and-long-term-memory-in-an-ai-agent
More on Agent memory: https://tessary.ai/answers/agent-memory
From Tessary, agent reliability for AI agents in production: https://tessary.ai
