Phase 08 · LangChain & LangGraph agentic systems

Agent memory types and updates

Agent memory includes Working Memory for the current reasoning step, Short-Term Memory for the current task and Long-Term Memory across sessions.

In plain terms

Memory is not one box. Working Memory is the temporary scratch area, Short-Term Memory holds the active conversation, Long-Term Memory persists useful facts, Episodic Memory stores past experiences, and Semantic Memory stores general knowledge learned over time.

Why it matters

Agents need continuity, but bad memory creates stale context, privacy risk and confusing behavior.

How it works

Use Memory Retrieval to fetch relevant stored facts, Memory Update to save new useful information, Context Management to keep the prompt focused, and clear deletion rules so users can inspect and remove memory.

When you use it

Use memory for recurring users, long workflows, personal assistants, project agents and systems that should learn preferences or repeated facts.

Common mistakes

  • Saving every message as Long-Term Memory.
  • Mixing Episodic Memory and Semantic Memory without labels.
  • Letting stale memory beat the user's current instruction.

Best practices

  • Store memory with source, time and confidence.
  • Retrieve memory by relevance, not recency alone.
  • Ask before saving sensitive details.

Try it yourself

Build a memory table with type, source, value, confidence and last_used fields, then implement Memory Retrieval and Memory Update.