-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GH-4170 Fixed the issue where SystemMessage
was not being saved to the chat memory
#4189
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
base: main
Are you sure you want to change the base?
Conversation
… not being saved to the chat memory. Signed-off-by: Sun Yuhan <[email protected]>
@sunyuhan1998 I admit I'm new to this project, but I don't think the solution here is the correct one. The system message is maintained in the |
Hi @sjohnr Thanks for your review! I think this issue might stem from the inconsistency in design between |
I'll look into it shortly and get back to folks. I appreciate all the hard work on the thread and the PR. |
@sunyuhan1998 thanks for looking into this issue. The memory advisors are not currently designed to persist the The reason why There is still a pending-design idea to introduce memory as a "first-class citizen" in |
@ThomasVitale Thank you for the detailed explanation. I now have a clear understanding of the original design intent, as well as the current state of |
As discussed in the issue, the current implementation of
MessageChatMemoryAdvisor
does not save theSystemMessage
intoChatMemory
, which is clearly a BUG.This PR fixes the issue by checking, when adding chat memory, whether the current conversation is the first turn or whether the current
SystemMessage
differs from the previous one. If either condition is met, theSystemMessage
will be added to the chat memory.Fixes #4170