Skip to content

feat(memory): Dream Consolidation + Hierarchical Summarizer#9

Closed
cdzzy wants to merge 50 commits into
mainfrom
feat/dream-consolidation
Closed

feat(memory): Dream Consolidation + Hierarchical Summarizer#9
cdzzy wants to merge 50 commits into
mainfrom
feat/dream-consolidation

Conversation

@cdzzy
Copy link
Copy Markdown
Owner

@cdzzy cdzzy commented Apr 18, 2026

Summary

Adds two new memory management modules inspired by kiwi-mem (AI Trending 2026-04-18).

DreamConsolidator (src/dream-consolidator.ts)

  • Scans weak/decayed memories (strength < threshold) in background
  • Groups by namespace::primaryTag, compresses groups into high-stability dream engrams
  • Optional auto-schedule mode; marks originals as compressed for audit trail

HierarchicalSummarizer (src/hierarchical-summarizer.ts)

  • Day tier (stability 8x), Week tier (24x), Month tier (72x)
  • Rolling digests with tag-based identification
  • Plugs into existing memory:compressed / memory:encoded events

cdzzy and others added 30 commits March 14, 2026 15:02
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
cdzzy added 20 commits April 9, 2026 20:51
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant