spring-projects / spring-projects/spring-ai

MessageChatMemoryAdvisor,MessageWindowChatMemory currently performs full message rewrites on every before/after — suggest incremental updates and DB‑side windowing

Open
#6,331 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Currently, MessageChatMemoryAdvisor performs a full overwrite of conversation window messages on every before/after operation, and MessageWindowChatMemory also causes duplicate DB writes. Could this be changed to incremental append? Window size control could be handled by DB query limits (e.g., LIMIT), which would also preserve full message history. What's the design rationale behind the current approach? Doesn't this introduce unnecessary DB write overhead?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing MessageChatMemoryAdvisor and MessageWindowChatMemory, focusing on their before/after persistence behavior and the duplicate database writes described here. Compare the current full-rewrite approach with incremental appends and database-side window limits; done requires an agreed design and validation of the resulting write and history behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.