-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
Many memories are narrow observations of the same underlying principle. For example, 9 separate memories might each note a specific instance where code should have been deduplicated or reused. Individually they're noisy — each surfaces in slightly wrong contexts. But the extracted principle ("prefer reuse over duplication") would be high-value and broadly applicable.
This is a common pattern: multiple low-generalizability memories that share a theme but were created independently across sessions. They clutter surfacing, dilute each other's signal, and none individually captures the real lesson.
Desired behavior
Periodically (e.g., during maintain or a new consolidate subcommand):
- Cluster memories by semantic similarity (embeddings or keyword overlap)
- Identify clusters where N+ memories (e.g., 3+) share a common theme
- Propose a single generalized memory that captures the principle
- On approval: create the generalized memory, archive or remove the originals
- The generalized memory should have higher generalizability score and broader (but still precise) keywords
Examples
- 9 memories about specific deduplication opportunities → 1 memory: "extract shared logic when 3+ call sites exist"
- 5 memories about forgetting to check git status before destructive ops → 1 memory: "always check VCS state before destructive operations"
- 4 memories about specific test isolation failures → 1 memory: "parallel tests must not share mutable state"
Design considerations
- Clustering could use TF-IDF similarity (already in the codebase) on memory content
- Haiku can propose the generalized principle from a cluster
- Should be dry-run capable (show proposed consolidations without applying)
- Threshold for cluster size should be configurable (default 3)
- Generalized memory inherits the combined feedback history of its sources
- Original memories get archived (not deleted) so consolidation can be reviewed/reversed
Related
- Retroactive generalizability scoring for existing memories #360 (retroactive generalizability scoring) — complementary; scoring identifies low-generalizability memories, this consolidates them
- Feedback-driven keyword refinement #346 (feedback-driven keyword refinement) — complementary; consolidation produces better keywords naturally
- Skill tier 2 promotion in CLAUDE.md already describes this pattern ("Generated from memory clusters, size >= 3")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels