memorix 0.9.18 → 0.9.20

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
 
@@ -67,7 +67,7 @@ Run in terminal:
67
67
  ```bash
68
68
  claude mcp add memorix -- memorix serve
69
69
  ```
70
- Or manually add to `~/.claude.json`:
70
+ Or manually add to `~/.claude.json` (global) or `.claude/settings.json` (project):
71
71
  ```json
72
72
  {
73
73
  "mcpServers": {
@@ -78,6 +78,7 @@ Or manually add to `~/.claude.json`:
78
78
  }
79
79
  }
80
80
  ```
81
+ > **Windows:** `~/.claude.json` is at `C:\Users\<YourUsername>\.claude.json`
81
82
  </details>
82
83
 
83
84
  <details>
@@ -113,12 +114,12 @@ Add to Windsurf MCP settings (`~/.codeium/windsurf/mcp_config.json`):
113
114
  </details>
114
115
 
115
116
  <details>
116
- <summary><strong>VS Code Copilot / Codex / Kiro</strong></summary>
117
+ <summary><strong>VS Code Copilot</strong></summary>
117
118
 
118
- Same format — add to the agent's MCP config file:
119
+ Add to `.vscode/mcp.json` in your project:
119
120
  ```json
120
121
  {
121
- "mcpServers": {
122
+ "servers": {
122
123
  "memorix": {
123
124
  "command": "memorix",
124
125
  "args": ["serve"]
@@ -129,9 +130,20 @@ Same format — add to the agent's MCP config file:
129
130
  </details>
130
131
 
131
132
  <details>
132
- <summary><strong>Antigravity / Gemini CLI</strong></summary>
133
+ <summary><strong>Codex</strong></summary>
133
134
 
134
- Add to `.gemini/settings.json` (project) or `~/.gemini/settings.json` (global):
135
+ Add to `~/.codex/config.toml`:
136
+ ```toml
137
+ [mcp_servers.memorix]
138
+ command = "memorix"
139
+ args = ["serve"]
140
+ ```
141
+ </details>
142
+
143
+ <details>
144
+ <summary><strong>Kiro</strong></summary>
145
+
146
+ Add to `.kiro/settings/mcp.json` (project) or `~/.kiro/settings/mcp.json` (global):
135
147
  ```json
136
148
  {
137
149
  "mcpServers": {
@@ -142,8 +154,12 @@ Add to `.gemini/settings.json` (project) or `~/.gemini/settings.json` (global):
142
154
  }
143
155
  }
144
156
  ```
157
+ </details>
158
+
159
+ <details>
160
+ <summary><strong>Antigravity</strong></summary>
145
161
 
146
- **Antigravity IDE only:** Antigravity uses its own install path as CWD. You **must** add:
162
+ Add to `~/.gemini/antigravity/mcp_config.json`. Antigravity requires `MEMORIX_PROJECT_ROOT`:
147
163
  ```json
148
164
  {
149
165
  "mcpServers": {
@@ -157,8 +173,22 @@ Add to `.gemini/settings.json` (project) or `~/.gemini/settings.json` (global):
157
173
  }
158
174
  }
159
175
  ```
176
+ </details>
160
177
 
161
- **Gemini CLI** reads MCP config from the same path. Hooks are automatically installed to `.gemini/settings.json`.
178
+ <details>
179
+ <summary><strong>Gemini CLI</strong></summary>
180
+
181
+ Add to `.gemini/settings.json` (project) or `~/.gemini/settings.json` (global):
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "memorix": {
186
+ "command": "memorix",
187
+ "args": ["serve"]
188
+ }
189
+ }
190
+ }
191
+ ```
162
192
  </details>
163
193
 
164
194
  ### Step 3: Restart your agent — done!
@@ -167,17 +197,39 @@ No API keys. No cloud accounts. No dependencies. Works with any directory (git r
167
197
 
168
198
  > 📖 **Full setup guide for all 8 agents** → [docs/SETUP.md](docs/SETUP.md)
169
199
 
170
- <details>
171
- <summary><strong>🔧 Troubleshooting</strong></summary>
200
+ ### 🔧 Troubleshooting — MCP Connection Issues
172
201
 
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` |
202
+ > **⚠️ #1 Mistake: Do NOT manually run `memorix serve` in a terminal.**
203
+ > 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
204
 
180
- </details>
205
+ **Quick diagnostic** — run this first:
206
+ ```bash
207
+ memorix --version # Should print version number
208
+ memorix serve --cwd . # Should show "[memorix] MCP Server running on stdio"
209
+ ```
210
+ If either fails, follow the table below:
211
+
212
+ | Symptom | Cause | Fix |
213
+ |---------|-------|-----|
214
+ | `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 |
215
+ | `MCP server initialization timed out` | Using `npx` (downloads every time) | Switch to global install: `npm install -g memorix`, change config to `"command": "memorix"` |
216
+ | 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 |
217
+ | `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 |
218
+ | `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 |
219
+ | 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 |
220
+ | Parameter type errors | Old version or non-Anthropic model quirks | Update: `npm install -g memorix@latest` |
221
+
222
+ **Correct config:**
223
+ ```json
224
+ "command": "memorix", "args": ["serve"]
225
+ ```
226
+
227
+ **❌ Wrong:**
228
+ ```
229
+ "command": "npx" ← will timeout
230
+ "command": "npx -y memorix serve" ← wrong format
231
+ "command": "node memorix serve" ← not how it works
232
+ ```
181
233
 
182
234
  ---
183
235
 
@@ -236,138 +288,33 @@ Now you want to try Kiro.
236
288
  → Kiro is ready in seconds, not hours!
237
289
  ```
238
290
 
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
291
  ---
289
292
 
290
293
  ## 🧠 What Memorix Can Do
291
294
 
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.
295
+ ### 25 MCP Tools
331
296
 
332
- ### 9 Observation Types
333
-
334
- Every memory is classified for intelligent retrieval:
335
-
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 |
297
+ | Category | Tools | What They Do |
298
+ |----------|-------|-------------|
299
+ | **Store & Classify** | `memorix_store`, `memorix_suggest_topic_key` | Store memories with 9 types (🔴gotcha 🟤decision 🟡fix ...), dedup via topic keys |
300
+ | **Search & Retrieve** | `memorix_search`, `memorix_detail`, `memorix_timeline` | 3-layer progressive disclosure (~10x token savings), temporal queries, chronological context |
301
+ | **Sessions** | `memorix_session_start/end/context` | Auto-inject previous session context, save structured summaries |
302
+ | **Maintenance** | `memorix_retention`, `memorix_consolidate`, `memorix_export/import` | Decay scoring, merge duplicates, backup & share |
303
+ | **Dashboard** | `memorix_dashboard` | Interactive web UI D3.js knowledge graph, observation browser, retention panel |
304
+ | **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 |
305
+ | **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 |
347
306
 
348
- ### Visual Dashboard
349
-
350
- Run `memorix_dashboard` to open a web UI at `http://localhost:3210`:
307
+ ### 9 Observation Types
351
308
 
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/中文)
309
+ Every memory is classified: 🎯 session-request · 🔴 gotcha · 🟡 problem-solution · 🔵 how-it-works · 🟢 what-changed · 🟣 discovery · 🟠 why-it-exists · 🟤 decision · ⚖️ trade-off
358
310
 
359
311
  ### Auto-Memory Hooks
360
312
 
361
- Memorix can **automatically capture** decisions, errors, and gotchas from your coding sessions:
362
-
363
313
  ```bash
364
314
  memorix hooks install # One-command setup
365
315
  ```
366
316
 
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)
317
+ 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
318
 
372
319
  ---
373
320
 
@@ -375,7 +322,7 @@ memorix hooks install # One-command setup
375
322
 
376
323
  | | [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
324
  |---|---|---|---|---|
378
- | **Agents supported** | SDK-based | 13+ (MCP) | Claude Code only | **7 IDEs (MCP)** |
325
+ | **Agents supported** | SDK-based | 13+ (MCP) | Claude Code only | **8 agents (MCP)** |
379
326
  | **Cross-agent sync** | No | No | No | **Yes (configs, rules, skills, workflows)** |
380
327
  | **Rules sync** | No | No | No | **Yes (7 formats)** |
381
328
  | **Skills engine** | No | No | No | **Yes (auto-generated from memory)** |
@@ -387,7 +334,7 @@ memorix hooks install # One-command setup
387
334
  | **Visual dashboard** | Cloud UI | Yes | No | **Yes (web UI + D3.js graph)** |
388
335
  | **Privacy** | Cloud | Local | Local | **100% Local** |
389
336
  | **Cost** | Per-call API | $0 | $0 | **$0** |
390
- | **Install** | `pip install` | `pip install` | Built into Claude | **`npx memorix serve`** |
337
+ | **Install** | `pip install` | `pip install` | Built into Claude | **`npm i -g memorix`** |
391
338
 
392
339
  **Memorix is the only tool that bridges memory AND workspace across agents.**
393
340
 
@@ -413,9 +360,9 @@ With vector search, queries like "authentication" also match memories about "log
413
360
 
414
361
  - **Auto-detected** — Project identity from `git remote` URL, zero config needed
415
362
  - **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
363
+ - **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
364
  - **Scoped search** — Defaults to current project; `scope: "global"` to search all
418
- - **Zero cross-contamination** — Project A's decisions never leak into project B
365
+ - **Zero cross-contamination** — Search results are filtered by project ID; project A's decisions never appear in project B's searches
419
366
 
420
367
  **Detection priority:** `--cwd` → `MEMORIX_PROJECT_ROOT` → `INIT_CWD` → `process.cwd()` → MCP roots → error
421
368
 
@@ -436,7 +383,7 @@ Run `memorix_workspace_sync` with action `"migrate"` and your target IDE. It sca
436
383
  Memorix workspace sync migrates MCP configs, agent rules (`.mdc` ↔ `CLAUDE.md` ↔ `.kiro/steering/`), skills, and workflows. One command, seconds to complete.
437
384
 
438
385
  **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.
386
+ 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
387
 
441
388
  **How is this different from mcp-memory-service?**
442
389
  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 +403,7 @@ cd memorix
456
403
  npm install
457
404
 
458
405
  npm run dev # tsup watch mode
459
- npm test # vitest (422 tests)
406
+ npm test # vitest (509 tests)
460
407
  npm run lint # TypeScript type check
461
408
  npm run build # Production build
462
409
  ```