memorix 0.9.18 → 0.9.19

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/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  <img src="https://img.shields.io/badge/Works%20with-Gemini%20CLI-4285F4?style=flat-square" alt="Gemini CLI">
22
22
  </p>
23
23
  <p align="center">
24
- <a href="#-stop-re-explaining-your-project">Why</a> •
24
+ <a href="#%EF%B8%8F-stop-re-explaining-your-project">Why</a> •
25
25
  <a href="#-get-started-in-30-seconds">Quick Start</a> •
26
26
  <a href="#-real-world-scenarios">Scenarios</a> •
27
27
  <a href="#-what-memorix-can-do">Features</a> •
@@ -32,7 +32,7 @@
32
32
 
33
33
  ---
34
34
 
35
- ## 😤 Stop Re-Explaining Your Project
35
+ ## ⚠️ Stop Re-Explaining Your Project
36
36
 
37
37
  Your AI assistant forgets everything when you start a new chat. You spend 10 minutes re-explaining your architecture. **Again.** And if you switch from Cursor to Claude Code? Everything is gone. **Again.**
38
38
 
@@ -167,17 +167,46 @@ No API keys. No cloud accounts. No dependencies. Works with any directory (git r
167
167
 
168
168
  > 📖 **Full setup guide for all 8 agents** → [docs/SETUP.md](docs/SETUP.md)
169
169
 
170
- <details>
171
- <summary><strong>🔧 Troubleshooting</strong></summary>
170
+ ### 🔧 Troubleshooting — MCP Connection Issues
172
171
 
173
- | Problem | Solution |
174
- |---------|----------|
175
- | `MCP server initialization timed out after 60 seconds` | You're using `npx`. Run `npm install -g memorix` and change config to `"command": "memorix"` |
176
- | `Cannot start Memorix: no valid project detected` | Your CWD is a system directory (home, Desktop, etc). Open a real project folder or set `MEMORIX_PROJECT_ROOT` |
177
- | `memorix: command not found` | Run `npm install -g memorix` first. Verify with `memorix --version` |
178
- | Parameter type errors (GLM/non-Anthropic models) | Update to v0.9.1+: `npm install -g memorix@latest` |
172
+ > **⚠️ #1 Mistake: Do NOT manually run `memorix serve` in a terminal.**
173
+ > MCP uses **stdio transport** — your IDE (Claude Code, Cursor, etc.) launches memorix as a subprocess automatically. Running it manually in PowerShell/Terminal does nothing for the IDE connection.
179
174
 
180
- </details>
175
+ **Quick diagnostic** — run this first:
176
+ ```bash
177
+ memorix --version # Should print version number
178
+ memorix serve --cwd . # Should show "[memorix] MCP Server running on stdio"
179
+ ```
180
+ If either fails, follow the table below:
181
+
182
+ | Symptom | Cause | Fix |
183
+ |---------|-------|-----|
184
+ | `memorix · ✗ failed` in IDE | IDE can't find the `memorix` command | Run `npm install -g memorix`. On Windows, **restart your IDE** after install so it picks up the new PATH |
185
+ | `MCP server initialization timed out` | Using `npx` (downloads every time) | Switch to global install: `npm install -g memorix`, change config to `"command": "memorix"` |
186
+ | Repeated "Reconnected to memorix" then fails | memorix process crashes on startup | Check: 1) Node.js ≥ 18 (`node -v`), 2) open a **real project folder** (not Desktop/Home), 3) set `MEMORIX_PROJECT_ROOT` in MCP config |
187
+ | `Cannot start Memorix: no valid project detected` | CWD is a system directory | Open a project folder with code, or add `"env": { "MEMORIX_PROJECT_ROOT": "/path/to/project" }` to your MCP config |
188
+ | `memorix: command not found` | npm global bin not in PATH | Run `npm config get prefix` to find install location, add its `bin/` to your system PATH, then restart IDE |
189
+ | Works in terminal but not in IDE | IDE uses a different PATH than your shell | **Windows:** restart IDE after `npm install -g`. **macOS/Linux:** ensure `~/.bashrc` or `~/.zshrc` exports the npm global bin path |
190
+ | Parameter type errors | Old version or non-Anthropic model quirks | Update: `npm install -g memorix@latest` |
191
+
192
+ **Correct `.claude.json` config:**
193
+ ```json
194
+ {
195
+ "mcpServers": {
196
+ "memorix": {
197
+ "command": "memorix",
198
+ "args": ["serve"]
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ **❌ Wrong** — do NOT use any of these:
205
+ ```
206
+ "command": "npx" ← will timeout
207
+ "command": "npx -y memorix serve" ← wrong format
208
+ "command": "node memorix serve" ← not how it works
209
+ ```
181
210
 
182
211
  ---
183
212
 
@@ -236,138 +265,33 @@ Now you want to try Kiro.
236
265
  → Kiro is ready in seconds, not hours!
237
266
  ```
238
267
 
239
- ### Scenario 5: Auto-Generated Project Skills
240
-
241
- ```
242
- After 2 weeks of development, you have 50+ observations:
243
- - 8 gotchas about Windows path issues
244
- - 5 decisions about the auth module
245
- - 3 problem-solutions for database migrations
246
-
247
- You: "Generate project skills"
248
- → memorix_skills clusters observations by entity
249
- → Auto-generates SKILL.md files:
250
- - "auth-module-guide.md" — JWT setup, refresh flow, common pitfalls
251
- - "database-migrations.md" — Prisma patterns, rollback strategies
252
- → Syncs skills to any agent: Cursor, Claude Code, Kiro...
253
- → New team members' AI instantly knows your project's patterns!
254
- ```
255
-
256
- ### Scenario 6: Session Lifecycle (v0.8.0)
257
-
258
- ```
259
- Morning — Start a new session in Windsurf:
260
- → memorix_session_start auto-injects:
261
- 📋 Previous Session: "Implemented JWT auth middleware"
262
- 🔴 JWT tokens expire silently (gotcha)
263
- 🟤 Use Docker for deployment (decision)
264
- → AI instantly knows what you did yesterday!
265
-
266
- Evening — End the session:
267
- → memorix_session_end saves structured summary
268
- → Next session (any agent!) gets this context automatically
269
- ```
270
-
271
- ### Scenario 7: Topic Key Upsert — No More Duplicates (v0.8.0)
272
-
273
- ```
274
- You update your architecture decision 3 times over a week:
275
-
276
- Day 1: memorix_store(topicKey="architecture/auth-model", ...)
277
- → Creates observation #42 (rev 1)
278
-
279
- Day 3: memorix_store(topicKey="architecture/auth-model", ...)
280
- → Updates #42 in-place (rev 2) — NOT a new #43!
281
-
282
- Day 5: memorix_store(topicKey="architecture/auth-model", ...)
283
- → Updates #42 again (rev 3)
284
-
285
- Result: 1 observation with latest content, not 3 duplicates!
286
- ```
287
-
288
268
  ---
289
269
 
290
270
  ## 🧠 What Memorix Can Do
291
271
 
292
- ### Smart Memory (24 MCP Tools)
293
-
294
- | What You Say | What Memorix Does |
295
- |-------------|-------------------|
296
- | "Remember this architecture decision" | `memorix_store` — Classifies as 🟤 decision, extracts entities, creates graph relations, auto-associates session |
297
- | "What did we decide about auth?" | `memorix_search` → `memorix_detail` — 3-layer progressive disclosure, ~10x token savings |
298
- | "What auth decisions last week?" | `memorix_search` with `since`/`until` — Temporal queries with date range filtering |
299
- | "What happened around that bug fix?" | `memorix_timeline` — Shows chronological context before/after |
300
- | "Show me the knowledge graph" | `memorix_dashboard` — Opens interactive web UI with D3.js graph + sessions panel |
301
- | "Which memories are getting stale?" | `memorix_retention` — Exponential decay scores, identifies archive candidates |
302
- | "Start a new session" | `memorix_session_start` — Tracks session lifecycle, auto-injects previous session summaries + key memories |
303
- | "End this session" | `memorix_session_end` — Saves structured summary (Goal/Discoveries/Accomplished/Files) for next session |
304
- | "What did we do last session?" | `memorix_session_context` — Retrieves session history and key observations |
305
- | "Suggest a topic key for this" | `memorix_suggest_topic_key` — Generates stable keys for deduplication (e.g. `architecture/auth-model`) |
306
- | "Clean up duplicate memories" | `memorix_consolidate` — Find & merge similar observations by text similarity, preserving all facts |
307
- | "Export this project's memories" | `memorix_export` — JSON (importable) or Markdown (human-readable for PRs/docs) |
308
- | "Import memories from teammate" | `memorix_import` — Restore from JSON export, re-assigns IDs, deduplicates by topicKey |
309
-
310
- ### Cross-Agent Workspace Sync
311
-
312
- | What You Say | What Memorix Does |
313
- |-------------|-------------------|
314
- | "Sync my MCP servers to Kiro" | `memorix_workspace_sync` — Migrates configs, merges (never overwrites) |
315
- | "Check my agent rules" | `memorix_rules_sync` — Scans 8 agents, deduplicates, detects conflicts |
316
- | "Generate rules for Cursor" | `memorix_rules_sync` — Cross-format conversion (`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`) |
317
- | "Generate project skills" | `memorix_skills` — Creates SKILL.md from observation patterns |
318
- | "Inject the auth skill" | `memorix_skills` — Returns skill content directly into agent context |
319
-
320
- ### Knowledge Graph (MCP Official Compatible)
321
-
322
- | Tool | What It Does |
323
- |------|-------------|
324
- | `create_entities` | Build your project's knowledge graph |
325
- | `create_relations` | Connect entities with typed edges (causes, fixes, depends_on) |
326
- | `add_observations` | Attach observations to entities |
327
- | `search_nodes` / `open_nodes` | Query the graph |
328
- | `read_graph` | Export full graph for visualization |
329
-
330
- > **Drop-in compatible** with [MCP Official Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) — same API, more features.
331
-
332
- ### 9 Observation Types
272
+ ### 25 MCP Tools
333
273
 
334
- Every memory is classified for intelligent retrieval:
274
+ | Category | Tools | What They Do |
275
+ |----------|-------|-------------|
276
+ | **Store & Classify** | `memorix_store`, `memorix_suggest_topic_key` | Store memories with 9 types (🔴gotcha 🟤decision 🟡fix ...), dedup via topic keys |
277
+ | **Search & Retrieve** | `memorix_search`, `memorix_detail`, `memorix_timeline` | 3-layer progressive disclosure (~10x token savings), temporal queries, chronological context |
278
+ | **Sessions** | `memorix_session_start/end/context` | Auto-inject previous session context, save structured summaries |
279
+ | **Maintenance** | `memorix_retention`, `memorix_consolidate`, `memorix_export/import` | Decay scoring, merge duplicates, backup & share |
280
+ | **Dashboard** | `memorix_dashboard` | Interactive web UI — D3.js knowledge graph, observation browser, retention panel |
281
+ | **Workspace Sync** | `memorix_workspace_sync`, `memorix_rules_sync`, `memorix_skills` | Migrate MCP configs across 8 agents, sync rules (`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`), auto-generate project skills |
282
+ | **Knowledge Graph** | `create_entities`, `create_relations`, `add_observations`, `delete_entities`, `delete_observations`, `delete_relations`, `search_nodes`, `open_nodes`, `read_graph` | [MCP Official Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) compatible — same API, more features |
335
283
 
336
- | Icon | Type | When To Use |
337
- |------|------|-------------|
338
- | 🎯 | `session-request` | Original task/goal for this session |
339
- | 🔴 | `gotcha` | Critical pitfall — "Never do X because Y" |
340
- | 🟡 | `problem-solution` | Bug fix with root cause and solution |
341
- | 🔵 | `how-it-works` | Technical explanation of a system |
342
- | 🟢 | `what-changed` | Code/config change record |
343
- | 🟣 | `discovery` | New insight or finding |
344
- | 🟠 | `why-it-exists` | Rationale behind a design choice |
345
- | 🟤 | `decision` | Architecture/design decision |
346
- | ⚖️ | `trade-off` | Compromise with pros/cons |
347
-
348
- ### Visual Dashboard
349
-
350
- Run `memorix_dashboard` to open a web UI at `http://localhost:3210`:
284
+ ### 9 Observation Types
351
285
 
352
- - **Interactive Knowledge Graph** D3.js force-directed visualization of entities and relations
353
- - **Observation Browser** — Filter by type, search with highlighting, expand/collapse details
354
- - **Retention Panel** — See which memories are active, stale, or candidates for archival
355
- - **Project Switcher** — View any project's data without switching IDEs
356
- - **Batch Cleanup** — Auto-detect and bulk-delete low-quality observations
357
- - **Light/Dark Theme** — Premium glassmorphism design, bilingual (EN/中文)
286
+ Every memory is classified: 🎯 session-request · 🔴 gotcha · 🟡 problem-solution · 🔵 how-it-works · 🟢 what-changed · 🟣 discovery · 🟠 why-it-exists · 🟤 decision · ⚖️ trade-off
358
287
 
359
288
  ### Auto-Memory Hooks
360
289
 
361
- Memorix can **automatically capture** decisions, errors, and gotchas from your coding sessions:
362
-
363
290
  ```bash
364
291
  memorix hooks install # One-command setup
365
292
  ```
366
293
 
367
- - **Implicit Memory** Detects patterns like "I decided to...", "The bug was caused by...", "Never use X"
368
- - **Session Start Injection** — Loads recent high-value memories into agent context automatically
369
- - **Multi-Language** — English + Chinese keyword matching
370
- - **Smart Filtering** — 30s cooldown, skips trivial commands (ls, cat, pwd)
294
+ Automatically captures decisions, errors, and gotchas from your coding sessions. Detects patterns in English + Chinese, injects high-value memories at session start, with smart filtering (30s cooldown, skips trivial commands).
371
295
 
372
296
  ---
373
297
 
@@ -375,7 +299,7 @@ memorix hooks install # One-command setup
375
299
 
376
300
  | | [Mem0](https://github.com/mem0ai/mem0) | [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service) | [claude-mem](https://github.com/anthropics/claude-code) | **Memorix** |
377
301
  |---|---|---|---|---|
378
- | **Agents supported** | SDK-based | 13+ (MCP) | Claude Code only | **7 IDEs (MCP)** |
302
+ | **Agents supported** | SDK-based | 13+ (MCP) | Claude Code only | **8 agents (MCP)** |
379
303
  | **Cross-agent sync** | No | No | No | **Yes (configs, rules, skills, workflows)** |
380
304
  | **Rules sync** | No | No | No | **Yes (7 formats)** |
381
305
  | **Skills engine** | No | No | No | **Yes (auto-generated from memory)** |
@@ -387,7 +311,7 @@ memorix hooks install # One-command setup
387
311
  | **Visual dashboard** | Cloud UI | Yes | No | **Yes (web UI + D3.js graph)** |
388
312
  | **Privacy** | Cloud | Local | Local | **100% Local** |
389
313
  | **Cost** | Per-call API | $0 | $0 | **$0** |
390
- | **Install** | `pip install` | `pip install` | Built into Claude | **`npx memorix serve`** |
314
+ | **Install** | `pip install` | `pip install` | Built into Claude | **`npm i -g memorix`** |
391
315
 
392
316
  **Memorix is the only tool that bridges memory AND workspace across agents.**
393
317
 
@@ -413,9 +337,9 @@ With vector search, queries like "authentication" also match memories about "log
413
337
 
414
338
  - **Auto-detected** — Project identity from `git remote` URL, zero config needed
415
339
  - **MCP roots fallback** — If `cwd` is not a project (e.g., Antigravity), Memorix tries the [MCP roots protocol](https://modelcontextprotocol.io/docs/concepts/roots) to get your workspace path from the IDE
416
- - **Per-project storage** — `~/.memorix/data/<owner--repo>/` per project
340
+ - **Shared storage, metadata isolation** — All data lives in `~/.memorix/data/`, with `projectId` embedded in each observation. This ensures cross-IDE sharing works even when different IDEs detect different project IDs for the same repo
417
341
  - **Scoped search** — Defaults to current project; `scope: "global"` to search all
418
- - **Zero cross-contamination** — Project A's decisions never leak into project B
342
+ - **Zero cross-contamination** — Search results are filtered by project ID; project A's decisions never appear in project B's searches
419
343
 
420
344
  **Detection priority:** `--cwd` → `MEMORIX_PROJECT_ROOT` → `INIT_CWD` → `process.cwd()` → MCP roots → error
421
345
 
@@ -436,7 +360,7 @@ Run `memorix_workspace_sync` with action `"migrate"` and your target IDE. It sca
436
360
  Memorix workspace sync migrates MCP configs, agent rules (`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`), skills, and workflows. One command, seconds to complete.
437
361
 
438
362
  **Is there an MCP server for persistent AI coding memory?**
439
- Yes — Memorix is a cross-agent memory MCP server supporting 7 IDEs with knowledge graph, 3-layer progressive disclosure search, workspace sync, and auto-generated project skills.
363
+ Yes — Memorix is a cross-agent memory MCP server supporting 8 agents with knowledge graph, 3-layer progressive disclosure search, workspace sync, and auto-generated project skills.
440
364
 
441
365
  **How is this different from mcp-memory-service?**
442
366
  Both are great memory servers. Memorix adds: cross-agent workspace sync (MCP configs, rules, skills), auto-generated project skills from memory patterns, 3-layer token-efficient search, and session-start memory injection hooks.
@@ -456,7 +380,7 @@ cd memorix
456
380
  npm install
457
381
 
458
382
  npm run dev # tsup watch mode
459
- npm test # vitest (422 tests)
383
+ npm test # vitest (509 tests)
460
384
  npm run lint # TypeScript type check
461
385
  npm run build # Production build
462
386
  ```
package/README.zh-CN.md CHANGED
@@ -21,7 +21,7 @@
21
21
  <img src="https://img.shields.io/badge/Works%20with-Gemini%20CLI-4285F4?style=flat-square" alt="Gemini CLI">
22
22
  </p>
23
23
  <p align="center">
24
- <a href="#-别再反复解释你的项目了">痛点</a> •
24
+ <a href="#%EF%B8%8F-别再反复解释你的项目了">痛点</a> •
25
25
  <a href="#-30-秒快速开始">快速开始</a> •
26
26
  <a href="#-真实使用场景">场景</a> •
27
27
  <a href="#-memorix-能做什么">功能</a> •
@@ -32,7 +32,7 @@
32
32
 
33
33
  ---
34
34
 
35
- ## 😤 别再反复解释你的项目了
35
+ ## ⚠️ 别再反复解释你的项目了
36
36
 
37
37
  你的 AI 助手每次新对话都会忘记一切。你要花 10 分钟重新解释架构。**又一次。** 如果从 Cursor 切到 Claude Code?所有上下文全部丢失。**又一次。**
38
38
 
@@ -167,17 +167,46 @@ claude mcp add memorix -- memorix serve
167
167
 
168
168
  > 📖 **8 个 Agent 的完整配置指南** → [docs/SETUP.md](docs/SETUP.md)
169
169
 
170
- <details>
171
- <summary><strong>🔧 常见问题</strong></summary>
170
+ ### 🔧 常见问题 — MCP 连接失败
172
171
 
173
- | 问题 | 解决方案 |
174
- |------|----------|
175
- | `MCP server initialization timed out after 60 seconds` | 你在用 `npx`。执行 `npm install -g memorix`,然后把配置改成 `"command": "memorix"` |
176
- | `Cannot start Memorix: no valid project detected` | 你的工作目录是系统目录(主目录、桌面等)。打开一个真正的项目文件夹,或设置 `MEMORIX_PROJECT_ROOT` |
177
- | `memorix: command not found` | 先执行 `npm install -g memorix`,用 `memorix --version` 验证 |
178
- | 参数类型错误(GLM/非 Anthropic 模型) | 更新到 v0.9.1+:`npm install -g memorix@latest` |
172
+ > **⚠️ 最常见的错误:不要在终端手动运行 `memorix serve`!**
173
+ > MCP 使用 **stdio 传输** — 你的 IDE(Claude Code、Cursor 等)会自动启动 memorix 子进程。在 PowerShell/终端里手动运行对 IDE 连接毫无帮助。
179
174
 
180
- </details>
175
+ **快速诊断** — 先在终端跑这两条命令:
176
+ ```bash
177
+ memorix --version # 应该输出版本号
178
+ memorix serve --cwd . # 应该显示 "[memorix] MCP Server running on stdio"
179
+ ```
180
+ 如果任何一条失败,参考下表:
181
+
182
+ | 症状 | 原因 | 解决方案 |
183
+ |------|------|----------|
184
+ | IDE 里显示 `memorix · ✗ failed` | IDE 找不到 `memorix` 命令 | 执行 `npm install -g memorix`。Windows 用户安装后**必须重启 IDE** 才能识别新的 PATH |
185
+ | `MCP server initialization timed out` | 使用了 `npx`(每次都重新下载) | 改用全局安装:`npm install -g memorix`,配置改成 `"command": "memorix"` |
186
+ | 反复出现 "Reconnected to memorix" 最终失败 | memorix 进程启动后崩溃 | 检查:1) Node.js ≥ 18(`node -v`),2) 打开**真正的项目文件夹**(不是桌面/主目录),3) 在 MCP 配置中设置 `MEMORIX_PROJECT_ROOT` |
187
+ | `Cannot start Memorix: no valid project detected` | 工作目录是系统目录 | 打开包含代码的项目文件夹,或在 MCP 配置中添加 `"env": { "MEMORIX_PROJECT_ROOT": "/项目路径" }` |
188
+ | `memorix: command not found` | npm 全局安装目录不在 PATH 中 | 执行 `npm config get prefix` 查看安装位置,将其 `bin/` 加入系统 PATH,然后重启 IDE |
189
+ | 终端里能用但 IDE 里不行 | IDE 使用的 PATH 和终端不同 | **Windows:** 安装后重启 IDE。**macOS/Linux:** 确保 `~/.bashrc` 或 `~/.zshrc` 导出了 npm 全局 bin 路径 |
190
+ | 参数类型错误 | 版本过旧或非 Anthropic 模型的兼容问题 | 更新:`npm install -g memorix@latest` |
191
+
192
+ **正确的 `.claude.json` 配置:**
193
+ ```json
194
+ {
195
+ "mcpServers": {
196
+ "memorix": {
197
+ "command": "memorix",
198
+ "args": ["serve"]
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ **❌ 错误写法** — 不要用这些:
205
+ ```
206
+ "command": "npx" ← 会超时
207
+ "command": "npx -y memorix serve" ← 格式错误
208
+ "command": "node memorix serve" ← 不是这样用的
209
+ ```
181
210
 
182
211
  ---
183
212
 
@@ -236,138 +265,33 @@ claude mcp add memorix -- memorix serve
236
265
  → Kiro 几秒内就绑定好了,不用花几个小时!
237
266
  ```
238
267
 
239
- ### 场景 5:自动生成项目技能
240
-
241
- ```
242
- 开发两周后,你有了 50+ 条观察记录:
243
- - 8 个关于 Windows 路径问题的 gotcha
244
- - 5 个关于认证模块的决策
245
- - 3 个数据库迁移的问题-解决方案
246
-
247
- 你: "生成项目技能"
248
- → memorix_skills 按实体聚类观察记录
249
- → 自动生成 SKILL.md 文件:
250
- - "auth-module-guide.md" — JWT 设置、刷新流程、常见陷阱
251
- - "database-migrations.md" — Prisma 模式、回滚策略
252
- → 同步技能到任何 Agent:Cursor、Claude Code、Kiro...
253
- → 新同事的 AI 立即掌握你项目的最佳实践!
254
- ```
255
-
256
- ### 场景 6:会话生命周期(v0.8.0)
257
-
258
- ```
259
- 早上 — 在 Windsurf 中开始新会话:
260
- → memorix_session_start 自动注入:
261
- 📋 上次会话: "实现了 JWT 认证中间件"
262
- 🔴 JWT token 静默过期(踩坑)
263
- 🟤 使用 Docker 部署(决策)
264
- → AI 立即知道你昨天做了什么!
265
-
266
- 晚上 — 结束会话:
267
- → memorix_session_end 保存结构化摘要
268
- → 下次会话(任何 Agent!)自动获取这些上下文
269
- ```
270
-
271
- ### 场景 7:Topic Key 去重 — 不再有重复记忆(v0.8.0)
272
-
273
- ```
274
- 你在一周内更新了 3 次架构决策:
275
-
276
- 第 1 天: memorix_store(topicKey="architecture/auth-model", ...)
277
- → 创建观察记录 #42(rev 1)
278
-
279
- 第 3 天: memorix_store(topicKey="architecture/auth-model", ...)
280
- → 原地更新 #42(rev 2)— 不是新建 #43!
281
-
282
- 第 5 天: memorix_store(topicKey="architecture/auth-model", ...)
283
- → 再次更新 #42(rev 3)
284
-
285
- 结果:1 条记录包含最新内容,而不是 3 条重复!
286
- ```
287
-
288
268
  ---
289
269
 
290
270
  ## 🧠 Memorix 能做什么
291
271
 
292
- ### 智能记忆(24 个 MCP 工具)
293
-
294
- | 你说的 | Memorix 做的 |
295
- |--------|-------------|
296
- | "记住这个架构决策" | `memorix_store` — 分类为 🟤 决策,提取实体,创建图关系,自动关联会话 |
297
- | "我们之前关于认证决定了什么?" | `memorix_search` → `memorix_detail` — 3 层渐进式展示,节省约 10 倍 token |
298
- | "上周关于认证的决策?" | `memorix_search` + `since`/`until` — 时序查询,按日期范围过滤 |
299
- | "那个 bug 修复前后发生了什么?" | `memorix_timeline` — 按时间显示前后上下文 |
300
- | "显示知识图谱" | `memorix_dashboard` — 打开交互式 Web UI,含 D3.js 图谱 + 会话面板 |
301
- | "哪些记忆快过期了?" | `memorix_retention` — 指数衰减评分,识别归档候选 |
302
- | "开始新会话" | `memorix_session_start` — 跟踪会话生命周期,自动注入上次会话摘要 + 关键记忆 |
303
- | "结束这次会话" | `memorix_session_end` — 保存结构化摘要(目标/发现/完成/文件),供下次会话使用 |
304
- | "上次我们做了什么?" | `memorix_session_context` — 检索会话历史和关键观察记录 |
305
- | "给这个建议一个 topic key" | `memorix_suggest_topic_key` — 生成稳定的去重键(如 `architecture/auth-model`) |
306
- | "清理重复记忆" | `memorix_consolidate` — 按文本相似度查找并合并相似观察记录,保留所有事实 |
307
- | "导出这个项目的记忆" | `memorix_export` — JSON(可导入)或 Markdown(人类可读,适合 PR/文档) |
308
- | "导入队友的记忆" | `memorix_import` — 从 JSON 导出恢复,重新分配 ID,按 topicKey 去重 |
309
-
310
- ### 跨 Agent 工作区同步
311
-
312
- | 你说的 | Memorix 做的 |
313
- |--------|-------------|
314
- | "把 MCP 服务器同步到 Kiro" | `memorix_workspace_sync` — 迁移配置,合并(永不覆盖) |
315
- | "检查我的 Agent 规则" | `memorix_rules_sync` — 扫描 7 个 Agent,去重,检测冲突 |
316
- | "为 Cursor 生成规则" | `memorix_rules_sync` — 跨格式转换(`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`) |
317
- | "生成项目技能" | `memorix_skills` — 从观察模式创建 SKILL.md |
318
- | "注入认证技能" | `memorix_skills` — 将技能内容直接返回到 Agent 上下文 |
319
-
320
- ### 知识图谱(兼容 MCP 官方接口)
321
-
322
- | 工具 | 功能 |
323
- |------|-----|
324
- | `create_entities` | 构建项目知识图谱 |
325
- | `create_relations` | 用类型化边连接实体(causes、fixes、depends_on) |
326
- | `add_observations` | 将观察附加到实体 |
327
- | `search_nodes` / `open_nodes` | 查询图谱 |
328
- | `read_graph` | 导出完整图谱用于可视化 |
329
-
330
- > **即插即用**,兼容 [MCP 官方 Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) — 相同 API,更多功能。
331
-
332
- ### 9 种观察类型
272
+ ### 25 个 MCP 工具
333
273
 
334
- 每条记忆都有分类标签,用于智能检索:
274
+ | 类别 | 工具 | 功能 |
275
+ |------|------|------|
276
+ | **存储与分类** | `memorix_store`, `memorix_suggest_topic_key` | 存储记忆,9 种类型(🔴踩坑 🟤决策 🟡修复 ...),通过 topic key 去重 |
277
+ | **搜索与检索** | `memorix_search`, `memorix_detail`, `memorix_timeline` | 3 层渐进式展示(节省约 10 倍 token),时序查询,时间线上下文 |
278
+ | **会话管理** | `memorix_session_start/end/context` | 自动注入上次会话上下文,保存结构化摘要 |
279
+ | **维护** | `memorix_retention`, `memorix_consolidate`, `memorix_export/import` | 衰减评分,合并重复,备份与共享 |
280
+ | **可视化** | `memorix_dashboard` | 交互式 Web UI — D3.js 知识图谱、观察浏览器、衰减面板 |
281
+ | **工作区同步** | `memorix_workspace_sync`, `memorix_rules_sync`, `memorix_skills` | 跨 8 个 Agent 迁移 MCP 配置,同步规则(`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`),自动生成项目技能 |
282
+ | **知识图谱** | `create_entities`, `create_relations`, `add_observations`, `delete_entities`, `delete_observations`, `delete_relations`, `search_nodes`, `open_nodes`, `read_graph` | 兼容 [MCP 官方 Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) — 相同 API,更多功能 |
335
283
 
336
- | 图标 | 类型 | 使用场景 |
337
- |------|------|---------|
338
- | 🎯 | `session-request` | 本次会话的原始任务/目标 |
339
- | 🔴 | `gotcha` | 关键陷阱 — "永远不要做 X,因为 Y" |
340
- | 🟡 | `problem-solution` | bug 修复,含根因和解决方案 |
341
- | 🔵 | `how-it-works` | 系统的技术解释 |
342
- | 🟢 | `what-changed` | 代码/配置变更记录 |
343
- | 🟣 | `discovery` | 新的洞见或发现 |
344
- | 🟠 | `why-it-exists` | 设计选择背后的原因 |
345
- | 🟤 | `decision` | 架构/设计决策 |
346
- | ⚖️ | `trade-off` | 取舍权衡,含利弊分析 |
347
-
348
- ### 可视化 Dashboard
349
-
350
- 运行 `memorix_dashboard` 在 `http://localhost:3210` 打开 Web UI:
284
+ ### 9 种观察类型
351
285
 
352
- - **交互式知识图谱** D3.js 力导向图,可视化实体和关系
353
- - **观察浏览器** — 按类型筛选,高亮搜索,展开/折叠详情
354
- - **记忆衰减面板** — 查看哪些记忆活跃、过期或待归档
355
- - **项目切换器** — 无需切换 IDE 即可查看任何项目的数据
356
- - **批量清理** — 自动检测并批量删除低质量观察
357
- - **明暗主题** — 玻璃拟态设计,中英双语界面
286
+ 每条记忆都有分类标签:🎯 session-request · 🔴 gotcha · 🟡 problem-solution · 🔵 how-it-works · 🟢 what-changed · 🟣 discovery · 🟠 why-it-exists · 🟤 decision · ⚖️ trade-off
358
287
 
359
288
  ### 自动记忆 Hook
360
289
 
361
- Memorix 可以**自动捕获**编码会话中的决策、错误和踩坑经验:
362
-
363
290
  ```bash
364
291
  memorix hooks install # 一条命令安装
365
292
  ```
366
293
 
367
- - **隐式记忆** — 检测 "I decided to..."、"bug 是因为..."、"永远不要用 X" 等模式
368
- - **会话启动注入** — 自动将近期高价值记忆加载到 Agent 上下文
369
- - **多语言** — 支持英文 + 中文关键词匹配
370
- - **智能过滤** — 30 秒冷却,跳过无关命令(ls、cat、pwd)
294
+ 自动捕获编码会话中的决策、错误和踩坑经验。支持中英文模式检测,会话启动时自动注入高价值记忆,智能过滤(30 秒冷却,跳过无关命令)。
371
295
 
372
296
  ---
373
297
 
@@ -375,7 +299,7 @@ memorix hooks install # 一条命令安装
375
299
 
376
300
  | | [Mem0](https://github.com/mem0ai/mem0) | [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service) | [claude-mem](https://github.com/anthropics/claude-code) | **Memorix** |
377
301
  |---|---|---|---|---|
378
- | **支持的 Agent** | SDK 集成 | 13+(MCP) | 仅 Claude Code | **7IDE(MCP)** |
302
+ | **支持的 Agent** | SDK 集成 | 13+(MCP) | 仅 Claude Code | **8Agent(MCP)** |
379
303
  | **跨 Agent 同步** | 否 | 否 | 否 | **是(配置、规则、技能、工作流)** |
380
304
  | **规则同步** | 否 | 否 | 否 | **是(7 种格式)** |
381
305
  | **技能引擎** | 否 | 否 | 否 | **是(从记忆自动生成)** |
@@ -387,7 +311,7 @@ memorix hooks install # 一条命令安装
387
311
  | **可视化面板** | 云端 UI | 是 | 否 | **是(Web UI + D3.js 图谱)** |
388
312
  | **隐私** | 云端 | 本地 | 本地 | **100% 本地** |
389
313
  | **费用** | 按量付费 | $0 | $0 | **$0** |
390
- | **安装** | `pip install` | `pip install` | 内置于 Claude | **`npx memorix serve`** |
314
+ | **安装** | `pip install` | `pip install` | 内置于 Claude | **`npm i -g memorix`** |
391
315
 
392
316
  **Memorix 是唯一同时桥接记忆和工作区跨 Agent 共享的工具。**
393
317
 
@@ -413,9 +337,9 @@ npm install -g @huggingface/transformers
413
337
 
414
338
  - **自动检测** — 通过 `git remote` URL 识别项目,零配置
415
339
  - **MCP roots 回退** — 如果 `cwd` 不是项目目录(如 Antigravity),Memorix 会尝试 [MCP roots 协议](https://modelcontextprotocol.io/docs/concepts/roots) 从 IDE 获取工作区路径
416
- - **按项目存储** — `~/.memorix/data/<owner--repo>/` 每个项目独立
340
+ - **统一存储,元数据隔离**所有数据存储在 `~/.memorix/data/`,每条观察记录内嵌 `projectId`。这样即使不同 IDE 对同一仓库检测出不同的项目 ID,跨 IDE 共享也能正常工作
417
341
  - **作用域搜索** — 默认搜索当前项目;`scope: "global"` 搜索所有项目
418
- - **零交叉污染** — 项目 A 的决策永远不会泄漏到项目 B
342
+ - **零交叉污染** — 搜索结果按项目 ID 过滤,项目 A 的决策不会出现在项目 B 的搜索结果中
419
343
 
420
344
  **检测优先级:** `--cwd` → `MEMORIX_PROJECT_ROOT` → `INIT_CWD` → `process.cwd()` → MCP roots → 报错
421
345
 
@@ -436,7 +360,7 @@ npm install -g @huggingface/transformers
436
360
  Memorix 工作区同步可以迁移 MCP 配置、Agent 规则(`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`)、技能和工作流。一条命令,几秒完成。
437
361
 
438
362
  **有没有用于持久 AI 编码记忆的 MCP 服务器?**
439
- 有 — Memorix 是一个跨 Agent 记忆 MCP 服务器,支持 7IDE,提供知识图谱、3 层渐进式搜索、工作区同步和自动生成项目技能。
363
+ 有 — Memorix 是一个跨 Agent 记忆 MCP 服务器,支持 8Agent,提供知识图谱、3 层渐进式搜索、工作区同步和自动生成项目技能。
440
364
 
441
365
  **和 mcp-memory-service 有什么区别?**
442
366
  两个都是优秀的记忆服务器。Memorix 额外提供:跨 Agent 工作区同步(MCP 配置、规则、技能)、从记忆模式自动生成项目技能、3 层 token 高效搜索、会话启动记忆注入 Hook。
@@ -456,7 +380,7 @@ cd memorix
456
380
  npm install
457
381
 
458
382
  npm run dev # tsup 监听模式
459
- npm test # vitest(422 个测试)
383
+ npm test # vitest(509 个测试)
460
384
  npm run lint # TypeScript 类型检查
461
385
  npm run build # 生产构建
462
386
  ```