-
Notifications
You must be signed in to change notification settings - Fork 320
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
fix(deep-cody): update chat memory management #6264
base: main
Are you sure you want to change the base?
Conversation
This PR introduces the following improvements to the CodyChatMemory module: - Transition to a static utility class with a Map-based storage approach - Implement timestamp-based memory organization and automatic trimming to maintain the 10 most recent items - Enhance the retrieve() method to return a formatted ContextItem with the memory content - Add support for REMOVE command to clear the chat memory - Introduce comprehensive unit tests to cover various chat session workflows ## Test plan - Run the unit tests for the CodyChatMemory module - Verify the chat memory functionality in the Cody extension, including adding, retrieving, and clearing memories ## Changelog - Improved chat memory management with timestamp-based organization and automatic trimming - Added support for REMOVE command to clear the chat memory - Enhanced unit test coverage for chat memory workflows
return stored | ||
} | ||
|
||
private getChatMemory(): string[] { | ||
return localStorage?.getChatMemory() || [] | ||
} | ||
} | ||
|
||
export const CHAT_MEMORY_CONTEXT_TEMPLATE = `# Chat Memory |
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.
What do you think about keeping the prompt more generally? Similar to the following:
'Here are important memos/notes from past conversations' (Up to you about the phrasing)
This would also make it possible for users to store notes that are not directly related to them, but correspond to specifications/requirements and may not confuse Cody.
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.
@PriNova Are you referring to the about me (user)
part of the prompt?
Something like:
Here are the notes from our past conversations
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.
@PriNova Are you referring to the
about me (user)
part of the prompt?Something like:
Here are the notes from our past conversations
Yes. I missed the correct line comment. It is meant for the prompt.
@abeatrix I think that it would be awesome to have an Array of values stored that you can retrieve and easily say to forget by index + 1.
Forget 2 The users have requested having the ability to target the forget and not have an all-or-nothing kind of reset. |
This PR introduces the following improvements to the CodyChatMemory module:
Test plan
Changelog