feat(memory): Dream Consolidation + Hierarchical Summarizer#9
Closed
cdzzy wants to merge 50 commits into
Closed
Conversation
Core features: - Ebbinghaus forgetting curve engine with dynamic strength/stability - Multi-level memory compression (pluggable strategies, LLM-ready) - Cross-agent shared memory spaces with ACL and conflict detection - Memory versioning: update, supersede, restore, chain resolution - Multi-signal recall engine (recency + strength + relevance + importance) - 79 passing tests across 6 test files 🤖 Generated with [Qoder][https://qoder.com]
Add semantic compression strategies for memory management: - SemanticCompressionStrategy: LLM-powered memory summarization - HierarchicalSemanticStrategy: Multi-level L1/L2 compression - KeyExtractionStrategy: Extract key facts from memories - createSemanticCompressor: Factory function Features: - Configurable prompt templates - Metadata inclusion options - Fallback to rule-based compression on LLM failure - Importance and strength-based memory prioritization Reference: Inspired by claude-mem AI compression approach.
- Add src/semantic-search.ts: - EmbeddingProvider interface - OpenAIEmbeddings (text-embedding-3-small) - OllamaEmbeddings (nomic-embed-text) - SemanticSearchAdapter combining vector similarity with recall signals - Cosine similarity scoring with importance/recency boosting - Add examples/06_semantic_search.ts with full demo - Export new module from index.ts - Inspired by supermemory and Mem0 semantic patterns
- Add LLMImportanceScorer: analyze memory content and assign importance level - Batch scoring for multiple memories - Heuristic fallback when LLM is unavailable - Integrates with existing memory lifecycle closes #trending-2026-04-04
Inspired by kiwi-mem (2026-04-18 AI Trending): - DreamConsolidator: async background consolidation of weak memories - HierarchicalSummarizer: calendar-tier day/week/month digests
toISOString() can return the previous day in UTC+8 environments. Use getFullYear/getMonth/getDate for timezone-correct date strings.
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 two new memory management modules inspired by kiwi-mem (AI Trending 2026-04-18).
DreamConsolidator (
src/dream-consolidator.ts)namespace::primaryTag, compresses groups into high-stability dream engramscompressedfor audit trailHierarchicalSummarizer (
src/hierarchical-summarizer.ts)memory:compressed/memory:encodedevents