-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Migrate CassandraChatMemory to CassandraChatMemoryRepository #2998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As for now, cassandraChatMemory stores data in table with 4 columns like that:
Maybe we should change table structure similar to JdbcChatMemory?
It'll give us an ability to store tool/system messages, not only user/assistant. What do you think @markpollack @michaelsembwever ? |
Then the table would need a primary key like
Which can be done, and I have nothing against such an approach. |
Can't session_id+message_timestamp be a primary key? As far as I remember you set unique timestamp. On other hand, there is #2902 with request on message id field, so we can introduce it here. |
@linarkou , let's create a separate issue for your suggestion, as there's a time-constraint to get this issue fixed. |
@markpollack draft PR @ #3036 |
ref: spring-projects#2998 Signed-off-by: mck <[email protected]>
#3036 is ready for review now. |
ref: spring-projects#2998 Signed-off-by: mck <[email protected]>
fantastic! |
ref: #2998 Signed-off-by: mck <[email protected]>
There's a bug here I need to fix. @linarkou statement above
is actually mandatory… MessageWindowChatMemory relies on persisting SystemMessages. |
Thanks @michaelsembwever |
bug (optimisation) fix in progress: #3097 |
@michaelsembwever thanks eh! |
@michaelsembwever we can always do a bug fix post RC1 pre GA - just want to make sure we avoid modifying and public facing apis/properties. |
@markpollack , ready for review #3097 |
i don't think before #3097 it would work at all with MessageWindowChatMemory (as it expected to persist SystemMessages). and just generally, the usage pattern of MessageWindowChatMemory was substantially different: and with Cassandra not being a relationship style db; that it really required a revamp of the schema. #3097 is properly aligned to Cassandra now, provides a number of advantages over other chat-memory implementations (according to its known strengths), and could quite likely outperform latency-wise the other implementations (ofc "it depends"). |
Thanks so much for the deep analysis and changes at the last minute. If you want to advertise this in the docs, it may draw more folks into using cassandra. merged in 87b680a |
This would allow us to have a more robust implementation than we currently have based on the ChatMemory.get(conversationId, lastn) interface that is currently deprecated.
This has been done for Jdbc in the PR - as a basis for comparison.
#2890
The text was updated successfully, but these errors were encountered: