Agent Memory
Persistent state an agent carries across turns or sessions — short-term context, long-term facts, episodic history.
What is Agent Memory?
Without memory, every LLM call is stateless — the model knows nothing about prior conversations. Agent memory makes longer-running, personalised agents possible. Three layers in modern practice: **short-term** (the active conversation, kept in context window), **long-term** (user facts persisted to a vector store or DB), **episodic** (records of past sessions and actions).
Implementation patterns: **sliding window** (keep the last N turns), **summarisation** (compress old turns into a running summary), **vector memory** (embed memories, retrieve relevant ones), **structured memory** (write user facts to a SQL row).
Frameworks like LangGraph, Letta (formerly MemGPT), and Mem0 specialise in memory orchestration. For most Indian production systems, a Postgres + pgvector hybrid (structured facts + vector memories) is the pragmatic default.
Agent memory is what makes products feel personalised over time. Without it, every conversation starts from zero. Senior agent engineers design memory deliberately.
A Bengaluru personal-finance assistant remembers each user's income tier, risk appetite, and recent transactions across sessions. On day 30, it greets you with "Hey, last month you under-saved by ₹4,000. Want me to set up automatic SIPs?" — a depth no stateless chatbot can achieve.
Want to master this?
Learn Agent Memory in a structured cohort
3-month live program with mentors, real projects, and 50+ partner placement support.
