spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Cassandra Chat Memory: Fixed message order

Open linarkou opened this issue 7 months ago • 2 comments
trafficstars

Fixes issue #2815 This PR solves problem with message ordering: CassandraChatMemory fetches rows in DESC order (by message_timestamp), and MessageChatMemoryAdvisor get and add all messages in that order - from last to first. So messages list needs to be reversed.

Same problem of JDBC Chat Memory solved here #2781

linarkou avatar Apr 22 '25 10:04 linarkou

@michaelsembwever @tzolov As main contributor/reviewer of CassandraChatMemory feature, could you please take a look at this PR? Thank you!

linarkou avatar Apr 22 '25 12:04 linarkou

@linarkou thanks so much for your contribution! I'd like to reference here the comment I left on the similar PR for JDBC about the new APIs and changes we have just delivered for chat memory: https://github.com/spring-projects/spring-ai/pull/2781#issuecomment-2831344631

ThomasVitale avatar Apr 25 '25 20:04 ThomasVitale

I would implement CassandraChatMemoryRepository in different PR and leave this one as bug fix for existing implementation.

linarkou avatar Apr 28 '25 13:04 linarkou

@linarkou Merged the PR upstream. I needed to update the autoconfig tests in the PR. See the commit here for details: https://github.com/spring-projects/spring-ai/commit/1bf57878650c43156997158de87cfb0ad9697efe. Thanks!

sobychacko avatar Apr 29 '25 00:04 sobychacko

@linarkou @michaelsembwever Thanks as well. I realize this is a last minute request, but would either of you be able to help with this issue - https://github.com/spring-projects/spring-ai/issues/2998 We would like to get this for the RC1 for next week but as it involved a fair bit of cassandra expertise, we won't be able to make that deadline with the current team until after the GA.

markpollack avatar May 05 '25 14:05 markpollack