Open
Description
Expected Behavior
An implementation of ChatMemory based on token size control is required, which evicts the oldest messages when the total memory tokens exceed a specified limit.
Current Behavior
Currently, there is only a ChatMemory implementation that is based on the number of messages.
Context
Currently, there is only a ChatMemory implementation that focuses on the number of messages, which is actually insufficient for real-world use cases.
ChatMemory represents the memory content of an LLM, and its actual limitation should depend on the context token size supported by the LLM. Therefore, a ChatMemory implementation that limits the window based on token size is more practically meaningful.