Memory (Agent)
How AI agents retain and retrieve information across turns or sessions.
Agent memory comes in two flavors. Short-term: keep recent turns in the context window. Long-term: store facts in a vector database or structured store and retrieve them when relevant. Both require deliberate engineering.
The naive approach (stuff everything into context) breaks at scale tokens get expensive and quality drops past a few thousand turns. Real agents use retrieval over a memory store, often with summarization to keep recent context tight.
Frameworks vary: LangChain has multiple memory backends, mem0 is a dedicated memory layer, and Anthropic's Claude has built-in memory features in its Pro/Max products. The right answer depends on whether memory needs to persist across sessions and across users.