spring-ai
spring-ai copied to clipboard
Cassandra Chat Memory: Fixed message order
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
@michaelsembwever @tzolov As main contributor/reviewer of CassandraChatMemory feature, could you please take a look at this PR? Thank you!
@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
I would implement CassandraChatMemoryRepository in different PR and leave this one as bug fix for existing implementation.
@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!
@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.