-
Notifications
You must be signed in to change notification settings - Fork 98
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
Update chat memory example and separate ChatMemoryStore from ChatMemory usage #107
Update chat memory example and separate ChatMemoryStore from ChatMemory usage #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure. I don't see any cleanup mechanism, which is likely going to OOM at some point.
@Override | ||
public ChatMemory get(Object memoryId) { | ||
return MessageWindowChatMemory.builder() | ||
.id(memoryId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without eviction or4 cleanup, this will lead to OOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to see exactly how this is meant to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is currently no eviction mechanism. However, for a simple example, that would be hard to do. The current idea of always evicting when the request ends makes a chat with API calls impossible.
I added a note to the documentation clarifying this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation should mention or have a more complex example with eviction.
I'm still unsure about the request scope part. I think, we would need to introduce a "conversation" concept soon.
c7c4821
to
6be3de2
Compare
I am looking into a little more. There is a chance that things are simpler than we think |
I took the suggestion to use Thanks for bringing up this idea! |
This PR updates the ChatMemory example. The idea is to separate providing the
ChatMemory
creation in theChatMemoryProviderBean
and theChatMemoryStore
creation via aChatMemoryStoreProducer
.