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)
0 comments
muse hub commit comment sha256:91a541ef8de3cdbff003e6b18e2794c40d789df27f7d8cc7442b20088971eb12 --body "your comment"
No comments yet. Be the first to start the discussion.