Memory is a crucial component for an agent, enabling it to remember past events. In most conversational and task scenarios, we expect the agent to incorporate historical information in its responses and interactions. Although the agent's LLM inherently has a conversation length window limitation, memory effectively addresses this issue.
Similar to human memory, an agent's memory can be simply categorized into the following types:
-
Short-term Memory: Contextual information from all interactions with the agent.
-
Long-term Memory: Summarizes or persistently stores the agent’s context in real-time, ensuring continuous provision of long-term memory.
In this definition process, we find that memory itself depends on a series of technologies, such as vector storage and fast retrieval.
Furthermore, aside from providing agents with context-based capabilities, memory offers numerous observable functions. For example, by mining and processing memory, we can distill it into experiential knowledge. Memory can also record the agent's entire operation process, capturing user "preferences," among other things.
With this, you have a preliminary understanding of the role of memory. In the next section, we will specifically introduce the standard definitions of memory components, how to create custom memories, and how to use memory.