Short-Term Memory
A component of the Agent memory mechanism referring to in-context information within a single session. It is implemented by appending conversation history to the prompt and is constrained by the context window token limit. Common management strategies include sliding window and summary compression.
Core Facts
An Agent's memory mechanism is typically divided into two categories: short-term memory and long-term memory, with long-term memory requiring external persistent storage such as vector databases, relational databases, and graph databases.
Long-term memory Agents are typically built on RAG (Retrieval-Augmented Generation) technology, converting information into high-dimensional vectors via vector databases and storing them persistently.
Agent Skills 具备上下文感知、可组合性和自描述性三个关键特征
Timeline (last 90 days)
Short-term memory (the messages list) lives as long as the process and disappears when the process ends, and it cannot grow indefinitely due to the model's context window limit.
A complete memory module operates in three stages: before the task starts, read memory and inject it into the System Prompt; during task execution, use short-term memory to append to the message sequence; after the task ends, write new information back to persistent storage and clear the short-term memory.
When short-term memory exceeds the context window, there are three common handling approaches: sliding window, summary compression, and external offloading, and the engineering implementation is not complicated.
Short-term memory includes SystemMessage, UserMessage, AIMessage, and ToolMessage, and has three characteristics: it is easily lost, has limited capacity, and can be read directly.
Two default practices for long-term memory: extraction should be placed asynchronously outside the reply path (because the facts of this conversation are already in this session's history); take a snapshot of memory at the start of each conversation (the memory block is placed before the history, and updating it midway would break the cache).
Cross-session memory systems are typically divided into several layers: short-term context memory, long-term explicit memory, and implicit preference memory.
The author built a custom Memory Layer to handle short-term and long-term memory and continuously optimizes the CRUD algorithms.
Short-term memory is a storage state, while context is a received state after transmission; the two are different concepts.
Short-term memory refers to the historical information stored on the Agent's side.
The core logic of an Agent's memory mechanism is to save previous chat history and send it together with the next request to the large model.
2 more timeline events
All Facts (16)
An Agent's memory mechanism is typically divided into two categories: short-term memory and long-term memory, with long-term memory requiring external persistent storage such as vector databases, relational databases, and graph databases.
90%VerifiedLong-term memory Agents are typically built on RAG (Retrieval-Augmented Generation) technology, converting information into high-dimensional vectors via vector databases and storing them persistently.
90%VerifiedAgent Skills 具备上下文感知、可组合性和自描述性三个关键特征
80%VerifiedTwo default practices for long-term memory: extraction should be placed asynchronously outside the reply path (because the facts of this conversation are already in this session's history); take a snapshot of memory at the start of each conversation (the memory block is placed before the history, and updating it midway would break the cache).
65%VerifiedThe author built a custom Memory Layer to handle short-term and long-term memory and continuously optimizes the CRUD algorithms.
65%VerifiedShort-term memory is a storage state, while context is a received state after transmission; the two are different concepts.
65%VerifiedPersistent memory is typically divided into three levels: short-term working memory, episodic memory, and semantic memory
65%UnverifiedCross-session memory systems are typically divided into several layers: short-term context memory, long-term explicit memory, and implicit preference memory.
70%UnverifiedProduction-grade agents need to distinguish between short-term memory (current session context) and long-term memory (cross-session user preferences and historical facts).
70%UnverifiedThe core logic of an Agent's memory mechanism is to save previous chat history and send it together with the next request to the large model.
60%UnverifiedShort-term memory generally retains the raw content of the most recent 5–10 conversation turns and triggers a compression summary when the threshold is exceeded.
60%UnverifiedShort-term memory (the messages list) lives as long as the process and disappears when the process ends, and it cannot grow indefinitely due to the model's context window limit.
50%UnverifiedShort-term memory includes SystemMessage, UserMessage, AIMessage, and ToolMessage, and has three characteristics: it is easily lost, has limited capacity, and can be read directly.
50%UnverifiedWhen short-term memory exceeds the context window, there are three common handling approaches: sliding window, summary compression, and external offloading, and the engineering implementation is not complicated.
50%UnverifiedA complete memory module operates in three stages: before the task starts, read memory and inject it into the System Prompt; during task execution, use short-term memory to append to the message sequence; after the task ends, write new information back to persistent storage and clear the short-term memory.
50%UnverifiedShort-term memory refers to the historical information stored on the Agent's side.
50%