feat: pi-dream — memory consolidation (memory_dream tool + /pi-dream command) - #34
Open
KrissTos wants to merge 4 commits into
Open
feat: pi-dream — memory consolidation (memory_dream tool + /pi-dream command)#34KrissTos wants to merge 4 commits into
KrissTos wants to merge 4 commits into
Conversation
…command) - parseMemoryBlocks/dreamSimilarity/dreamAnalyze/dreamDropIndices/dreamApply pure functions - memory_dream tool: report mode (read-only findings) + apply mode (removes duplicate older copies and superseded entries via existing recovery-record pipeline, undoable with memory_restore; refreshes snapshot + qmd index) - /pi-dream command: quick read-only health check with notification summary - 10 new unit tests (192 total pass), tsc + biome clean Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
- /pi-dream (or /pi-dream report) → sends user message asking agent to run memory_dream report mode and show full findings in conversation - /pi-dream apply → runs apply mode, shows removed entries + recovery ID - replaces cramped notify-only health check Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
…ded) Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
memory_dream, a memory consolidation pass for long-term memory (MEMORY.md), exposed both as a tool and a read-only/pi-dreamcommand.After many sessions, MEMORY.md accumulates near-duplicate entries and older entries that are superseded by newer ones about the same topic. Bloat here is injected into every session start — wasted context tokens plus stale-recall risk.
What it does
forgetBlocks, then:mode:'report'(default) — analyzes without touching files; returns grouped findings with previewsmode:'apply'— removes redundant older copies through the existing recovery-record pipeline: writes a completerecovery/record before mutating the file (undoable viamemory_restore), marks snapshot dirty, schedules qmd updateDesign notes
snapshotDirty, and debounced qmd updates behave exactly likememory_forgetduplicateSimilarity/supersedeSimilarityparameters/pi-dreamcommand gives an instant health-check notification without any file mutationTesting
Command example
```
/pi-dream → notification: "12 entries, 2 duplicate group(s), 3 superseded → 4 removable"
memory_dream {} → full findings report with previews
memory_dream { mode: "apply" } → consolidation with recovery ID
```