spring-projects / spring-projects/spring-ai
A ChatMemory implementation based on token size control is required.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing ChatMemory implementation that limits memory by message count and the surrounding ChatMemory API. The work is complete when a token-size-based implementation evicts the oldest messages after the configured token limit is exceeded and the behavior is covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100