Agent Memory
Persisting context across turns (short-term) and sessions (long-term) for agents.
Simple explanation
Memory lets an agent remember things. Short-term = the current conversation. Long-term = facts learned across sessions (user preferences, past decisions). Without memory, every conversation starts from scratch.
Engineering explanation
Short-term: conversation history (sliding window, summarised when too long). Long-term: vector store of facts/preferences per user, retrieved at query time. Episodic: log of past runs. Production memory: summarise old turns (don't truncate — lose facts), persist long-term per user, version the schema.
Example
Agent remembers user's name from session 1 → in session 2, retrieves it from long-term memory → greets by name without asking.
When to use it
Any conversational agent. Essential for personalisation and continuity.
Common misconception
Memory is NOT just 'storing messages'. Truncating old messages loses facts. Summarise, don't truncate.