-
Notifications
You must be signed in to change notification settings - Fork 1
Fix memory storage and correction issues #26
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 memory storage and correction issues #26
Conversation
Summary of ChangesHello @iamarcel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the accuracy and quality of the memory system by ensuring that only user-provided facts are stored and by implementing a more robust graph cleanup mechanism. These changes prevent the accumulation of incorrect or speculative information, allowing user corrections to propagate effectively, and ultimately maintaining a more reliable and truthful knowledge graph over time. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces several significant improvements to the memory extraction and cleanup processes. The prompts for both graph extraction and cleanup have been substantially refined to focus on user-provided facts, avoid assistant speculation, and use the User Atlas as a source of truth for contradiction detection. This should greatly enhance the accuracy and quality of the stored knowledge graph. Additionally, a missing import in dream.ts has been fixed.
My review focuses on code consistency. I've pointed out an inconsistent use of dynamic imports in cleanup-graph.ts that could be aligned with the rest of the file for better maintainability. Overall, the changes are well-implemented and align with the stated goals of the pull request.
| const client = await createCompletionClient(userId); | ||
|
|
||
| // Fetch user atlas for context about user corrections and current state | ||
| const { getAtlas } = await import("../atlas"); |
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.
This dynamic import of getAtlas is inconsistent with other static imports in this file, such as createCompletionClient and useDatabase. For better code consistency and maintainability, it's generally better to use static imports at the top of the file unless there's a specific reason for lazy loading (like circular dependencies or performance optimization). Consider making this a static import to align with the file's existing style.
|
@claude can you fix the CI failure? |
467e062 to
da6ff10
Compare
This commit addresses several issues with memory extraction and storage: 1. **Distinguish user facts from assistant statements**: Updated the extraction prompt to only extract facts explicitly stated by the user, not speculative statements or assumptions made by the assistant. This prevents the system from storing assistant guesses as if they were user-provided facts. 2. **Enhanced graph cleanup for redundancy removal**: Improved the cleanup prompt with detailed instructions for identifying and removing: - Redundant/duplicate nodes - Speculative or incorrect information - Outdated information - Contradictions (keeping most recent/specific information) 3. **Atlas-based contradiction detection**: Modified the cleanup process to use the User Atlas as the source of truth. When user corrections are made (reflected in the atlas), the nightly cleanup now detects and removes contradicting graph nodes. 4. **Fixed missing import**: Added missing `env` import in routes/dream.ts These changes ensure that: - Only user-stated facts are extracted and stored - The nightly cleanup actively removes redundant and incorrect information - User corrections (via atlas updates) propagate to the graph during cleanup - The memory system maintains higher accuracy and data quality over time
da6ff10 to
5269e95
Compare
This commit addresses several issues with memory extraction and storage:
Distinguish user facts from assistant statements: Updated the extraction prompt to only extract facts explicitly stated by the user, not speculative statements or assumptions made by the assistant. This prevents the system from storing assistant guesses as if they were user-provided facts.
Enhanced graph cleanup for redundancy removal: Improved the cleanup prompt with detailed instructions for identifying and removing:
Atlas-based contradiction detection: Modified the cleanup process to use the User Atlas as the source of truth. When user corrections are made (reflected in the atlas), the nightly cleanup now detects and removes contradicting graph nodes.
Fixed missing import: Added missing
envimport in routes/dream.tsThese changes ensure that: