Memory Introduction
The memory module plays a very important role in the agent architecture design. It stores information perceived from the environment and leverages the recorded memories to facilitate future actions. The memory module can help the agent to accumulate experiences, self-evolve, and behave in a more consistent, reasonable, and effective manner.
Memory Module Overview
Memory Operations
In DB-GPT agents, there are three main memory operations:
- Memory reading: The objective of memory reading is to extract meaningful information from memory to enhance the agent’s actions.
- Memory writing: The purpose of memory writing is to store information about the perceived environment in memory. Storing valuable information in memory provides a foundation for retrieving informative memories in the future, enabling the agent to act more efficiently and rationally.
- Memory reflection: Memory reflection emulates humans’ ability to witness and evaluate their own cognitive, emotional, and behavioral processes. When adapted to agents, the objective is to provide agents with the capability to independently summarize and infer more abstract, complex and high-level information.
Memory Structure
In DB-GPT agents, there are four main memory structures:
- Sensory memory: Like human sensory memory, the sensory memory is registers perceptual inputs, and it will receive the observations from the environment, some of sensory memory will be transferred to short-term memory.
- Short-term memory: Short-term memory temporarily buffers recent perceptions, it will receive some of the sensory memory, and it can be enhanced by other observations or retrieved memories to enter the long-term memory.
- Long-term memory: Long-term memory stores the agent’s experiences and knowledge, it can receive information from short-term memory, and it will consolidates important information over time.
- Hybrid memory: Hybrid memory is a combination of sensory memory, short-term memory, and long-term memory.
Memory In DB-GPT Agents
Some Concepts Of Memory
Memory
: The memory is a class that stores all the memories, it can beSensorMemory
,ShortTermMemory
,EnhancedShortTermMemory
,LongTermMemory
andHybridMemory
now.MemoryFragment
: TheMemoryFragment
is an abstract class that stores the memory information,
TheAgentMemoryFragment
is a class that inherits fromMemoryFragment
, it contains the memory content, memory id, memory importance, last access time, etc.GptsMemory
: TheGptsMemory
is used to store the conversation and plan information, not a part of the memory structure.AgentMemory
: TheAgentMemory
is a class that contains theMemory
andGptsMemory
.