@pcircle/memesh 4.5.0 → 4.6.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.
Files changed (256) hide show
  1. package/.claude-plugin/marketplace.json +5 -3
  2. package/.claude-plugin/plugin.json +6 -4
  3. package/.mcp.json +1 -1
  4. package/AGENTS.md +95 -0
  5. package/README.de.md +130 -39
  6. package/README.md +188 -43
  7. package/README.zh-TW.md +133 -41
  8. package/dashboard/dist/index.html +9 -9
  9. package/dist/cli/view-live.js +3 -3
  10. package/dist/core/analytics.d.ts +3 -3
  11. package/dist/core/analytics.d.ts.map +1 -1
  12. package/dist/core/analytics.js.map +1 -1
  13. package/dist/core/auto-tagger.d.ts.map +1 -1
  14. package/dist/core/auto-tagger.js +4 -9
  15. package/dist/core/auto-tagger.js.map +1 -1
  16. package/dist/core/briefing.d.ts +8 -0
  17. package/dist/core/briefing.d.ts.map +1 -0
  18. package/dist/core/briefing.js +91 -0
  19. package/dist/core/briefing.js.map +1 -0
  20. package/dist/core/capture-flag.d.ts +5 -0
  21. package/dist/core/capture-flag.d.ts.map +1 -0
  22. package/dist/core/capture-flag.js +10 -0
  23. package/dist/core/capture-flag.js.map +1 -0
  24. package/dist/core/config.d.ts +0 -1
  25. package/dist/core/config.d.ts.map +1 -1
  26. package/dist/core/config.js +2 -1
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/conflict-candidates.d.ts +20 -0
  29. package/dist/core/conflict-candidates.d.ts.map +1 -0
  30. package/dist/core/conflict-candidates.js +79 -0
  31. package/dist/core/conflict-candidates.js.map +1 -0
  32. package/dist/core/conflict-judge.d.ts +47 -0
  33. package/dist/core/conflict-judge.d.ts.map +1 -0
  34. package/dist/core/conflict-judge.js +189 -0
  35. package/dist/core/conflict-judge.js.map +1 -0
  36. package/dist/core/demo.d.ts +2 -2
  37. package/dist/core/demo.d.ts.map +1 -1
  38. package/dist/core/demo.js.map +1 -1
  39. package/dist/core/digest-validator.d.ts.map +1 -1
  40. package/dist/core/digest-validator.js +3 -5
  41. package/dist/core/digest-validator.js.map +1 -1
  42. package/dist/core/doctor.d.ts +3 -0
  43. package/dist/core/doctor.d.ts.map +1 -1
  44. package/dist/core/doctor.js +207 -85
  45. package/dist/core/doctor.js.map +1 -1
  46. package/dist/core/dreamer.d.ts +20 -9
  47. package/dist/core/dreamer.d.ts.map +1 -1
  48. package/dist/core/dreamer.js +416 -58
  49. package/dist/core/dreamer.js.map +1 -1
  50. package/dist/core/embedder.d.ts +7 -5
  51. package/dist/core/embedder.d.ts.map +1 -1
  52. package/dist/core/embedder.js +38 -9
  53. package/dist/core/embedder.js.map +1 -1
  54. package/dist/core/extractor.d.ts.map +1 -1
  55. package/dist/core/extractor.js +2 -1
  56. package/dist/core/extractor.js.map +1 -1
  57. package/dist/core/failure-analyzer.d.ts.map +1 -1
  58. package/dist/core/failure-analyzer.js +7 -12
  59. package/dist/core/failure-analyzer.js.map +1 -1
  60. package/dist/core/graph.d.ts +4 -4
  61. package/dist/core/graph.d.ts.map +1 -1
  62. package/dist/core/graph.js.map +1 -1
  63. package/dist/core/install-channel.d.ts +1 -1
  64. package/dist/core/install-channel.d.ts.map +1 -1
  65. package/dist/core/install-channel.js +16 -5
  66. package/dist/core/install-channel.js.map +1 -1
  67. package/dist/core/install-hooks.d.ts +6 -0
  68. package/dist/core/install-hooks.d.ts.map +1 -1
  69. package/dist/core/install-hooks.js +0 -0
  70. package/dist/core/install-hooks.js.map +1 -1
  71. package/dist/core/json-utils.d.ts +1 -0
  72. package/dist/core/json-utils.d.ts.map +1 -1
  73. package/dist/core/json-utils.js +19 -10
  74. package/dist/core/json-utils.js.map +1 -1
  75. package/dist/core/kg-backfill.d.ts +3 -4
  76. package/dist/core/kg-backfill.d.ts.map +1 -1
  77. package/dist/core/kg-backfill.js +1 -4
  78. package/dist/core/kg-backfill.js.map +1 -1
  79. package/dist/core/lesson-engine.d.ts +1 -0
  80. package/dist/core/lesson-engine.d.ts.map +1 -1
  81. package/dist/core/lesson-engine.js +1 -0
  82. package/dist/core/lesson-engine.js.map +1 -1
  83. package/dist/core/lifecycle.d.ts +4 -4
  84. package/dist/core/lifecycle.d.ts.map +1 -1
  85. package/dist/core/lifecycle.js +15 -22
  86. package/dist/core/lifecycle.js.map +1 -1
  87. package/dist/core/llm-client.d.ts.map +1 -1
  88. package/dist/core/llm-client.js +3 -6
  89. package/dist/core/llm-client.js.map +1 -1
  90. package/dist/core/llm-telemetry.d.ts +4 -4
  91. package/dist/core/llm-telemetry.d.ts.map +1 -1
  92. package/dist/core/llm-telemetry.js +1 -1
  93. package/dist/core/llm-telemetry.js.map +1 -1
  94. package/dist/core/memory-tool.d.ts.map +1 -1
  95. package/dist/core/memory-tool.js +8 -4
  96. package/dist/core/memory-tool.js.map +1 -1
  97. package/dist/core/operations.d.ts.map +1 -1
  98. package/dist/core/operations.js +41 -17
  99. package/dist/core/operations.js.map +1 -1
  100. package/dist/core/paths.d.ts +3 -0
  101. package/dist/core/paths.d.ts.map +1 -1
  102. package/dist/core/paths.js +67 -1
  103. package/dist/core/paths.js.map +1 -1
  104. package/dist/core/patterns.d.ts +2 -2
  105. package/dist/core/patterns.d.ts.map +1 -1
  106. package/dist/core/patterns.js.map +1 -1
  107. package/dist/core/project-tags.d.ts +3 -3
  108. package/dist/core/project-tags.d.ts.map +1 -1
  109. package/dist/core/project-tags.js.map +1 -1
  110. package/dist/core/projects.d.ts +2 -2
  111. package/dist/core/projects.d.ts.map +1 -1
  112. package/dist/core/projects.js.map +1 -1
  113. package/dist/core/prompt-safety.d.ts +1 -0
  114. package/dist/core/prompt-safety.d.ts.map +1 -1
  115. package/dist/core/prompt-safety.js +7 -0
  116. package/dist/core/prompt-safety.js.map +1 -1
  117. package/dist/core/schema-export.d.ts.map +1 -1
  118. package/dist/core/schema-export.js +27 -30
  119. package/dist/core/schema-export.js.map +1 -1
  120. package/dist/core/serializer.d.ts.map +1 -1
  121. package/dist/core/serializer.js +45 -4
  122. package/dist/core/serializer.js.map +1 -1
  123. package/dist/core/setup.d.ts +29 -0
  124. package/dist/core/setup.d.ts.map +1 -0
  125. package/dist/core/setup.js +127 -0
  126. package/dist/core/setup.js.map +1 -0
  127. package/dist/core/stats.d.ts +2 -2
  128. package/dist/core/stats.d.ts.map +1 -1
  129. package/dist/core/stats.js.map +1 -1
  130. package/dist/core/task-state-store.d.ts +17 -0
  131. package/dist/core/task-state-store.d.ts.map +1 -0
  132. package/dist/core/task-state-store.js +45 -0
  133. package/dist/core/task-state-store.js.map +1 -0
  134. package/dist/core/task-state.d.ts +19 -0
  135. package/dist/core/task-state.d.ts.map +1 -0
  136. package/dist/core/task-state.js +91 -0
  137. package/dist/core/task-state.js.map +1 -0
  138. package/dist/core/time-utils.d.ts +2 -0
  139. package/dist/core/time-utils.d.ts.map +1 -0
  140. package/dist/core/time-utils.js +14 -0
  141. package/dist/core/time-utils.js.map +1 -0
  142. package/dist/core/title.d.ts +5 -0
  143. package/dist/core/title.d.ts.map +1 -0
  144. package/dist/core/title.js +14 -0
  145. package/dist/core/title.js.map +1 -0
  146. package/dist/core/transcript-extractor.d.ts +5 -6
  147. package/dist/core/transcript-extractor.d.ts.map +1 -1
  148. package/dist/core/transcript-extractor.js +4 -24
  149. package/dist/core/transcript-extractor.js.map +1 -1
  150. package/dist/core/transcript-source.d.ts.map +1 -1
  151. package/dist/core/transcript-source.js +2 -3
  152. package/dist/core/transcript-source.js.map +1 -1
  153. package/dist/core/types.d.ts +21 -7
  154. package/dist/core/types.d.ts.map +1 -1
  155. package/dist/core/types.js +2 -0
  156. package/dist/core/types.js.map +1 -1
  157. package/dist/core/work-topology.d.ts +33 -0
  158. package/dist/core/work-topology.d.ts.map +1 -0
  159. package/dist/core/work-topology.js +183 -0
  160. package/dist/core/work-topology.js.map +1 -0
  161. package/dist/db.d.ts +5 -10
  162. package/dist/db.d.ts.map +1 -1
  163. package/dist/db.js +194 -196
  164. package/dist/db.js.map +1 -1
  165. package/dist/knowledge-graph.d.ts +4 -2
  166. package/dist/knowledge-graph.d.ts.map +1 -1
  167. package/dist/knowledge-graph.js +68 -49
  168. package/dist/knowledge-graph.js.map +1 -1
  169. package/dist/mcp/server.js +2 -1
  170. package/dist/mcp/server.js.map +1 -1
  171. package/dist/skills-manifest.json +61 -36
  172. package/dist/storage/conflicts.d.ts +3 -3
  173. package/dist/storage/conflicts.d.ts.map +1 -1
  174. package/dist/storage/conflicts.js +2 -7
  175. package/dist/storage/conflicts.js.map +1 -1
  176. package/dist/storage/fts-index.d.ts +6 -4
  177. package/dist/storage/fts-index.d.ts.map +1 -1
  178. package/dist/storage/fts-index.js +16 -4
  179. package/dist/storage/fts-index.js.map +1 -1
  180. package/dist/storage/schema.d.ts +20 -0
  181. package/dist/storage/schema.d.ts.map +1 -0
  182. package/dist/storage/schema.js +274 -0
  183. package/dist/storage/schema.js.map +1 -0
  184. package/dist/storage/sqlite.d.ts +20 -0
  185. package/dist/storage/sqlite.d.ts.map +1 -0
  186. package/dist/storage/sqlite.js +64 -0
  187. package/dist/storage/sqlite.js.map +1 -0
  188. package/dist/storage/vector-index.d.ts +3 -0
  189. package/dist/storage/vector-index.d.ts.map +1 -0
  190. package/dist/storage/vector-index.js +7 -0
  191. package/dist/storage/vector-index.js.map +1 -0
  192. package/dist/transports/cli/cli.d.ts +1 -4
  193. package/dist/transports/cli/cli.d.ts.map +1 -1
  194. package/dist/transports/cli/cli.js +494 -76
  195. package/dist/transports/cli/cli.js.map +1 -1
  196. package/dist/transports/http/retired-routes.d.ts.map +1 -1
  197. package/dist/transports/http/retired-routes.js +1 -0
  198. package/dist/transports/http/retired-routes.js.map +1 -1
  199. package/dist/transports/http/server.d.ts.map +1 -1
  200. package/dist/transports/http/server.js +243 -323
  201. package/dist/transports/http/server.js.map +1 -1
  202. package/dist/transports/mcp/handlers.d.ts +48 -94
  203. package/dist/transports/mcp/handlers.d.ts.map +1 -1
  204. package/dist/transports/mcp/handlers.js +77 -56
  205. package/dist/transports/mcp/handlers.js.map +1 -1
  206. package/dist/transports/schemas.d.ts +31 -40
  207. package/dist/transports/schemas.d.ts.map +1 -1
  208. package/dist/transports/schemas.js +31 -37
  209. package/dist/transports/schemas.js.map +1 -1
  210. package/hooks/hooks.json +0 -10
  211. package/llms-install.md +138 -0
  212. package/package.json +19 -18
  213. package/scripts/hooks/_generated/capture-flag.js +17 -0
  214. package/scripts/hooks/_generated/core-paths.js +67 -1
  215. package/scripts/hooks/_generated/fts-index.js +16 -4
  216. package/scripts/hooks/_generated/schema.js +281 -0
  217. package/scripts/hooks/_generated/sqlite.js +71 -0
  218. package/scripts/hooks/_generated/task-state.js +98 -0
  219. package/scripts/hooks/_generated/time-utils.js +21 -0
  220. package/scripts/hooks/_generated/title.js +21 -0
  221. package/scripts/hooks/_generated/work-topology.js +190 -0
  222. package/scripts/hooks/_shared.js +269 -534
  223. package/scripts/hooks/post-commit.js +55 -10
  224. package/scripts/hooks/pre-compact.js +22 -7
  225. package/scripts/hooks/pre-edit-recall.js +9 -11
  226. package/scripts/hooks/session-start.js +230 -106
  227. package/scripts/hooks/session-summary.js +176 -73
  228. package/scripts/hooks/user-prompt-intent.js +3 -2
  229. package/skills/memesh/SKILL.md +97 -77
  230. package/README.es.md +0 -470
  231. package/README.fr.md +0 -462
  232. package/README.ja.md +0 -470
  233. package/README.ko.md +0 -470
  234. package/README.pt.md +0 -462
  235. package/README.th.md +0 -463
  236. package/README.vi.md +0 -462
  237. package/README.zh-CN.md +0 -469
  238. package/dist/cli/view.d.ts +0 -3
  239. package/dist/cli/view.d.ts.map +0 -1
  240. package/dist/cli/view.js +0 -523
  241. package/dist/cli/view.js.map +0 -1
  242. package/dist/core/skill-usage-log.d.ts +0 -11
  243. package/dist/core/skill-usage-log.d.ts.map +0 -1
  244. package/dist/core/skill-usage-log.js +0 -125
  245. package/dist/core/skill-usage-log.js.map +0 -1
  246. package/dist/core/verifier.d.ts +0 -40
  247. package/dist/core/verifier.d.ts.map +0 -1
  248. package/dist/core/verifier.js +0 -206
  249. package/dist/core/verifier.js.map +0 -1
  250. package/dist/mcp/launcher.d.ts +0 -3
  251. package/dist/mcp/launcher.d.ts.map +0 -1
  252. package/dist/mcp/launcher.js +0 -37
  253. package/dist/mcp/launcher.js.map +0 -1
  254. package/scripts/hooks/pre-bash-orchestration-nudge.js +0 -155
  255. package/scripts/postinstall-rebuild.mjs +0 -41
  256. package/skills/agentic-orchestration/SKILL.md +0 -399
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- 🌐 [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [Português](README.pt.md) | [Français](README.fr.md) | [Deutsch](README.de.md) | [Tiếng Việt](README.vi.md) | [Español](README.es.md) | [ภาษาไทย](README.th.md)
1
+ 🌐 [English](README.md) | [繁體中文](README.zh-TW.md) | [Deutsch](README.de.md)
2
2
 
3
3
  <p align="center">
4
- <h1 align="center">MeMesh LLM Memory</h1>
4
+ <h1 align="center">MeMesh</h1>
5
5
  <p align="center">
6
- <strong>Local memory for Claude Code and MCP coding agents.</strong><br />
6
+ <strong>Agentic memory for coding agents.</strong><br />
7
7
  One SQLite file. No Docker. No cloud required.
8
8
  </p>
9
9
  <p align="center">
@@ -16,32 +16,40 @@
16
16
 
17
17
  ---
18
18
 
19
- **MeMesh** — the open-source **memory layer** for Claude Code & MCP agents. One SQLite file. No cloud. Plugs into any LLM.
19
+ **MeMesh** — open-source **agentic memory** for Claude Code & MCP coding agents: captured from the agent's real work, injected at the moment it acts, kept honest when it contradicts itself. One SQLite file. No cloud.
20
20
 
21
- ## 95.60% R@5 on LongMemEval-S — beats Mem0 by 46 points
21
+ ## Install
22
22
 
23
- MeMesh's retrieval is **FTS5 alone** no LLM, no embeddings on the hot path. Measured against the public [LongMemEval-S](https://huggingface.co/datasets/xiaowu0162/longmemeval) benchmark (500 questions, MIT-licensed):
23
+ **In Claude Code** — type these in the chat (hooks, memory tools and the `/memesh` skill are wired automatically):
24
24
 
25
- | System | R@5 | Source |
26
- |---|---|---|
27
- | **MeMesh (Mode A, via `recallEnhanced()`)** | **95.60%** | [benchmarks/longmemeval/RESULTS.md](benchmarks/longmemeval/RESULTS.md) |
28
- | MemPalace | 96.6% | Vendor self-report |
29
- | Supermemory | ~82% | Vendor estimate |
30
- | Zep | 63.8% | LongMemEval paper |
31
- | Mem0 | 49.0% | LongMemEval paper |
25
+ ```
26
+ /plugin marketplace add PCIRCLE-AI/memesh
27
+ /plugin install memesh@pcircle-memesh
28
+ ```
32
29
 
33
- Re-runnable in ~10 seconds. Full instructions, dataset SHA256, raw per-question results, and known-failure analysis: [`benchmarks/longmemeval/REPRODUCE.md`](benchmarks/longmemeval/REPRODUCE.md).
30
+ Restart Claude Code. A `◉ MeMesh` status line at the top of your next session means it is capturing.
34
31
 
35
- ---
32
+ **In a terminal** — the `memesh` CLI, the dashboard, and the `memesh-mcp` server for Codex / Gemini / Cursor (needs [Node 22.13+](https://nodejs.org)):
33
+
34
+ ```bash
35
+ npm install -g @pcircle/memesh
36
+ memesh doctor # verifies this install end to end
37
+ ```
38
+
39
+ Most Claude Code users eventually want **both** — they share one database and never conflict. Details, other agents, and upgrades: [Get Started](#get-started-in-60-seconds).
40
+
41
+ > **Installing via an AI agent?** Point it at [llms-install.md](llms-install.md) — deterministic steps with per-step verification. Once installed, [AGENTS.md](AGENTS.md) tells it how to use memesh well.
36
42
 
37
43
  ## The Problem
38
44
 
39
- Your coding agent forgets between sessions. Every architecture decision, bug fix, failed test, and hard-won lesson has to be re-explained. Claude Code starts fresh, re-discovers old constraints, and burns context on things it should already know.
45
+ Your coding agent doesn't just forget facts between sessions it **repeats work**. It re-proposes the approach you rejected last month, trips over the same failing test, re-discovers the constraint that broke production in March, and asks you to re-explain the architecture it helped design.
46
+
47
+ That's not a chat-history problem; it's an agent-memory problem. What needs to survive between sessions is the *work*: decisions with their reasons, failures with their fixes, and the links between them.
40
48
 
41
- **MeMesh gives coding agents persistent, searchable, evolving local memory.** Install with npm, memory lives in `~/.memesh/knowledge-graph.db`, plug into Claude Code or any MCP-compatible client.
49
+ **MeMesh is that memory.** Hooks capture it from what the agent actually does (sessions, commits, failures not manual notes), recall injects it at the moment the agent acts (session start, before file edits), and the knowledge-graph layer keeps it honest over time (supersession, LLM-judged conflict detection). Install with npm, memory lives in `~/.memesh/knowledge-graph.db`, plug into Claude Code or any MCP-compatible client.
42
50
 
43
51
  > [!IMPORTANT]
44
- > Actively developed — features may change between releases. [Open an issue](https://github.com/PCIRCLE-AI/memesh-llm-memory/issues) for bugs or feature requests.
52
+ > Actively developed — features may change between releases. [Open an issue](https://github.com/PCIRCLE-AI/memesh/issues) for bugs or feature requests.
45
53
 
46
54
  ---
47
55
 
@@ -65,7 +73,7 @@ flowchart TB
65
73
  subgraph paths["Two install paths"]
66
74
  direction LR
67
75
  A["<b>Path A — /plugin install</b><br/>───────────────<br/>Lives in <code>~/.claude/plugins/</code><br/><br/>• MCP tools in chat<br/>• Auto-capture hooks<br/>• <code>/memesh</code> skill<br/>• Session-start banner"]:::pathA
68
- B["<b>Path B — npm install -g</b><br/>───────────────<br/>Lives in <code>$(npm prefix -g)/bin/</code><br/><br/>• <code>memesh</code> shell command<br/>• <code>memesh-mcp</code>, <code>-http</code>, <code>-view</code> bins<br/>• For Cursor / Cline / other MCP"]:::pathB
76
+ B["<b>Path B — npm install -g</b><br/>───────────────<br/>Lives in <code>$(npm prefix -g)/bin/</code><br/><br/>• <code>memesh</code> shell command<br/>• <code>memesh-mcp</code>, <code>-http</code> bins<br/>• For Cursor / Cline / other MCP"]:::pathB
69
77
  end
70
78
 
71
79
  DB[("Shared memory DB<br/><code>~/.memesh/knowledge-graph.db</code><br/>Same data, both paths see it")]:::db
@@ -84,7 +92,7 @@ flowchart TB
84
92
  | Get auto-capture (sessions → lessons → recall) in Claude Code | Path A (plugin) |
85
93
  | Run `memesh remember` / `memesh recall` / `memesh doctor` in any terminal | Path B (npm-global) |
86
94
  | Open the local dashboard via `memesh serve` (no `npx` lookup delay) | Path B (npm-global) |
87
- | Plug `memesh-mcp` into Cursor, Cline, or another MCP client | Path B (npm-global) |
95
+ | Plug `memesh-mcp` into Codex CLI, Gemini CLI, Cursor, or another MCP client | Path B (npm-global) |
88
96
  | All of the above | **Install both** — they don't conflict |
89
97
 
90
98
  ### ⚠️ Installing the plugin does NOT install the CLI
@@ -111,41 +119,82 @@ If you only use memesh through Claude Code chat (never type `memesh` in a termin
111
119
  If you use Claude Code, install MeMesh as a plugin from inside the CLI:
112
120
 
113
121
  ```
114
- /plugin marketplace add PCIRCLE-AI/memesh-llm-memory
122
+ /plugin marketplace add PCIRCLE-AI/memesh
115
123
  /plugin install memesh@pcircle-memesh
116
124
  ```
117
125
 
118
126
  Claude Code wires hooks, skills, and the MCP server automatically. You get in-session auto-capture, proactive recall, the `/memesh` skill (remember / recall / learn / forget) inside the Claude Code conversation, and `remember` / `recall` / `forget` / `learn` available as MCP tools to the agent.
119
127
 
120
- The MCP server runs directly from the plugin's bundled compiled output no `npx` lookup, no build step needed. If the native `better-sqlite3` binding is missing on first start (e.g. after a Node major upgrade), the launcher self-heals by rebuilding it in-process.
128
+ **Verify it:** restart Claude Code and start any session. A status line like `◉ MeMesh ready · no memories for "your-project" yet` appears at the top that line IS the plugin working; no separate command needed. (Once you have memories, it shows counts instead.)
129
+
130
+ The MCP server runs directly from the plugin's bundled compiled output — no `npx` lookup, no build step, and nothing to compile. memesh stores its data through `node:sqlite`, which is part of Node itself (22.13+), so a Node upgrade cannot leave it with a binary built for the wrong runtime.
121
131
 
122
132
  > **This installs the plugin only.** You can run CLI commands via `npx @pcircle/memesh <command>` if you absolutely don't want a global install, but typing plain `memesh` in a terminal will report `command not found`. To get a real shell `memesh` command, also run **Option B** below — both paths coexist and share the same memory database. The "Install paths at a glance" diagram above covers this.
123
133
 
124
134
  ### Option B — npm global (optional optimisation)
125
135
 
126
- If you want the binary directly on your shell `PATH` (so plain `memesh`, `memesh-mcp`, etc. work in any terminal without the per-call `npx` lookup), or you want to expose `memesh-mcp` as a fixed-path stdio command to **non-Claude-Code MCP clients** (Cursor, Cline, terminal-only flows):
136
+ If you want the binary directly on your shell `PATH` (so plain `memesh`, `memesh-mcp`, etc. work in any terminal without the per-call `npx` lookup), or you want to expose `memesh-mcp` as a fixed-path stdio command to **non-Claude-Code MCP clients** (Codex CLI, Gemini CLI, Cursor, Cline, terminal-only flows):
127
137
 
128
138
  ```bash
129
139
  npm install -g @pcircle/memesh
130
140
  ```
131
141
 
132
142
  > **First-install notes (one-time):**
133
- > - **Native modules** — `better-sqlite3` and `sqlite-vec` install via prebuilt binaries on macOS (arm64/x64), Linux (x64/arm64), and Windows x64. On uncommon platforms or when prebuilds fail, you'll need a working C/C++ toolchain.
143
+ > - **No compiler needed** — the database engine is Node's own `node:sqlite`. `sqlite-vec`, which adds meaning-based search, ships as a prebuilt file for macOS (arm64/x64), Linux (x64/arm64) and Windows x64; on any other platform it is simply absent and recall stays on keyword search. Nothing here runs an install script, so `npm install --ignore-scripts` installs a fully working memesh.
134
144
  > - **Semantic (meaning-based) search is optional** — the default recall path is FTS5 keyword search, which needs no model and no download. Meaning-based search needs an embedder: run [Ollama](https://ollama.com) locally, or configure a cloud embedder (see "Bring-your-own embeddings" below). Without one, memesh uses keyword search only.
135
145
 
136
146
  ### Step 1.5: Wire MeMesh into Claude Code (npm path only)
137
147
 
138
148
  If you installed via **Option A** (`/plugin install memesh@pcircle-memesh`), skip this step — Claude Code wires plugin hooks automatically.
139
149
 
140
- If you installed via **Option B** (`npm install -g`), the CLI is on your PATH and the MCP server is registered, but the Claude Code session hooks are not auto-wired. Without them you can still use `memesh remember` / `recall` manually, but the **auto-capture loop** (sessions → lessons → recall on next session) is silent.
150
+ If you installed via **Option B** (`npm install -g`), the CLI is on your PATH — but nothing is wired into Claude Code yet: the npm package deliberately runs no install scripts, and the plugin (Option A) is what registers the MCP server and hooks inside Claude Code. What the npm path can wire by itself is the session hooks. Without them you can still use `memesh remember` / `recall` manually, but the **auto-capture loop** (sessions → lessons → recall on next session) is silent.
151
+
152
+ ```bash
153
+ memesh setup # detects Claude Code / Codex / Gemini, offers to wire each, verifies
154
+ ```
155
+
156
+ Or the individual steps by hand:
141
157
 
142
158
  ```bash
143
159
  memesh install-hooks # adds memesh's hooks to ~/.claude/settings.json
144
- memesh doctor # verifies "Hooks wired into Claude Code" passes
160
+ memesh setup --check # machine-level verification: reads the hosts' own config, changes nothing
145
161
  ```
146
162
 
147
163
  The hooks coexist with any custom hooks you already have under `~/.claude/hooks/` — `install-hooks` writes additive entries and never overwrites yours. To remove later: `memesh uninstall-hooks`.
148
164
 
165
+ ### Same memory from Codex CLI and Gemini CLI
166
+
167
+ `memesh-mcp` is a plain stdio MCP server, so any MCP-capable host can talk to it — not just Claude Code. With Option B installed (`memesh-mcp` on your `PATH`), register it once per host:
168
+
169
+ ```bash
170
+ # OpenAI Codex CLI — writes [mcp_servers.memesh] into ~/.codex/config.toml
171
+ codex mcp add memesh -- memesh-mcp
172
+
173
+ # Google Gemini CLI — user scope, so it works in every folder
174
+ gemini mcp add -s user memesh memesh-mcp
175
+ ```
176
+
177
+ Every host reads and writes the same `~/.memesh/knowledge-graph.db`, so a memory stored from a Claude Code session is recallable from Codex or Gemini, and the other way around. Verify from either host by asking it to call the `recall` tool, or from a terminal:
178
+
179
+ ```bash
180
+ codex mcp list # memesh should be listed as enabled
181
+ gemini mcp list # memesh should show "Connected"
182
+ ```
183
+
184
+ > **Use `memesh-mcp`, not `npx -p @pcircle/memesh`, as the configured command.** `npx -p` resolves to the *local* package whenever the host's working directory is inside a checkout of this repository, silently running whatever state that working tree is in instead of the installed release.
185
+
186
+ ### Native integration: Hermes Agent
187
+
188
+ **Hermes Agent** (NousResearch) has a first-party `MemoryProvider` plugin system — MeMesh integrates at the same tier as Hermes's own built-in memory backends (honcho, mem0, hindsight), not as an HTTP bridge. Unlike MCP mode where you manually call tools, Hermes's provider system runs `recall`/`remember` automatically on every turn.
189
+
190
+ The integration maps Hermes's `prefetch()` and `sync_turn()` hooks directly onto MeMesh's HTTP API. Complete guide with provider code structure, config, and four real pitfalls from a live deployment: **[docs/platforms/hermes-agent.md](docs/platforms/hermes-agent.md)**
191
+
192
+ ### Native integration: OpenClaw
193
+
194
+ **OpenClaw** has a first-party memory-capability plugin system — MeMesh integrates as a native memory provider at the same tier as OpenClaw's own built-in backends (LanceDB), not as an HTTP bridge. The plugin registers via `api.registerMemoryCapability()` and exposes `memory_recall`/`memory_store`/`memory_forget` tools plus automatic recall on the `before_prompt_build` hook.
195
+
196
+ **Key difference from Hermes**: OpenClaw's auto-capture is threshold-gated (max 3 memories/turn when triggered), not every-turn. The integration maps onto MeMesh's HTTP API (`/v1/recall`, `/v1/remember`, `/v1/forget`). Full TypeScript plugin contract, config shape, and pitfalls: **[docs/platforms/openclaw.md](docs/platforms/openclaw.md)**
197
+
149
198
  ### Step 2: Store a decision
150
199
 
151
200
  > The bash examples below assume `memesh` is on your `PATH` (Option B). Option A (plugin-only) users have two equivalent paths: ask in the Claude Code conversation (the `/memesh` skill + MCP tools cover the same flows), or replace `memesh` with `npx @pcircle/memesh` in any shell — same flags, no global install needed.
@@ -193,6 +242,32 @@ memesh serve
193
242
  <img src="docs/images/dashboard-graph.png" alt="MeMesh Graph — interactive knowledge graph with type filters and ego mode" width="100%" />
194
243
  </p>
195
244
 
245
+ ### See what it remembered
246
+
247
+ At any moment, one command prints what your agent knows about the current project — where work was left off, decisions, lessons, recent activity (wrapped as reference data):
248
+
249
+ ```bash
250
+ memesh briefing
251
+ ```
252
+
253
+ ```text
254
+ Where "your-project" was left off (today):
255
+ - Goal: Ship the payment retry logic
256
+ - Next: Open the PR once CI is green
257
+
258
+ Decisions and direction for "your-project":
259
+ - [decision] Use FTS5 as the retrieval baseline
260
+ ```
261
+
262
+ This same block is what Claude Code receives automatically at session start, and what any other MCP client gets from the `briefing` tool — the agent starts oriented instead of re-reading the repository, and you stop re-explaining last week. The dashboard (`memesh serve`) is the full visual view.
263
+
264
+ ### Your data
265
+
266
+ - **One local file.** Everything lives in `~/.memesh/knowledge-graph.db` — SQLite, on your disk. No cloud account; nothing leaves your machine unless you configure a cloud embedder or LLM yourself.
267
+ - **Back up = copy that one file.** Restore = copy it back.
268
+ - **Pause capture anytime**: `export MEMESH_AUTO_CAPTURE=false`.
269
+ - **Delete everything**: remove `~/.memesh/`.
270
+
196
271
  ---
197
272
 
198
273
  ## Who Is This For?
@@ -261,15 +336,30 @@ Paste tools into any API call
261
336
 
262
337
  ---
263
338
 
339
+ ## Benchmarks — 95.60% R@5 on LongMemEval-S
340
+
341
+ MeMesh's retrieval is **FTS5 alone** — no LLM, no embeddings on the hot path. Measured against the public [LongMemEval-S](https://huggingface.co/datasets/xiaowu0162/longmemeval) benchmark (500 questions, MIT-licensed):
342
+
343
+ | System | R@5 | Source |
344
+ |---|---|---|
345
+ | **MeMesh (Mode A, via `recallEnhanced()`)** | **95.60%** | [benchmarks/longmemeval/RESULTS.md](benchmarks/longmemeval/RESULTS.md) |
346
+ | MemPalace | 96.6% | Vendor self-report |
347
+ | Supermemory | ~82% | Vendor estimate |
348
+ | Zep | 63.8% | LongMemEval paper |
349
+ | Mem0 | 49.0% | LongMemEval paper |
350
+
351
+ Re-runnable in ~10 seconds. Full instructions, dataset SHA256, raw per-question results, and known-failure analysis: [`benchmarks/longmemeval/REPRODUCE.md`](benchmarks/longmemeval/REPRODUCE.md).
352
+
353
+ ---
354
+
264
355
  ## What Happens Automatically In Claude Code
265
356
 
266
- You don't need to manually remember everything. MeMesh has **7 hooks** that capture and inject knowledge while you work:
357
+ You don't need to manually remember everything. MeMesh has **6 hooks** that capture and inject knowledge while you work:
267
358
 
268
359
  | When | What MeMesh does |
269
360
  |------|------------------|
270
361
  | **Every session start** | Loads your most relevant memories + proactive warnings from past lessons |
271
362
  | **Before editing files** | Recalls memories tied to the file or project before Claude writes code |
272
- | **Before bash commands** | (Opt-in) Nudges Claude to dispatch high-verifiability commands (test, build, lint, migrate, deploy, benchmark) as background agents |
273
363
  | **When you ask to remember** | Detects "remember this" / "guardar en memesh" / "sauvegarder dans memesh" / "記下來" intent (5 languages) and reminds Claude to use memesh |
274
364
  | **After every `git commit`** | Records what you changed, with diff stats |
275
365
  | **When Claude stops** | Captures files edited, errors fixed, and auto-generates structured lessons from failures |
@@ -288,7 +378,6 @@ All configuration is via environment variables. Defaults are local-only and zero
288
378
  | `MEMESH_DB_PATH` | `~/.memesh/knowledge-graph.db` | Override the SQLite database location. |
289
379
  | `MEMESH_AUTO_CAPTURE` | `true` | Disable the auto-capture hooks (`Stop`, `PreCompact`) entirely. |
290
380
  | `MEMESH_AUTO_DETECT_LLM` | unset (auto-detect **on**) | Set to `0` to stop memesh using an API key it finds in your shell env. By default, if `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `OLLAMA_HOST` is set and you have not configured a provider in `~/.memesh/config.json`, memesh uses it for write-side LLM features (lesson extraction, auto-tagging, dream). Embeddings are unaffected — they stay keyword-only (FTS5) unless you explicitly set `embedder.provider` to `ollama` or `openai`. |
291
- | `MEMESH_ENABLE_AGENTIC_ORCHESTRATION` | unset | Set to `1` to enable an experimental working-model protocol (CTO / Orchestrator / Agents framing). Adds a session-start banner, a Bash command nudge, and `verify_agent_work` telemetry. The protocol's effectiveness is being instrumented, not yet proven — opt in if you want to participate. **Default is OFF**: the core memory features work without this flag. |
292
381
  | `MEMESH_AUTO_UPDATE` | `off` | Auto-update policy. `off` (default) never auto-updates; `patch` allows `X.Y.Z → X.Y.Z+N`; `minor` adds `X.Y.Z → X.Y+1.0`; `major` allows any bump. When permitted, a detached `npm install -g` fires at session end (Stop hook) so it never blocks your work — outcomes land in `~/.memesh/auto-update.log`. Also settable as `autoUpdate` in `~/.memesh/config.json` (env wins). When the installed version is deprecated by maintainers (security advisory), `patch` is force-allowed even on `off` — minor / major bumps still stay manual to avoid silent behaviour drift. |
293
382
  | `OPENAI_API_KEY` | unset | Your OpenAI key. Used automatically for LLM features unless you set `MEMESH_AUTO_DETECT_LLM=0` or configure a provider explicitly. |
294
383
  | `OLLAMA_HOST` | `http://localhost:11434` | Override the Ollama endpoint when using a local Ollama provider. |
@@ -328,7 +417,7 @@ When npm flags an installed version as deprecated (typically a security advisory
328
417
 
329
418
  **🔄 Knowledge Evolution** — Decisions change. `forget` archives old memories (never deletes). `supersedes` relations link old → new. Your AI always sees the latest version.
330
419
 
331
- **⚠️ Conflict Detection** — If you have two memories that contradict each other, MeMesh warns you.
420
+ **⚠️ Conflict Detection** — `memesh dream conflicts` has the LLM judge your semantically-closest memory pairs for contradiction, supersession or duplication, and stages what it finds as proposals. Nothing applies itself: you review with `dream list` / `dream show`, and only an accepted proposal creates the relation — after which every `recall` touching either memory carries the warning. Causality is never inferred from timestamps; verdicts come from what the memories actually say.
332
421
 
333
422
  **🕸️ Knowledge Graph Connectivity** — `memesh kg backfill-relations --all-rules` links orphan entities using tag co-occurrence, project clustering, session context, and name similarity — no LLM required.
334
423
 
@@ -350,6 +439,58 @@ Imported bundles stay searchable, but MeMesh does not auto-inject imported memor
350
439
 
351
440
  ---
352
441
 
442
+ ## Recipes
443
+
444
+ ### Catch a contradiction before it bites
445
+
446
+ Two decisions, made weeks apart, that cannot both be true — the failure mode
447
+ a memory layer exists to catch:
448
+
449
+ ```bash
450
+ memesh remember --name retry-policy --type decision \
451
+ --obs "All HTTP clients retry failed requests up to 5 times with exponential backoff."
452
+ # ...weeks later, someone decides the opposite...
453
+ memesh remember --name retry-policy-v2 --type decision \
454
+ --obs "HTTP clients must never retry automatically — fail fast and surface the error."
455
+
456
+ memesh dream conflicts # the judge flags the pair, with its reasoning
457
+ memesh dream show 1 # read the verdict, the excerpts, what accepting creates
458
+ memesh dream accept 1 # YOU decide — nothing is ever linked automatically
459
+ memesh recall "retry policy" # → Warning: Conflicts detected
460
+ ```
461
+
462
+ From then on, any assistant that recalls either decision is told they
463
+ conflict — instead of confidently quoting whichever one it found first.
464
+
465
+ ### One memory, three assistants
466
+
467
+ MeMesh is an MCP server, so the same SQLite file serves every MCP client on
468
+ the machine. Register it once per tool (exact commands in
469
+ [Get Started](#get-started-in-60-seconds)) and a decision recorded in Claude
470
+ Code is recalled by Codex or Gemini CLI mid-session — no re-explaining, no
471
+ copy-pasting context between vendors.
472
+
473
+ ### Record decisions so they stay findable
474
+
475
+ Auto-capture keeps session history, but the memories that pay rent are the
476
+ deliberate ones:
477
+
478
+ ```bash
479
+ memesh remember --name auth-approach --type decision \
480
+ --obs "JWT with RS256; PKCE over implicit flow because the client is public." \
481
+ --tags "project:myapp" "topic:auth"
482
+ ```
483
+
484
+ Then link consequences to their causes as they happen — from any MCP client,
485
+ in plain words: *"remember this incident as a lesson, influenced by
486
+ auth-approach"*. The `remember` tool takes free-form relations, and `caused` /
487
+ `influenced` are the documented causal vocabulary (cause → effect, stated
488
+ explicitly — MeMesh never infers causality from timestamps). Weeks later,
489
+ `memesh recall "why did we pick PKCE"` returns the decision with its recorded
490
+ consequences attached — reasoning you can follow, not just text that matched.
491
+
492
+ ---
493
+
353
494
  ## Unlock Smart Mode (Optional)
354
495
 
355
496
  MeMesh works offline by default — recall stays strictly LLM-free (95.60% R@5 on LongMemEval-S out of the box). Add an LLM API key only if you want LLM-augmented analysis flows on top: smarter session extraction, auto-tagging of new memories, lesson generation from failures, and `dream` compression:
@@ -392,7 +533,7 @@ The embedder is configured **independently of the chat LLM** — changing `llm.p
392
533
 
393
534
  ---
394
535
 
395
- ## All 8 Memory Tools
536
+ ## All 9 Memory Tools
396
537
 
397
538
  | Tool | What it does |
398
539
  |------|-------------|
@@ -402,8 +543,9 @@ The embedder is configured **independently of the chat LLM** — changing `llm.p
402
543
  | `export` | Share memories as JSON between projects or team members |
403
544
  | `import` | Import memories with merge strategies (skip / overwrite / append) |
404
545
  | `learn` | Record structured lessons from mistakes (error, root cause, fix, prevention) |
546
+ | `task_state` | Read or record where the work stands — goal, next step, blocker, what was just finished |
547
+ | `briefing` | The assembled work topology — the same block Claude Code gets at session start, for any MCP client |
405
548
  | `user_patterns` | Analyze your work patterns — schedule, tools, strengths, learning areas |
406
- | `verify_agent_work` | Persist a verification report for background-agent work; reality-checks claimed file changes against `git diff` |
407
549
 
408
550
  ---
409
551
 
@@ -412,7 +554,7 @@ The embedder is configured **independently of the chat LLM** — changing `llm.p
412
554
  ```
413
555
  ┌─────────────────┐
414
556
  │ Core Engine │
415
- │ (8 operations) │
557
+ │ (7 operations) │
416
558
  └────────┬────────┘
417
559
  ┌─────────────────┼─────────────────┐
418
560
  │ │ │
@@ -434,19 +576,22 @@ Claude Code's plugin marketplace pins versions at install time and does **not**
434
576
 
435
577
  **Option A — `/plugin` UI**: uninstall `memesh@pcircle-memesh`, then reinstall. Claude Code fetches the latest marketplace version.
436
578
 
437
- **Option B — one-line script** (no UI clicking, idempotent):
579
+ **Option B — one command** (no UI clicking, idempotent; requires the npm CLI, `npm install -g @pcircle/memesh`):
580
+
581
+ ```bash
582
+ memesh upgrade-plugin
583
+ ```
584
+
585
+ It finds your installed plugin version, checks the prerequisites, and runs the bundled upgrade script for you. Prerequisites: `node`, `npm` and `rsync` on your PATH (macOS ships rsync; Debian/Ubuntu: `sudo apt install rsync`).
586
+
587
+ Plugin-only users without the npm CLI can still run the script by hand — substitute your installed version into the path:
438
588
 
439
589
  ```bash
440
- # If your plugin install is v4.2.5 or newer, the script ships inside it:
441
590
  bash ~/.claude/plugins/cache/pcircle-memesh/memesh/<current-version>/scripts/upgrade-plugin.sh
442
591
 
443
- # If you installed before v4.2.5 (i.e. you're on v4.2.4 or v4.2.3),
444
- # the script isn't in your plugin yet. Use the npm-global copy instead:
592
+ # Installs from before v4.2.5 don't contain the script yet; use the
593
+ # npm-global copy instead (see "Install paths at a glance" above):
445
594
  bash "$(npm prefix -g)/lib/node_modules/@pcircle/memesh/scripts/upgrade-plugin.sh"
446
-
447
- # (That assumes you've also run `npm install -g @pcircle/memesh`. If you
448
- # haven't, this is also a good moment to — see the "Install paths at a
449
- # glance" section above for why most users want both paths.)
450
595
  ```
451
596
 
452
597
  The script fast-forwards the marketplace cache, stages the new version under `~/.claude/plugins/cache/`, installs runtime deps, and re-points `installed_plugins.json`. Restart Claude Code afterwards so the MCP server reconnects.
@@ -460,8 +605,8 @@ Session start surfaces a one-line banner (throttled to once per 24h per version)
460
605
  ## Contributing
461
606
 
462
607
  ```bash
463
- git clone https://github.com/PCIRCLE-AI/memesh-llm-memory
464
- cd memesh-llm-memory && npm install && npm run build
608
+ git clone https://github.com/PCIRCLE-AI/memesh
609
+ cd memesh && npm install && npm run build
465
610
  npm test
466
611
  npm run test:e2e-dashboard
467
612
  ```