memorix 1.0.4 → 1.0.6

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/CLAUDE.md CHANGED
@@ -1,56 +1,106 @@
1
- # Memorix Agent Instructions for Claude Code
2
-
3
- You have access to Memorix, a cross-agent memory system. Use it to persist and recall project knowledge across sessions.
4
-
5
- ## When to SEARCH memory (memorix_search)
6
-
7
- - **Session start**: Always search for recent context at the beginning of a conversation
8
- - **Before making decisions**: Search for past decisions on the same topic
9
- - **When the user asks "remember"/"what did we"/"last time"**: Search for relevant history
10
- - **Before implementing features**: Check if similar work was done before
11
- - **When encountering errors**: Search for known gotchas and past solutions
12
-
13
- ## When to STORE memory (memorix_store)
14
-
15
- - **Architecture decisions**: Why you chose X over Y (type: `decision`)
16
- - **Bug fixes**: Root cause and solution (type: `problem-solution`)
17
- - **Gotchas/pitfalls**: Things that tripped you up (type: `gotcha`)
18
- - **How things work**: Non-obvious system behavior (type: `how-it-works`)
19
- - **Changes made**: Significant code changes (type: `what-changed`)
20
- - **Trade-offs**: Compromises and their reasoning (type: `trade-off`)
21
- - **Session goals**: What the user asked for at session start (type: `session-request`)
22
-
23
- ## When to check RETENTION (memorix_retention)
24
-
25
- - Periodically check which memories are stale or candidates for archiving
26
- - Review top-relevant memories to avoid duplicating past work
27
-
28
- ## Best Practices
29
-
30
- 1. **Be specific in titles**: "Fixed Docker timeout from 30s to 60s" not "Fixed bug"
31
- 2. **Include facts**: Structured data like "Default port: 3001", "Retry count: 3"
32
- 3. **Tag files**: Always include filesModified when you edit files
33
- 4. **Use concepts**: Add searchable keywords for future retrieval
34
- 5. **Don't over-store**: Only store knowledge that would be useful in a future session
35
- 6. **Entity naming**: Use kebab-case descriptive names like "auth-module", "docker-config"
36
-
37
- ## Tool Quick Reference
38
-
39
- | Tool | When | Example |
40
- |------|------|---------|
41
- | `memorix_search` | Find past knowledge | `query: "authentication"` |
42
- | `memorix_store` | Save new knowledge | `type: "decision", title: "Use JWT for auth"` |
43
- | `memorix_detail` | Get full observation | `ids: [42, 43]` |
44
- | `memorix_timeline` | See what happened around an event | `anchorId: 42` |
45
- | `memorix_resolve` | Mark task done / bug fixed | `ids: [42]` |
46
- | `memorix_session_start` | Load context at session start | (no params needed) |
47
- | `memorix_session_end` | Save session summary | `summary: "## Goal\n..."` |
48
- | `memorix_promote` | Make observation permanent | `action: "promote", observationIds: [42]` |
49
- | `memorix_retention` | Check memory health | `action: "report"` |
50
- | `memorix_transfer` | Export/import memories | `action: "export"` |
51
- | `memorix_rules_sync` | Sync agent rules | `action: "status"` |
52
- | `memorix_workspace_sync` | Migrate workspace configs | `action: "scan"` |
53
- | `team_manage` | Register agent | `action: "join", name: "claude-backend"` |
54
- | `team_file_lock` | Lock file before editing | `action: "lock", file: "src/auth.ts"` |
55
- | `team_task` | Create/claim tasks | `action: "create", description: "Fix auth bug"` |
56
- | `team_message` | Send message to other agent | `action: "send", to: "agent-id"` |
1
+ # Memorix - Agent Instructions for Claude Code
2
+
3
+ You have access to Memorix, an open-source cross-agent memory layer for coding agents via MCP. Use it to persist and recall project knowledge across sessions, preserve reasoning, and retrieve Git-backed engineering truth when relevant.
4
+
5
+ ## Rule 1: Bind the project, then start with context
6
+
7
+ At the beginning of every conversation:
8
+
9
+ 1. Call `memorix_session_start` to load the previous session summary and recent high-value context.
10
+ 2. If you are connected to the HTTP control-plane mode (normally started with `memorix background start`; `memorix serve-http` is the foreground variant) and you know the current workspace path, pass:
11
+ - `agent`
12
+ - `projectRoot` = the absolute path of the current workspace or repo root
13
+ 3. If you are using stdio / Quick Mode and Memorix is already project-bound, calling `memorix_session_start` without `projectRoot` is acceptable.
14
+ 4. If session start fails because the project could not be resolved, retry with the correct absolute workspace path instead of continuing with project-scoped memory calls.
15
+ 5. Then call `memorix_search` with a query related to the user's first message or the current project.
16
+ 6. If results matter, use `memorix_detail` to inspect the most relevant memories.
17
+ 7. If the user is asking about "what changed", prioritize Git-backed memories when relevant.
18
+
19
+ Important:
20
+
21
+ - `projectRoot` is a detection anchor only; Git remains the source of truth for project identity.
22
+ - In HTTP control-plane mode, explicit `projectRoot` binding is the safest way to avoid cross-project drift.
23
+
24
+ ## Rule 2: Store meaningful knowledge, not noise
25
+
26
+ Use `memorix_store` when you learn something a future agent should not have to rediscover.
27
+
28
+ Store:
29
+
30
+ - architecture or design decisions -> `decision`
31
+ - bug root cause + fix -> `problem-solution`
32
+ - non-obvious pitfalls -> `gotcha`
33
+ - implementation explanations -> `how-it-works`
34
+ - significant code or config changes -> `what-changed`
35
+ - trade-offs and rationale -> `trade-off`
36
+ - session handoff summaries -> `session-request`
37
+
38
+ Do not store:
39
+
40
+ - greetings
41
+ - simple file reads
42
+ - trivial shell commands
43
+ - redundant status chatter
44
+
45
+ ## Rule 3: Preserve reasoning
46
+
47
+ When the important value is **why**, use `memorix_store_reasoning`:
48
+
49
+ - alternatives considered
50
+ - rationale
51
+ - constraints
52
+ - expected outcome
53
+ - risks
54
+
55
+ Reasoning memories are especially useful for future "why did we choose this?" questions.
56
+
57
+ ## Rule 4: Resolve completed work
58
+
59
+ When a task is done or a bug is fixed, call `memorix_resolve`.
60
+
61
+ This keeps default search focused on active memory instead of resurfacing already-finished work forever.
62
+
63
+ ## Rule 5: Respect project boundaries
64
+
65
+ - Default search is current-project scoped.
66
+ - Use global search only when the task is explicitly cross-project.
67
+ - If a global result comes from another project, open it with project-aware refs when needed.
68
+
69
+ ## Rule 6: Favor structured, reusable memory
70
+
71
+ Best practices:
72
+
73
+ 1. Use specific titles.
74
+ 2. Include structured facts.
75
+ 3. Include `filesModified` when you touched code.
76
+ 4. Include concepts for searchability.
77
+ 5. Prefer concise reusable summaries over raw transcripts.
78
+ 6. Store milestones such as releases, published versions, and important merges.
79
+
80
+ ## Tool Guide
81
+
82
+ ### Core retrieval
83
+
84
+ - `memorix_session_start` - load session context; in HTTP mode, prefer passing `projectRoot`
85
+ - `memorix_search` - search current or global memory
86
+ - `memorix_detail` - read full memory details
87
+ - `memorix_timeline` - inspect chronological context
88
+
89
+ ### Core storage
90
+
91
+ - `memorix_store` - store reusable project knowledge
92
+ - `memorix_store_reasoning` - store design reasoning and trade-offs
93
+ - `memorix_resolve` - mark completed memories resolved
94
+
95
+ ### Quality and operations
96
+
97
+ - `memorix_retention` - inspect decay/archive state
98
+ - `memorix_promote` - turn important observations into mini-skills
99
+ - `memorix_skills` - generate or inspect project skills
100
+ - `memorix_transfer` - export/import project memory
101
+
102
+ ### Collaboration and platform
103
+
104
+ - `memorix_rules_sync` - inspect or sync rules across agents
105
+ - `memorix_workspace_sync` - inspect or migrate workspace integrations
106
+ - `team_manage`, `team_file_lock`, `team_task`, `team_message` - HTTP collaboration layer
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
  <h1 align="center">Memorix</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>Local-first memory platform for AI coding agents.</strong><br>
9
- Git truth, reasoning memory, and cross-agent recall in one MCP server.
8
+ <strong>Open-source cross-agent memory layer for coding agents.</strong><br>
9
+ Compatible with Cursor, Claude Code, Codex, Windsurf, Gemini CLI, GitHub Copilot, Kiro, OpenCode, Antigravity, and Trae through MCP.
10
10
  </p>
11
11
 
12
12
  <p align="center">
@@ -18,30 +18,63 @@
18
18
  </p>
19
19
 
20
20
  <p align="center">
21
- <strong>Git Memory</strong> · <strong>Reasoning Memory</strong> · <strong>Cross-Agent Recall</strong> · <strong>Control Plane Dashboard</strong>
21
+ <strong>Git Memory</strong> | <strong>Reasoning Memory</strong> | <strong>Cross-Agent Recall</strong> | <strong>Control Plane Dashboard</strong>
22
22
  </p>
23
23
 
24
24
  <p align="center">
25
- <a href="README.zh-CN.md">中文文档</a> ·
26
- <a href="#quick-start">Quick Start</a> ·
27
- <a href="#how-it-works">How It Works</a> ·
28
- <a href="#documentation">Documentation</a> ·
25
+ <a href="README.zh-CN.md">简体中文</a> |
26
+ <a href="#quick-start">Quick Start</a> |
27
+ <a href="#supported-clients">Supported Clients</a> |
28
+ <a href="#core-workflows">Core Workflows</a> |
29
+ <a href="#documentation">Documentation</a> |
29
30
  <a href="docs/SETUP.md">Setup Guide</a>
30
31
  </p>
31
32
 
32
33
  ---
33
34
 
35
+ ## For Coding Agents
36
+
37
+ If you are using an AI coding agent to install or operate Memorix, have it read the [Agent Operator Playbook](docs/AGENT_OPERATOR_PLAYBOOK.md) first.
38
+
39
+ That playbook is the canonical AI-facing guide for:
40
+
41
+ - installation and runtime-mode selection
42
+ - Git/project binding rules
43
+ - stdio vs HTTP control-plane setup
44
+ - per-agent integration and hooks
45
+ - generated dot-directory behavior
46
+ - troubleshooting and safe operating rules
47
+
34
48
  ## Why Memorix
35
49
 
36
- Most AI coding agents remember only the current thread. Memorix gives them a shared, persistent memory layer across IDEs, sessions, and projects.
50
+ Most coding agents remember only the current thread. Memorix gives them a shared, persistent memory layer across IDEs, sessions, and projects.
37
51
 
38
52
  What makes Memorix different:
39
53
 
40
54
  - **Git Memory**: turn `git commit` into searchable engineering memory with noise filtering and commit provenance.
41
55
  - **Reasoning Memory**: store why a decision was made, not just what changed.
42
- - **Cross-Agent Local Recall**: Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, OpenCode, Gemini CLI, and more can read the same local memory base.
56
+ - **Cross-Agent Local Recall**: multiple IDEs and agents can read the same local memory base instead of living in isolated silos.
43
57
  - **Memory Quality Pipeline**: formation, compaction, retention, and source-aware retrieval work together instead of acting like isolated tools.
44
58
 
59
+ Memorix is built for one job: let multiple coding agents share the same durable project memory through MCP without giving up Git truth, reasoning history, or local control.
60
+
61
+ ## Supported Clients
62
+
63
+ Memorix currently ships first-class integrations for:
64
+
65
+ - Cursor
66
+ - Claude Code
67
+ - Codex
68
+ - Windsurf
69
+ - Gemini CLI
70
+ - GitHub Copilot
71
+ - Kiro
72
+ - OpenCode
73
+ - Antigravity
74
+ - Trae
75
+
76
+ If a client can speak MCP and launch a local command or HTTP endpoint, it can usually connect to Memorix even if it is not in the list above yet.
77
+
45
78
  ---
46
79
 
47
80
  ## Quick Start
@@ -52,35 +85,92 @@ Install globally:
52
85
  npm install -g memorix
53
86
  ```
54
87
 
55
- Initialize project config:
88
+ Initialize Memorix config:
56
89
 
57
90
  ```bash
58
91
  memorix init
59
92
  ```
60
93
 
94
+ `memorix init` lets you choose between `Global defaults` and `Project config`.
95
+
61
96
  Memorix uses two files with two roles:
62
97
 
63
98
  - `memorix.yml` for behavior and project settings
64
99
  - `.env` for secrets such as API keys
65
100
 
66
- Choose one runtime mode:
101
+ Then pick the path that matches what you want to do:
102
+
103
+ | You want | Run | Best for |
104
+ | --- | --- | --- |
105
+ | Quick MCP setup inside one IDE | `memorix serve` | Cursor, Claude Code, Codex, Windsurf, Gemini CLI, and other stdio MCP clients |
106
+ | Dashboard + long-lived HTTP MCP in the background | `memorix background start` | Daily use, multiple agents, collaboration, dashboard |
107
+ | Foreground HTTP mode for debugging or a custom port | `memorix serve-http --port 3211` | Manual supervision, debugging, custom launch control |
108
+
109
+ Most users should choose **one** of the first two options:
110
+
111
+ - `memorix serve` if you just want Memorix available inside your IDE as fast as possible
112
+ - `memorix background start` if you want the dashboard and a shared HTTP control plane running in the background
113
+
114
+ Optional local UI:
67
115
 
68
116
  ```bash
69
- memorix serve
117
+ memorix
70
118
  ```
71
119
 
72
- Use `serve` for normal stdio MCP integrations.
120
+ Use bare `memorix` only when you want the interactive local workbench in a TTY. It is not the main setup path for most users.
121
+
122
+ Companion commands:
123
+
124
+ ```bash
125
+ memorix background status
126
+ memorix background logs
127
+ memorix background stop
128
+ ```
129
+
130
+ If you need the HTTP control plane in the foreground for debugging, manual supervision, or a custom port, use:
73
131
 
74
132
  ```bash
75
133
  memorix serve-http --port 3211
76
134
  ```
77
135
 
78
- Use `serve-http` when you want the HTTP transport, collaboration features, and the dashboard on the same port.
136
+ If you are using the HTTP control plane across multiple workspaces or agents, make sure each session binds with `memorix_session_start(projectRoot=...)`.
137
+
138
+ The deeper details around startup root selection, project binding, config precedence, and agent/operator workflows live in [docs/SETUP.md](docs/SETUP.md) and the [Agent Operator Playbook](docs/AGENT_OPERATOR_PLAYBOOK.md).
79
139
 
80
140
  Add Memorix to your MCP client:
81
141
 
142
+ ### Generic stdio MCP config
143
+
144
+ ```json
145
+ {
146
+ "mcpServers": {
147
+ "memorix": {
148
+ "command": "memorix",
149
+ "args": ["serve"]
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ ### Generic HTTP MCP config
156
+
157
+ ```json
158
+ {
159
+ "mcpServers": {
160
+ "memorix": {
161
+ "transport": "http",
162
+ "url": "http://localhost:3211/mcp"
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ If you use the HTTP control plane across multiple workspaces or agents, the client or agent should also call `memorix_session_start(projectRoot=ABSOLUTE_WORKSPACE_PATH)` at the beginning of each project session.
169
+
170
+ The per-client examples below show the simplest stdio shape. If you prefer the shared HTTP control plane, keep the generic HTTP block above and use the client-specific variants in [docs/SETUP.md](docs/SETUP.md).
171
+
82
172
  <details open>
83
- <summary><strong>Cursor</strong> · <code>.cursor/mcp.json</code></summary>
173
+ <summary><strong>Cursor</strong> | <code>.cursor/mcp.json</code></summary>
84
174
 
85
175
  ```json
86
176
  {
@@ -103,7 +193,7 @@ claude mcp add memorix -- memorix serve
103
193
  </details>
104
194
 
105
195
  <details>
106
- <summary><strong>Codex</strong> · <code>~/.codex/config.toml</code></summary>
196
+ <summary><strong>Codex</strong> | <code>~/.codex/config.toml</code></summary>
107
197
 
108
198
  ```toml
109
199
  [mcp_servers.memorix]
@@ -150,7 +240,7 @@ Git memories are stored with `source='git'`, commit hashes, changed files, and n
150
240
  ### 3. Run the control plane
151
241
 
152
242
  ```bash
153
- memorix serve-http --port 3211
243
+ memorix background start
154
244
  ```
155
245
 
156
246
  Then open:
@@ -158,20 +248,96 @@ Then open:
158
248
  - MCP HTTP endpoint: `http://localhost:3211/mcp`
159
249
  - Dashboard: `http://localhost:3211`
160
250
 
161
- This mode gives you collaboration tools, project identity diagnostics, config provenance, Git Memory views, and the dashboard in one place.
251
+ Companion commands:
252
+
253
+ ```bash
254
+ memorix background status
255
+ memorix background logs
256
+ memorix background stop
257
+ ```
258
+
259
+ Use `background start` as the default long-lived HTTP mode. If you need to keep the control plane in the foreground for debugging or manual supervision, use:
260
+
261
+ ```bash
262
+ memorix serve-http --port 3211
263
+ ```
264
+
265
+ This HTTP mode gives you collaboration tools, project identity diagnostics, config provenance, Git Memory views, and the dashboard in one place.
266
+
267
+ When multiple HTTP sessions are open at once, each session should bind itself with `memorix_session_start(projectRoot=...)` before using project-scoped memory tools.
162
268
 
163
269
  ---
164
270
 
165
271
  ## How It Works
166
272
 
167
273
  ```mermaid
168
- graph TB
169
- A["git commit / agent tool call / manual store"] --> B["Memorix Runtime"]
170
- B --> C["Observation / Reasoning / Git Memory"]
171
- C --> D["Formation + Indexing + Graph + Retention"]
172
- D --> E["Search / Detail / Timeline / Dashboard / Team"]
274
+ flowchart LR
275
+ subgraph Ingress["Ingress Surfaces"]
276
+ A1["Git hooks / ingest"]
277
+ A2["MCP tools"]
278
+ A3["CLI / TUI"]
279
+ A4["HTTP dashboard"]
280
+ end
281
+
282
+ subgraph Runtime["Memorix Runtime"]
283
+ B1["stdio MCP server"]
284
+ B2["HTTP control plane"]
285
+ B3["project binding + config"]
286
+ end
287
+
288
+ subgraph Memory["Memory Substrates"]
289
+ C1["Observation memory"]
290
+ C2["Reasoning memory"]
291
+ C3["Git memory"]
292
+ C4["Session + team state"]
293
+ end
294
+
295
+ subgraph Processing["Async Processing"]
296
+ D1["Formation pipeline"]
297
+ D2["Embedding + indexing"]
298
+ D3["Graph linking"]
299
+ D4["Dedup + retention"]
300
+ end
301
+
302
+ subgraph Consumption["Consumption Surfaces"]
303
+ E1["Search / detail / timeline"]
304
+ E2["Dashboard / team views"]
305
+ E3["Agent recall / handoff"]
306
+ end
307
+
308
+ A1 --> B1
309
+ A2 --> B1
310
+ A2 --> B2
311
+ A3 --> B1
312
+ A3 --> B2
313
+ A4 --> B2
314
+
315
+ B1 --> B3
316
+ B2 --> B3
317
+
318
+ B3 --> C1
319
+ B3 --> C2
320
+ B3 --> C3
321
+ B3 --> C4
322
+
323
+ C1 --> D1
324
+ C1 --> D2
325
+ C1 --> D3
326
+ C1 --> D4
327
+ C2 --> D1
328
+ C2 --> D3
329
+ C3 --> D2
330
+ C4 --> D3
331
+
332
+ D1 --> E1
333
+ D2 --> E1
334
+ D3 --> E2
335
+ D4 --> E3
336
+ C4 --> E3
173
337
  ```
174
338
 
339
+ Memorix is not a single linear pipeline. It accepts memory from multiple ingress surfaces, persists it across multiple substrates, runs several asynchronous quality/indexing branches, and exposes the results through different retrieval and collaboration surfaces.
340
+
175
341
  ### Memory Layers
176
342
 
177
343
  - **Observation Memory**: what changed, how something works, gotchas, problem-solution notes
@@ -183,7 +349,7 @@ graph TB
183
349
  - Default search is **project-scoped**
184
350
  - `scope="global"` searches across projects
185
351
  - Global hits can be opened explicitly with project-aware refs
186
- - Source-aware retrieval boosts Git memories for what changed questions and reasoning memories for why questions
352
+ - Source-aware retrieval boosts Git memories for "what changed" questions and reasoning memories for "why" questions
187
353
 
188
354
  ---
189
355
 
@@ -213,6 +379,8 @@ graph TB
213
379
 
214
380
  ### AI-Facing Project Docs
215
381
 
382
+ - [Agent Operator Playbook](docs/AGENT_OPERATOR_PLAYBOOK.md)
383
+ - [AI Context Note](docs/AI_CONTEXT.md)
216
384
  - [`llms.txt`](llms.txt)
217
385
  - [`llms-full.txt`](llms-full.txt)
218
386
 
@@ -235,6 +403,7 @@ Key local commands:
235
403
  ```bash
236
404
  memorix status
237
405
  memorix dashboard
406
+ memorix background start
238
407
  memorix serve-http --port 3211
239
408
  memorix git-hook --force
240
409
  ```