AI Memory Tutorial: Short Term, Long Term, Episodic

TL;DRAgent memory spans short-term (the context window) and long-term (external stored knowledge).

Agents need to remember. Short-term memory is the conversation in the context window — fast but bounded and lost when it overflows. Long-term memory persists across sessions by storing facts/summaries externally (often a vector store) and retrieving them when relevant (RAG-style). Episodic memory recalls past interactions. Managing what to keep, summarize, and retrieve is central to capable agents.

Key points

Common mistakes

Try it: Explain how long-term memory survives a full context window.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>short-term: chat in context (lost on overflow)
long-term: store summaries/facts → retrieve when relevant
→ persists across sessions</pre></body></html>
Open the interactive lesson →
Multi-Agent Systems · Roles + Handoffs Evaluation · Benchmarks vs Vibes