Agent memory
How an AI agent keeps information beyond a single model call: short-term state within a conversation, and long-term stores it can recall across sessions.
Agent memory is the set of mechanisms an AI agent uses to keep information beyond a single model call: the state of the current conversation, and longer-term knowledge it can recall in later sessions.
Short-term and long-term. Frameworks draw the same line.
- LangGraph keeps short-term memory in the thread’s state, saved by a checkpointer, and long-term memory in stores organized by namespaces that any thread can read.
- Google ADK treats a
Session, with its events andState, as working memory for one conversation, and aMemoryservice as recall across sessions. - CrewAI uses a single
Memoryclass. A model infers the scope and importance of each item when it is saved, and recall ranks results by semantic similarity, recency and importance.
Kinds of memory. LangGraph’s documentation borrows three categories from human memory: semantic (facts, such as a customer’s preferences), episodic (past experiences, often kept as few-shot examples) and procedural (rules and instructions, often refined prompts). Memories can be written in the hot path, during the conversation, or in the background afterwards. The first makes them available at once but adds latency; the second avoids the delay but needs a trigger.
Memory and the context window. The model only sees what is in its context window, so a memory system is really a policy for what to put back in. Anthropic’s guidance on context engineering recommends structured notes kept outside the window and loaded when relevant, because recall degrades as the window fills.
Risks. Anything written to memory can steer later actions. The OWASP Top 10 for Agentic Applications lists memory and context poisoning among its risks, so writes that come from untrusted input need the same scrutiny as the input itself.
Between organizations. In A2A, a shared contextId groups related tasks and messages, but each agent keeps its own memory. The protocol does not share one agent’s memory with another.
Sources
- LangChain documentation: Memory overview (LangGraph) (accessed )
- Agent Development Kit documentation: Technical overview (accessed )
- CrewAI documentation: Memory (accessed )
- Anthropic: Effective context engineering for AI agents (29 September 2025) (accessed )
- OWASP GenAI Security Project: OWASP Top 10 for Agentic Applications (9 December 2025) (accessed )