Definition
Agent memory is a mechanism that stores important information from conversations or work so it can be reused in later tasks. It helps agents stay consistent across sessions and long workflows.
You want to ask your AI agent to continue this week's work based on last week's research results. But the agent doesn't remember last week's conversation. Having to explain everything from scratch every time is inefficient. Agent memory is a mechanism that allows AI agents to store and reference information from past conversations and tasks, enabling them to act with continuous context.
Short-Term and Long-Term Memory
Agent memory is broadly divided into two types. Short-term memory is information accumulated within the current conversation session. This includes conversation history and task progress, and is typically held within the LLM's context window. It is generally lost when the session ends.
Long-term memory is information that persists across sessions. User preferences, past task results, and learned knowledge are stored in external databases and retrieved when needed. The mainstream approach uses RAG technology to retrieve relevant memories via vector search.
Structuring Memory
How to structure memory is also an important design decision. Beyond simply storing conversation logs, organizing memories into categories such as episodic memory ("Person A proposed X in the last meeting"), semantic memory ("This project's tech stack is React + Python"), and procedural memory ("Data aggregation is always done with this SQL query") enables appropriate recall based on the situation.
Cross-Session Consistency
The greatest value of long-term memory is achieving consistency across sessions. The agent can naturally respond to instructions like "based on the previous analysis" or "report in the usual format," eliminating the need for users to re-explain context every time. ChatGPT's Memory feature and Claude's Project Knowledge feature are early implementations of this long-term memory.
Challenges and Outlook
Agent memory faces several challenges. How to resolve conflicts between old and new information, which information to remember and which to forget, and how much information can be stored from a privacy perspective. The mechanism for selecting and updating memories is a critical theme that must be addressed for agents to remain useful over extended periods. Techniques for organizing memories based on importance and usage frequency, similar to human memory, are being actively researched.