memorix 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.9.0] — 2026-02-24
6
+
7
+ ### Added
8
+ - **Memory Consolidation** (`memorix_consolidate`) — Find and merge similar observations to reduce memory bloat. Uses Jaccard text similarity to cluster observations by entity+type, then merges them preserving all facts, files, and concepts. Supports `preview` (dry run) and `execute` modes with configurable similarity threshold.
9
+ - **Temporal Queries** — `memorix_search` now supports `since` and `until` parameters for date range filtering. Example: "What auth decisions did we make last week?"
10
+ - **Explainable Recall** — Search results now include a `Matched` column showing which fields matched the query (title, entity, concept, narrative, fact, file, or fuzzy). Helps understand why each result was found.
11
+ - **Export/Import** — Two new tools for team collaboration:
12
+ - `memorix_export` — Export project observations and sessions as JSON (importable) or Markdown (human-readable for PRs/docs)
13
+ - `memorix_import` — Import from JSON export, re-assigns IDs, skips duplicate topicKeys
14
+ - **Dashboard Sessions Panel** — New "Sessions" tab in the web dashboard with timeline view, active/completed counts, agent info, and session summaries. Bilingual (EN/中文).
15
+ - **Auto sessionId** — `memorix_store` now automatically associates the current active session's ID with stored observations.
16
+ - **16 new tests** — 8 consolidation + 8 export/import (484 total).
17
+
18
+ ### Stats
19
+ - **MCP Tools:** 20 → 24 (memorix_consolidate, memorix_export, memorix_import + dashboard sessions API)
20
+ - **Tests:** 484/484 passing
21
+
5
22
  ## [0.8.0] — 2026-02-24
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -164,19 +164,59 @@ After 2 weeks of development, you have 50+ observations:
164
164
  → New team members' AI instantly knows your project's patterns!
165
165
  ```
166
166
 
167
+ ### Scenario 6: Session Lifecycle (v0.8.0)
168
+
169
+ ```
170
+ Morning — Start a new session in Windsurf:
171
+ → memorix_session_start auto-injects:
172
+ 📋 Previous Session: "Implemented JWT auth middleware"
173
+ 🔴 JWT tokens expire silently (gotcha)
174
+ 🟤 Use Docker for deployment (decision)
175
+ → AI instantly knows what you did yesterday!
176
+
177
+ Evening — End the session:
178
+ → memorix_session_end saves structured summary
179
+ → Next session (any agent!) gets this context automatically
180
+ ```
181
+
182
+ ### Scenario 7: Topic Key Upsert — No More Duplicates (v0.8.0)
183
+
184
+ ```
185
+ You update your architecture decision 3 times over a week:
186
+
187
+ Day 1: memorix_store(topicKey="architecture/auth-model", ...)
188
+ → Creates observation #42 (rev 1)
189
+
190
+ Day 3: memorix_store(topicKey="architecture/auth-model", ...)
191
+ → Updates #42 in-place (rev 2) — NOT a new #43!
192
+
193
+ Day 5: memorix_store(topicKey="architecture/auth-model", ...)
194
+ → Updates #42 again (rev 3)
195
+
196
+ Result: 1 observation with latest content, not 3 duplicates!
197
+ ```
198
+
167
199
  ---
168
200
 
169
201
  ## 🧠 What Memorix Can Do
170
202
 
171
- ### Smart Memory (17 MCP Tools)
203
+ ### Smart Memory (24 MCP Tools)
172
204
 
173
205
  | What You Say | What Memorix Does |
174
206
  |-------------|-------------------|
175
- | "Remember this architecture decision" | `memorix_store` — Classifies as 🟤 decision, extracts entities, creates graph relations |
207
+ | "Remember this architecture decision" | `memorix_store` — Classifies as 🟤 decision, extracts entities, creates graph relations, auto-associates session |
176
208
  | "What did we decide about auth?" | `memorix_search` → `memorix_detail` — 3-layer progressive disclosure, ~10x token savings |
209
+ | "What auth decisions last week?" | `memorix_search` with `since`/`until` — Temporal queries with date range filtering |
177
210
  | "What happened around that bug fix?" | `memorix_timeline` — Shows chronological context before/after |
178
- | "Show me the knowledge graph" | `memorix_dashboard` — Opens interactive web UI with D3.js graph |
211
+ | "Show me the knowledge graph" | `memorix_dashboard` — Opens interactive web UI with D3.js graph + sessions panel |
179
212
  | "Which memories are getting stale?" | `memorix_retention` — Exponential decay scores, identifies archive candidates |
213
+ | "Start a new session" | `memorix_session_start` — Tracks session lifecycle, auto-injects previous session summaries + key memories |
214
+ | "End this session" | `memorix_session_end` — Saves structured summary (Goal/Discoveries/Accomplished/Files) for next session |
215
+ | "What did we do last session?" | `memorix_session_context` — Retrieves session history and key observations |
216
+ | "Suggest a topic key for this" | `memorix_suggest_topic_key` — Generates stable keys for deduplication (e.g. `architecture/auth-model`) |
217
+ | "Clean up duplicate memories" | `memorix_consolidate` — Find & merge similar observations by text similarity, preserving all facts |
218
+ | "Export this project's memories" | `memorix_export` — JSON (importable) or Markdown (human-readable for PRs/docs) |
219
+ | "Import memories from teammate" | `memorix_import` — Restore from JSON export, re-assigns IDs, deduplicates by topicKey |
180
220
 
181
221
  ### Cross-Agent Workspace Sync
182
222
 
@@ -298,7 +338,7 @@ With vector search, queries like "authentication" also match memories about "log
298
338
  Install Memorix in both IDEs. They share the same local memory directory — architecture decisions made in Cursor are instantly searchable in Claude Code. No cloud sync needed.
299
339
 
300
340
  **How do I prevent my AI from forgetting previous sessions?**
301
- Memorix stores observations persistently on disk. Next session, the AI calls `memorix_search` and retrieves prior decisions, gotchas, and knowledge. With auto-memory hooks, it even captures context automatically.
341
+ Use `memorix_session_start` at the beginning of each session it automatically injects previous session summaries and key observations (gotchas, decisions, discoveries). Use `memorix_session_end` to save a structured summary before leaving. All observations persist on disk and are searchable via `memorix_search` anytime.
302
342
 
303
343
  **How do I sync MCP server configs between IDEs?**
304
344
  Run `memorix_workspace_sync` with action `"migrate"` and your target IDE. It scans source configs and generates compatible configs for the target — merges, never overwrites.
package/README.zh-CN.md CHANGED
@@ -164,19 +164,59 @@ Antigravity 会将工作目录设为自身安装路径(如 `G:\Antigravity`)
164
164
  → 新同事的 AI 立即掌握你项目的最佳实践!
165
165
  ```
166
166
 
167
+ ### 场景 6:会话生命周期(v0.8.0)
168
+
169
+ ```
170
+ 早上 — 在 Windsurf 中开始新会话:
171
+ → memorix_session_start 自动注入:
172
+ 📋 上次会话: "实现了 JWT 认证中间件"
173
+ 🔴 JWT token 静默过期(踩坑)
174
+ 🟤 使用 Docker 部署(决策)
175
+ → AI 立即知道你昨天做了什么!
176
+
177
+ 晚上 — 结束会话:
178
+ → memorix_session_end 保存结构化摘要
179
+ → 下次会话(任何 Agent!)自动获取这些上下文
180
+ ```
181
+
182
+ ### 场景 7:Topic Key 去重 — 不再有重复记忆(v0.8.0)
183
+
184
+ ```
185
+ 你在一周内更新了 3 次架构决策:
186
+
187
+ 第 1 天: memorix_store(topicKey="architecture/auth-model", ...)
188
+ → 创建观察记录 #42(rev 1)
189
+
190
+ 第 3 天: memorix_store(topicKey="architecture/auth-model", ...)
191
+ → 原地更新 #42(rev 2)— 不是新建 #43!
192
+
193
+ 第 5 天: memorix_store(topicKey="architecture/auth-model", ...)
194
+ → 再次更新 #42(rev 3)
195
+
196
+ 结果:1 条记录包含最新内容,而不是 3 条重复!
197
+ ```
198
+
167
199
  ---
168
200
 
169
201
  ## 🧠 Memorix 能做什么
170
202
 
171
- ### 智能记忆(17 个 MCP 工具)
203
+ ### 智能记忆(24 个 MCP 工具)
172
204
 
173
205
  | 你说的 | Memorix 做的 |
174
206
  |--------|-------------|
175
- | "记住这个架构决策" | `memorix_store` — 分类为 🟤 决策,提取实体,创建图关系 |
207
+ | "记住这个架构决策" | `memorix_store` — 分类为 🟤 决策,提取实体,创建图关系,自动关联会话 |
176
208
  | "我们之前关于认证决定了什么?" | `memorix_search` → `memorix_detail` — 3 层渐进式展示,节省约 10 倍 token |
209
+ | "上周关于认证的决策?" | `memorix_search` + `since`/`until` — 时序查询,按日期范围过滤 |
177
210
  | "那个 bug 修复前后发生了什么?" | `memorix_timeline` — 按时间显示前后上下文 |
178
- | "显示知识图谱" | `memorix_dashboard` — 打开交互式 Web UI,含 D3.js 图谱 |
211
+ | "显示知识图谱" | `memorix_dashboard` — 打开交互式 Web UI,含 D3.js 图谱 + 会话面板 |
179
212
  | "哪些记忆快过期了?" | `memorix_retention` — 指数衰减评分,识别归档候选 |
213
+ | "开始新会话" | `memorix_session_start` — 跟踪会话生命周期,自动注入上次会话摘要 + 关键记忆 |
214
+ | "结束这次会话" | `memorix_session_end` — 保存结构化摘要(目标/发现/完成/文件),供下次会话使用 |
215
+ | "上次我们做了什么?" | `memorix_session_context` — 检索会话历史和关键观察记录 |
216
+ | "给这个建议一个 topic key" | `memorix_suggest_topic_key` — 生成稳定的去重键(如 `architecture/auth-model`) |
217
+ | "清理重复记忆" | `memorix_consolidate` — 按文本相似度查找并合并相似观察记录,保留所有事实 |
218
+ | "导出这个项目的记忆" | `memorix_export` — JSON(可导入)或 Markdown(人类可读,适合 PR/文档) |
219
+ | "导入队友的记忆" | `memorix_import` — 从 JSON 导出恢复,重新分配 ID,按 topicKey 去重 |
180
220
 
181
221
  ### 跨 Agent 工作区同步
182
222
 
@@ -298,7 +338,7 @@ npm install -g @huggingface/transformers
298
338
  在两个 IDE 都安装 Memorix。它们共享相同的本地记忆目录 — 在 Cursor 中做的架构决策在 Claude Code 中立即可搜索,无需云同步。
299
339
 
300
340
  **如何防止 AI 忘记之前的会话?**
301
- Memorix 将观察记录持久存储在磁盘上。下次会话,AI 调用 `memorix_search` 即可检索之前的决策、踩坑和知识。配合自动记忆 Hook,甚至可以自动捕获上下文。
341
+ 在每次会话开始时调用 `memorix_session_start` 它会自动注入上次会话的摘要和关键观察记录(踩坑、决策、发现)。会话结束时调用 `memorix_session_end` 保存结构化摘要。所有观察记录持久存储在磁盘上,随时可通过 `memorix_search` 搜索。
302
342
 
303
343
  **如何在 IDE 之间同步 MCP 服务器配置?**
304
344
  运行 `memorix_workspace_sync`,设置 action 为 `"migrate"`,指定目标 IDE。它会扫描源配置并生成兼容的目标配置 — 合并,永不覆盖。