feat minor memory feat/phase-2g-bundle
AI Agent git-import/068377df · 113 days ago · Apr 4, 2026 · Diff

feat(memory): Session 3 — topic-based memory partitioning

Topic extraction: - extractTopicFromEvent() heuristic derives topic slugs from event data using a priority cascade: explicit data.topic → directory from path → query keywords (stop-word filtered, max 3) → source/key → event type - slugify() normalizes to URL-safe slugs (lowercase, hyphenated, ≤64 chars)

FileMemoryProvider partitioning (opt-in via topicPartition: true): - storeEvent() mirrors to topics/{slug}.jsonl alongside main events.jsonl - listEvents() reads from topic file when filtering by topic (fast path); falls back to scan + extractTopicFromEvent when partition is disabled - listTopics() / getTopicStats() for topic enumeration - clearEvents() and pruneExpired() rebuild topic partitions after mutation - getStats() includes topics array when partitioning is enabled

MemoryManager: - list() propagates topic filter to provider - listTopics() / topicStats() new methods - generateMemoryIndex() adds ## Topics section with per-topic event counts - createMemoryManager() reads memory.topic_partition from config

MCP: - memory_list tool accepts optional topic parameter - knowtation://memory/topic/{slug} resource template with list handler - buildMemoryTopicResource() metadata builder

CLI: - memory list accepts --topic <slug> filter

Tests: 58 new tests in test/memory-topics.test.mjs (213 total, all passing)

sha256:91a541ef8de3cdbff003e6b18e2794c40d789df27f7d8cc7442b20088971eb12 sha
sha256:4108436f8d3d02eb110ce75d50495ae9e8b4295310b3f4bc2b382a639adde97a snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:91a541ef8de3cdbff003e6b18e2794c40d789df27f7d8cc7442b20088971eb12 --body "your comment"