@pcircle/memesh 4.5.1 → 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.
- package/.claude-plugin/marketplace.json +5 -3
- package/.claude-plugin/plugin.json +6 -4
- package/AGENTS.md +95 -0
- package/README.de.md +129 -35
- package/README.md +161 -34
- package/README.zh-TW.md +130 -35
- package/dashboard/dist/index.html +10 -10
- package/dist/cli/view-live.js +3 -3
- package/dist/core/auto-tagger.d.ts.map +1 -1
- package/dist/core/auto-tagger.js +4 -9
- package/dist/core/auto-tagger.js.map +1 -1
- package/dist/core/briefing.d.ts +8 -0
- package/dist/core/briefing.d.ts.map +1 -0
- package/dist/core/briefing.js +91 -0
- package/dist/core/briefing.js.map +1 -0
- package/dist/core/capture-flag.d.ts +5 -0
- package/dist/core/capture-flag.d.ts.map +1 -0
- package/dist/core/capture-flag.js +10 -0
- package/dist/core/capture-flag.js.map +1 -0
- package/dist/core/conflict-candidates.d.ts +20 -0
- package/dist/core/conflict-candidates.d.ts.map +1 -0
- package/dist/core/conflict-candidates.js +79 -0
- package/dist/core/conflict-candidates.js.map +1 -0
- package/dist/core/conflict-judge.d.ts +47 -0
- package/dist/core/conflict-judge.d.ts.map +1 -0
- package/dist/core/conflict-judge.js +189 -0
- package/dist/core/conflict-judge.js.map +1 -0
- package/dist/core/digest-validator.d.ts.map +1 -1
- package/dist/core/digest-validator.js +3 -5
- package/dist/core/digest-validator.js.map +1 -1
- package/dist/core/doctor.d.ts +2 -0
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +34 -56
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/dreamer.d.ts +5 -2
- package/dist/core/dreamer.d.ts.map +1 -1
- package/dist/core/dreamer.js +108 -25
- package/dist/core/dreamer.js.map +1 -1
- package/dist/core/embedder.d.ts +5 -4
- package/dist/core/embedder.d.ts.map +1 -1
- package/dist/core/embedder.js +16 -8
- package/dist/core/embedder.js.map +1 -1
- package/dist/core/failure-analyzer.d.ts.map +1 -1
- package/dist/core/failure-analyzer.js +7 -12
- package/dist/core/failure-analyzer.js.map +1 -1
- package/dist/core/install-channel.d.ts +1 -1
- package/dist/core/install-channel.d.ts.map +1 -1
- package/dist/core/install-channel.js +16 -5
- package/dist/core/install-channel.js.map +1 -1
- package/dist/core/install-hooks.d.ts +5 -0
- package/dist/core/install-hooks.d.ts.map +1 -1
- package/dist/core/install-hooks.js +0 -0
- package/dist/core/install-hooks.js.map +1 -1
- package/dist/core/json-utils.d.ts +1 -0
- package/dist/core/json-utils.d.ts.map +1 -1
- package/dist/core/json-utils.js +19 -10
- package/dist/core/json-utils.js.map +1 -1
- package/dist/core/kg-backfill.d.ts +0 -1
- package/dist/core/kg-backfill.d.ts.map +1 -1
- package/dist/core/kg-backfill.js +0 -3
- package/dist/core/kg-backfill.js.map +1 -1
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +14 -21
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/memory-tool.d.ts.map +1 -1
- package/dist/core/memory-tool.js +4 -4
- package/dist/core/memory-tool.js.map +1 -1
- package/dist/core/operations.d.ts.map +1 -1
- package/dist/core/operations.js +22 -13
- package/dist/core/operations.js.map +1 -1
- package/dist/core/prompt-safety.d.ts +1 -0
- package/dist/core/prompt-safety.d.ts.map +1 -1
- package/dist/core/prompt-safety.js +7 -0
- package/dist/core/prompt-safety.js.map +1 -1
- package/dist/core/schema-export.d.ts.map +1 -1
- package/dist/core/schema-export.js +31 -0
- package/dist/core/schema-export.js.map +1 -1
- package/dist/core/setup.d.ts +29 -0
- package/dist/core/setup.d.ts.map +1 -0
- package/dist/core/setup.js +127 -0
- package/dist/core/setup.js.map +1 -0
- package/dist/core/task-state-store.d.ts +17 -0
- package/dist/core/task-state-store.d.ts.map +1 -0
- package/dist/core/task-state-store.js +45 -0
- package/dist/core/task-state-store.js.map +1 -0
- package/dist/core/task-state.d.ts +19 -0
- package/dist/core/task-state.d.ts.map +1 -0
- package/dist/core/task-state.js +91 -0
- package/dist/core/task-state.js.map +1 -0
- package/dist/core/time-utils.d.ts +2 -0
- package/dist/core/time-utils.d.ts.map +1 -0
- package/dist/core/time-utils.js +14 -0
- package/dist/core/time-utils.js.map +1 -0
- package/dist/core/title.d.ts +5 -0
- package/dist/core/title.d.ts.map +1 -0
- package/dist/core/title.js +14 -0
- package/dist/core/title.js.map +1 -0
- package/dist/core/transcript-source.d.ts.map +1 -1
- package/dist/core/transcript-source.js +2 -3
- package/dist/core/transcript-source.js.map +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/work-topology.d.ts +33 -0
- package/dist/core/work-topology.d.ts.map +1 -0
- package/dist/core/work-topology.js +183 -0
- package/dist/core/work-topology.js.map +1 -0
- package/dist/db.d.ts +2 -7
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +144 -284
- package/dist/db.js.map +1 -1
- package/dist/knowledge-graph.d.ts +1 -0
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +50 -40
- package/dist/knowledge-graph.js.map +1 -1
- package/dist/skills-manifest.json +48 -18
- package/dist/storage/conflicts.d.ts.map +1 -1
- package/dist/storage/conflicts.js +2 -7
- package/dist/storage/conflicts.js.map +1 -1
- package/dist/storage/fts-index.d.ts +4 -2
- package/dist/storage/fts-index.d.ts.map +1 -1
- package/dist/storage/fts-index.js +16 -4
- package/dist/storage/fts-index.js.map +1 -1
- package/dist/storage/schema.d.ts +20 -0
- package/dist/storage/schema.d.ts.map +1 -0
- package/dist/storage/schema.js +274 -0
- package/dist/storage/schema.js.map +1 -0
- package/dist/transports/cli/cli.d.ts +1 -4
- package/dist/transports/cli/cli.d.ts.map +1 -1
- package/dist/transports/cli/cli.js +382 -6
- package/dist/transports/cli/cli.js.map +1 -1
- package/dist/transports/http/server.d.ts.map +1 -1
- package/dist/transports/http/server.js +208 -307
- package/dist/transports/http/server.js.map +1 -1
- package/dist/transports/mcp/handlers.d.ts +46 -0
- package/dist/transports/mcp/handlers.d.ts.map +1 -1
- package/dist/transports/mcp/handlers.js +57 -2
- package/dist/transports/mcp/handlers.js.map +1 -1
- package/dist/transports/schemas.d.ts +21 -10
- package/dist/transports/schemas.d.ts.map +1 -1
- package/dist/transports/schemas.js +26 -8
- package/dist/transports/schemas.js.map +1 -1
- package/llms-install.md +138 -0
- package/package.json +14 -9
- package/scripts/hooks/_generated/capture-flag.js +17 -0
- package/scripts/hooks/_generated/fts-index.js +16 -4
- package/scripts/hooks/_generated/schema.js +281 -0
- package/scripts/hooks/_generated/task-state.js +98 -0
- package/scripts/hooks/_generated/time-utils.js +21 -0
- package/scripts/hooks/_generated/title.js +21 -0
- package/scripts/hooks/_generated/work-topology.js +190 -0
- package/scripts/hooks/_shared.js +122 -478
- package/scripts/hooks/post-commit.js +4 -1
- package/scripts/hooks/pre-compact.js +13 -1
- package/scripts/hooks/pre-edit-recall.js +5 -3
- package/scripts/hooks/session-start.js +135 -59
- package/scripts/hooks/session-summary.js +59 -24
- package/skills/memesh/SKILL.md +97 -76
- package/README.es.md +0 -467
- package/README.fr.md +0 -459
- package/README.ja.md +0 -467
- package/README.ko.md +0 -467
- package/README.pt.md +0 -459
- package/README.th.md +0 -460
- package/README.vi.md +0 -459
- package/README.zh-CN.md +0 -466
- package/dist/cli/view.d.ts +0 -3
- package/dist/cli/view.d.ts.map +0 -1
- package/dist/cli/view.js +0 -523
- package/dist/cli/view.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
🌐 [English](README.md) | [繁體中文](README.zh-TW.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
|
|
4
|
+
<h1 align="center">MeMesh</h1>
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>
|
|
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** —
|
|
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
|
-
##
|
|
21
|
+
## Install
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**In Claude Code** — type these in the chat (hooks, memory tools and the `/memesh` skill are wired automatically):
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
@@ -111,12 +119,14 @@ 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
|
|
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
|
|
|
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
|
+
|
|
120
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.
|
|
@@ -137,11 +147,17 @@ npm install -g @pcircle/memesh
|
|
|
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
|
|
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
|
|
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`.
|
|
@@ -167,6 +183,18 @@ gemini mcp list # memesh should show "Connected"
|
|
|
167
183
|
|
|
168
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.
|
|
169
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
|
+
|
|
170
198
|
### Step 2: Store a decision
|
|
171
199
|
|
|
172
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.
|
|
@@ -214,6 +242,32 @@ memesh serve
|
|
|
214
242
|
<img src="docs/images/dashboard-graph.png" alt="MeMesh Graph — interactive knowledge graph with type filters and ego mode" width="100%" />
|
|
215
243
|
</p>
|
|
216
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
|
+
|
|
217
271
|
---
|
|
218
272
|
|
|
219
273
|
## Who Is This For?
|
|
@@ -282,6 +336,22 @@ Paste tools into any API call
|
|
|
282
336
|
|
|
283
337
|
---
|
|
284
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
|
+
|
|
285
355
|
## What Happens Automatically In Claude Code
|
|
286
356
|
|
|
287
357
|
You don't need to manually remember everything. MeMesh has **6 hooks** that capture and inject knowledge while you work:
|
|
@@ -347,7 +417,7 @@ When npm flags an installed version as deprecated (typically a security advisory
|
|
|
347
417
|
|
|
348
418
|
**🔄 Knowledge Evolution** — Decisions change. `forget` archives old memories (never deletes). `supersedes` relations link old → new. Your AI always sees the latest version.
|
|
349
419
|
|
|
350
|
-
**⚠️ Conflict Detection** —
|
|
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.
|
|
351
421
|
|
|
352
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.
|
|
353
423
|
|
|
@@ -369,6 +439,58 @@ Imported bundles stay searchable, but MeMesh does not auto-inject imported memor
|
|
|
369
439
|
|
|
370
440
|
---
|
|
371
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
|
+
|
|
372
494
|
## Unlock Smart Mode (Optional)
|
|
373
495
|
|
|
374
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:
|
|
@@ -411,7 +533,7 @@ The embedder is configured **independently of the chat LLM** — changing `llm.p
|
|
|
411
533
|
|
|
412
534
|
---
|
|
413
535
|
|
|
414
|
-
## All
|
|
536
|
+
## All 9 Memory Tools
|
|
415
537
|
|
|
416
538
|
| Tool | What it does |
|
|
417
539
|
|------|-------------|
|
|
@@ -421,6 +543,8 @@ The embedder is configured **independently of the chat LLM** — changing `llm.p
|
|
|
421
543
|
| `export` | Share memories as JSON between projects or team members |
|
|
422
544
|
| `import` | Import memories with merge strategies (skip / overwrite / append) |
|
|
423
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 |
|
|
424
548
|
| `user_patterns` | Analyze your work patterns — schedule, tools, strengths, learning areas |
|
|
425
549
|
|
|
426
550
|
---
|
|
@@ -452,19 +576,22 @@ Claude Code's plugin marketplace pins versions at install time and does **not**
|
|
|
452
576
|
|
|
453
577
|
**Option A — `/plugin` UI**: uninstall `memesh@pcircle-memesh`, then reinstall. Claude Code fetches the latest marketplace version.
|
|
454
578
|
|
|
455
|
-
**Option B — one
|
|
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:
|
|
456
588
|
|
|
457
589
|
```bash
|
|
458
|
-
# If your plugin install is v4.2.5 or newer, the script ships inside it:
|
|
459
590
|
bash ~/.claude/plugins/cache/pcircle-memesh/memesh/<current-version>/scripts/upgrade-plugin.sh
|
|
460
591
|
|
|
461
|
-
#
|
|
462
|
-
#
|
|
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):
|
|
463
594
|
bash "$(npm prefix -g)/lib/node_modules/@pcircle/memesh/scripts/upgrade-plugin.sh"
|
|
464
|
-
|
|
465
|
-
# (That assumes you've also run `npm install -g @pcircle/memesh`. If you
|
|
466
|
-
# haven't, this is also a good moment to — see the "Install paths at a
|
|
467
|
-
# glance" section above for why most users want both paths.)
|
|
468
595
|
```
|
|
469
596
|
|
|
470
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.
|
|
@@ -478,8 +605,8 @@ Session start surfaces a one-line banner (throttled to once per 24h per version)
|
|
|
478
605
|
## Contributing
|
|
479
606
|
|
|
480
607
|
```bash
|
|
481
|
-
git clone https://github.com/PCIRCLE-AI/memesh
|
|
482
|
-
cd memesh
|
|
608
|
+
git clone https://github.com/PCIRCLE-AI/memesh
|
|
609
|
+
cd memesh && npm install && npm run build
|
|
483
610
|
npm test
|
|
484
611
|
npm run test:e2e-dashboard
|
|
485
612
|
```
|
package/README.zh-TW.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
🌐 [English](README.md) | [繁體中文](README.zh-TW.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
|
|
4
|
+
<h1 align="center">MeMesh</h1>
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong
|
|
6
|
+
<strong>給程式開發代理的代理式記憶。</strong><br />
|
|
7
7
|
一個 SQLite 檔案。不需要 Docker。不需要雲端。
|
|
8
8
|
</p>
|
|
9
9
|
<p align="center">
|
|
@@ -16,32 +16,38 @@
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
> **持續開發中的專案** — 功能會持續更新,版本之間可能會有變動。遇到問題或想要新功能,請[開 issue](https://github.com/PCIRCLE-AI/memesh-llm-memory/issues)。
|
|
19
|
+
**MeMesh** — 給 Claude Code 和 MCP 程式開發代理的開源**代理式記憶**:從代理的實際工作中擷取,在它行動的當下注入,記憶自相矛盾時保持誠實。一個 SQLite 檔案。不需要雲端。
|
|
21
20
|
|
|
22
|
-
##
|
|
21
|
+
## 安裝
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
**在 Claude Code 裡** — 在對話框輸入這兩行(hooks、記憶工具和 `/memesh` skill 會自動接好):
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
```
|
|
26
|
+
/plugin marketplace add PCIRCLE-AI/memesh
|
|
27
|
+
/plugin install memesh@pcircle-memesh
|
|
28
|
+
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
重開 Claude Code。下一個 session 開頭出現 `◉ MeMesh` 狀態列,就代表它在記了。
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
**在終端機裡** — `memesh` CLI、儀表板,以及給 Codex / Gemini / Cursor 用的 `memesh-mcp` server(需要 [Node 22.13+](https://nodejs.org)):
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g @pcircle/memesh
|
|
36
|
+
memesh doctor # 端到端驗證這份安裝
|
|
37
|
+
```
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
大多數 Claude Code 使用者最後兩種都會裝 — 它們共用同一個資料庫、永不衝突。細節、其他代理、升級方式:見下方「60 秒快速開始」。
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|---|---|---|
|
|
38
|
-
| **MeMesh(Mode A,經由 `recallEnhanced()`)** | **95.60%** | [benchmarks/longmemeval/RESULTS.md](benchmarks/longmemeval/RESULTS.md) |
|
|
39
|
-
| MemPalace | 96.6% | 廠商自行回報 |
|
|
40
|
-
| Supermemory | ~82% | 廠商估計值 |
|
|
41
|
-
| Zep | 63.8% | LongMemEval 論文 |
|
|
42
|
-
| Mem0 | 49.0% | LongMemEval 論文 |
|
|
41
|
+
## 問題所在
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
你的程式開發代理在對話之間不只是忘記事實 — 它會**重複做過的工作**。它會重新提出你上個月否決過的做法,被同一個失敗的測試絆倒,重新發現三月那次弄壞 production 的限制條件,還要你重新解釋那個它自己參與設計的架構。
|
|
44
|
+
|
|
45
|
+
這不是聊天記錄的問題,而是代理記憶的問題。需要在對話之間留存下來的是*工作本身*:決策連同它的理由、失敗連同它的修法,以及它們之間的關聯。
|
|
46
|
+
|
|
47
|
+
**MeMesh 就是那份記憶。** Hooks 從代理實際做的事情擷取記憶(session、commit、失敗 — 不是手動筆記),回憶在代理行動的當下注入記憶(session 開始時、編輯檔案前),知識圖譜層則讓記憶長期保持誠實(supersession 汰換、由 LLM 判定的衝突偵測)。用 npm 安裝,把記憶保存在 `~/.memesh/knowledge-graph.db`,然後連接到 Claude Code 或任何支援 MCP 的用戶端。
|
|
48
|
+
|
|
49
|
+
> [!IMPORTANT]
|
|
50
|
+
> **持續開發中的專案** — 功能會持續更新,版本之間可能會有變動。遇到問題或想要新功能,請[開 issue](https://github.com/PCIRCLE-AI/memesh/issues)。
|
|
45
51
|
|
|
46
52
|
---
|
|
47
53
|
|
|
@@ -65,7 +71,7 @@ flowchart TB
|
|
|
65
71
|
subgraph paths["Two install paths"]
|
|
66
72
|
direction LR
|
|
67
73
|
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
|
|
74
|
+
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
75
|
end
|
|
70
76
|
|
|
71
77
|
DB[("Shared memory DB<br/><code>~/.memesh/knowledge-graph.db</code><br/>Same data, both paths see it")]:::db
|
|
@@ -113,11 +119,13 @@ npm install -g @pcircle/memesh
|
|
|
113
119
|
如果你使用 Claude Code,從 CLI 內把 MeMesh 當外掛安裝:
|
|
114
120
|
|
|
115
121
|
```
|
|
116
|
-
/plugin marketplace add PCIRCLE-AI/memesh
|
|
122
|
+
/plugin marketplace add PCIRCLE-AI/memesh
|
|
117
123
|
/plugin install memesh@pcircle-memesh
|
|
118
124
|
```
|
|
119
125
|
|
|
120
|
-
Claude Code 會自動接好 hooks、skills 和 MCP server。你會獲得對話內自動擷取、主動回憶、可在 Claude Code 對話中使用的 `/memesh` skill(remember / recall / learn / forget),以及代理可呼叫的 `remember` / `recall` / `forget` / `learn` MCP 工具。
|
|
126
|
+
Claude Code 會自動接好 hooks、skills 和 MCP server。你會獲得對話內自動擷取、主動回憶、可在 Claude Code 對話中使用的 `/memesh` skill(remember / recall / learn / forget),以及代理可呼叫的 `remember` / `recall` / `forget` / `learn` MCP 工具。
|
|
127
|
+
|
|
128
|
+
**驗證方式:**重開 Claude Code、開任何 session。開頭出現像 `◉ MeMesh ready · no memories for "your-project" yet` 的狀態列 — 那一行就是外掛在運作的證明,不需要另外跑指令。(有記憶之後會改顯示數量。)CLI 與本地儀表板無需任何額外的全域安裝就能完整使用 — `npx @pcircle/memesh <command>` 可執行所有 CLI 指令,`npx @pcircle/memesh` 可在 `localhost:3737` 啟動儀表板。MCP server 直接從外掛內建的編譯產物啟動 — 不需要 `npx` 查找、不需要 `npm install -g`、不需要本地建置步驟。memesh 透過 Node 內建的 `node:sqlite`(22.13+)存放資料,所以升級 Node 不會留下一個為錯誤 runtime 編譯的二進位檔。
|
|
121
129
|
|
|
122
130
|
### 選項 B — npm 全域安裝(可選最佳化)
|
|
123
131
|
|
|
@@ -135,15 +143,54 @@ npm install -g @pcircle/memesh
|
|
|
135
143
|
|
|
136
144
|
如果你透過**選項 A**(`/plugin install memesh@pcircle-memesh`)安裝,請略過此步驟 — Claude Code 會自動接好外掛 hooks。
|
|
137
145
|
|
|
138
|
-
如果你透過**選項 B**(`npm install -g`)安裝,CLI 已在 PATH
|
|
146
|
+
如果你透過**選項 B**(`npm install -g`)安裝,CLI 已在 PATH 上 — 但**還沒有任何東西接進 Claude Code**:npm 套件刻意不執行安裝腳本,把 MCP server 和 hooks 接進 Claude Code 的是外掛(選項 A)。npm 路徑自己能接的是 session hooks。沒有這些 hooks 還是可以手動使用 `memesh remember` / `recall`,但**自動擷取迴路**(session → 教訓 → 下次 session 主動回憶)就會靜默不動。
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
memesh setup # 偵測 Claude Code / Codex / Gemini、逐一詢問接線、接完驗證
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
或手動逐步:
|
|
139
153
|
|
|
140
154
|
```bash
|
|
141
155
|
memesh install-hooks # 把 memesh hooks 加進 ~/.claude/settings.json
|
|
142
|
-
memesh
|
|
156
|
+
memesh setup --check # 機器層級驗證:讀各主機自己的設定,什麼都不改
|
|
143
157
|
```
|
|
144
158
|
|
|
145
159
|
這些 hooks 會跟你既有的 `~/.claude/hooks/` 自訂 hooks 共存 — `install-hooks` 用追加方式寫入,從不覆寫你的東西。要移除:`memesh uninstall-hooks`。
|
|
146
160
|
|
|
161
|
+
### 從 Codex CLI 和 Gemini CLI 用同一份記憶
|
|
162
|
+
|
|
163
|
+
`memesh-mcp` 是標準的 stdio MCP server,任何支援 MCP 的主機都能用 — 不限 Claude Code。裝好選項 B(`memesh-mcp` 在 `PATH` 上)之後,每個主機註冊一次:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# OpenAI Codex CLI — 會把 [mcp_servers.memesh] 寫進 ~/.codex/config.toml
|
|
167
|
+
codex mcp add memesh -- memesh-mcp
|
|
168
|
+
|
|
169
|
+
# Google Gemini CLI — user 範圍,每個資料夾都能用
|
|
170
|
+
gemini mcp add -s user memesh memesh-mcp
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
每個主機讀寫的都是同一個 `~/.memesh/knowledge-graph.db`,所以在 Claude Code session 存的記憶,Codex 和 Gemini 都回憶得到,反之亦然。驗證:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
codex mcp list # memesh 應顯示為 enabled
|
|
177
|
+
gemini mcp list # memesh 應顯示 "Connected"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
> **設定的指令要用 `memesh-mcp`,不要用 `npx -p @pcircle/memesh`。**當主機的工作目錄在這個 repo 的 checkout 裡時,`npx -p` 會解析到*本地*套件,靜默執行工作樹當下的狀態而不是安裝好的正式版。
|
|
181
|
+
|
|
182
|
+
### 原生整合:Hermes Agent
|
|
183
|
+
|
|
184
|
+
**Hermes Agent** (NousResearch) 有一套第一方 `MemoryProvider` 外掛系統 — MeMesh 整合的層級與 Hermes 自己內建的記憶後端(honcho、mem0、hindsight)相同,不是 HTTP 橋接。與 MCP 模式手動呼叫工具不同,Hermes 的 provider 系統在每一輪自動執行 `recall`/`remember`。
|
|
185
|
+
|
|
186
|
+
整合將 Hermes 的 `prefetch()` 和 `sync_turn()` hooks 直接對應到 MeMesh 的 HTTP API。完整指南包含 provider 程式結構、設定,以及來自真實部署的四個陷阱:**[docs/platforms/hermes-agent.md](docs/platforms/hermes-agent.md)**
|
|
187
|
+
|
|
188
|
+
### 原生整合:OpenClaw
|
|
189
|
+
|
|
190
|
+
**OpenClaw** 有一套第一方記憶能力外掛系統 — MeMesh 整合的層級與 OpenClaw 自己內建的後端(LanceDB)相同,不是 HTTP 橋接。外掛透過 `api.registerMemoryCapability()` 註冊,並提供 `memory_recall`/`memory_store`/`memory_forget` 工具,以及在 `before_prompt_build` hook 上自動 recall。
|
|
191
|
+
|
|
192
|
+
**與 Hermes 的關鍵差異**:OpenClaw 的自動擷取有門檻控制(觸發時每輪最多 3 筆記憶),而非每一輪都擷取。整合對應到 MeMesh 的 HTTP API(`/v1/recall`、`/v1/remember`、`/v1/forget`)。完整 TypeScript 外掛合約、設定形狀與陷阱:**[docs/platforms/openclaw.md](docs/platforms/openclaw.md)**
|
|
193
|
+
|
|
147
194
|
### 第二步:保存一個決策
|
|
148
195
|
|
|
149
196
|
> 下方的 bash 範例假設 `memesh` 已在 `PATH` 上(選項 B)。選項 A(純外掛)使用者有兩條等價路徑:在 Claude Code 對話中發問(`/memesh` skill 與 MCP 工具涵蓋同樣的流程),或將任何 shell 中的 `memesh` 替換為 `npx @pcircle/memesh` — 旗標相同,不需要全域安裝。
|
|
@@ -191,6 +238,32 @@ memesh serve
|
|
|
191
238
|
<img src="docs/images/dashboard-graph.png" alt="MeMesh 圖表 — 互動式知識圖,具有類型篩選和自我中心模式" width="100%" />
|
|
192
239
|
</p>
|
|
193
240
|
|
|
241
|
+
### 看看它幫你記了什麼
|
|
242
|
+
|
|
243
|
+
任何時候一條指令,就能印出你的代理對目前專案知道什麼 — 工作做到哪、決策、教訓、近期活動(以參考資料的形式包好):
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
memesh briefing
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
```text
|
|
250
|
+
Where "your-project" was left off (today):
|
|
251
|
+
- Goal: Ship the payment retry logic
|
|
252
|
+
- Next: Open the PR once CI is green
|
|
253
|
+
|
|
254
|
+
Decisions and direction for "your-project":
|
|
255
|
+
- [decision] Use FTS5 as the retrieval baseline
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Claude Code 在 session 開始時自動收到的就是同一個區塊,其他 MCP 用戶端呼叫 `briefing` 工具也拿到同一份 — 代理一開場就有方向,不用重讀整個 repo,你也不用再重講上禮拜的事。儀表板(`memesh serve`)是完整的視覺化版本。
|
|
259
|
+
|
|
260
|
+
### 你的資料
|
|
261
|
+
|
|
262
|
+
- **就一個本機檔案。**所有東西都在 `~/.memesh/knowledge-graph.db` — SQLite、在你的硬碟上。沒有雲端帳號;除非你自己設定雲端 embedder 或 LLM,否則什麼都不會離開你的機器。
|
|
263
|
+
- **備份 = 複製那個檔案。**還原 = 複製回去。
|
|
264
|
+
- **隨時暫停擷取**:`export MEMESH_AUTO_CAPTURE=false`。
|
|
265
|
+
- **全部刪除**:移除 `~/.memesh/`。
|
|
266
|
+
|
|
194
267
|
---
|
|
195
268
|
|
|
196
269
|
## 誰應該用 MeMesh?
|
|
@@ -259,6 +332,22 @@ memesh export-schema \
|
|
|
259
332
|
|
|
260
333
|
---
|
|
261
334
|
|
|
335
|
+
## 基準測試 — 95.60% R@5 on LongMemEval-S
|
|
336
|
+
|
|
337
|
+
MeMesh 的檢索引擎**只用 FTS5**(熱路徑上不使用 LLM、不使用嵌入),對照公開的 [LongMemEval-S](https://huggingface.co/datasets/xiaowu0162/longmemeval) 基準測試(500 題,MIT 授權)量測:
|
|
338
|
+
|
|
339
|
+
| 系統 | R@5 | 來源 |
|
|
340
|
+
|---|---|---|
|
|
341
|
+
| **MeMesh(Mode A,經由 `recallEnhanced()`)** | **95.60%** | [benchmarks/longmemeval/RESULTS.md](benchmarks/longmemeval/RESULTS.md) |
|
|
342
|
+
| MemPalace | 96.6% | 廠商自行回報 |
|
|
343
|
+
| Supermemory | ~82% | 廠商估計值 |
|
|
344
|
+
| Zep | 63.8% | LongMemEval 論文 |
|
|
345
|
+
| Mem0 | 49.0% | LongMemEval 論文 |
|
|
346
|
+
|
|
347
|
+
重現指令、資料集 SHA256、原始逐題結果與已知失敗分析全部都在 [`benchmarks/longmemeval/`](benchmarks/longmemeval/)。約 10 秒可重跑一次。
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
262
351
|
## Claude Code 自動進行的事情
|
|
263
352
|
|
|
264
353
|
你不需要手動記住所有事情。MeMesh 有 **6 個 hooks**,會在你工作時自動擷取與注入知識:
|
|
@@ -385,7 +474,7 @@ memesh config set embedder.model text-embedding-3-small
|
|
|
385
474
|
|
|
386
475
|
---
|
|
387
476
|
|
|
388
|
-
## 全部
|
|
477
|
+
## 全部 9 個記憶工具
|
|
389
478
|
|
|
390
479
|
| 工具 | 做什麼 |
|
|
391
480
|
|------|--------|
|
|
@@ -395,6 +484,8 @@ memesh config set embedder.model text-embedding-3-small
|
|
|
395
484
|
| `export` | 在專案或團隊成員之間以 JSON 共享記憶 |
|
|
396
485
|
| `import` | 匯入記憶,包含合併策略(跳過 / 覆寫 / 追加) |
|
|
397
486
|
| `learn` | 記錄來自錯誤的結構化教訓(錯誤、根本原因、修復、預防) |
|
|
487
|
+
| `task_state` | 讀取或記下工作進度——目標、下一步、卡住的地方、剛完成的事 |
|
|
488
|
+
| `briefing` | 組合好的工作拓撲——Claude Code 在 session 開始拿到的那個區塊,任何 MCP client 都拿得到 |
|
|
398
489
|
| `user_patterns` | 分析你的工作模式——時間表、工具、優勢、學習領域 |
|
|
399
490
|
|
|
400
491
|
---
|
|
@@ -426,18 +517,22 @@ Claude Code 的 plugin marketplace 在安裝時把版本釘住,**不會**自
|
|
|
426
517
|
|
|
427
518
|
**方法 A — `/plugin` 介面**:先 uninstall `memesh@pcircle-memesh`,再重新安裝。Claude Code 會抓 marketplace 最新版。
|
|
428
519
|
|
|
429
|
-
**方法 B — 一行指令**(不用點 UI
|
|
520
|
+
**方法 B — 一行指令**(不用點 UI、可重複執行;需要 npm CLI,`npm install -g @pcircle/memesh`):
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
memesh upgrade-plugin
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
它會自己找到已安裝的 plugin 版本、確認前置工具都在,再幫你執行內建的升級腳本。前置工具:PATH 上要有 `node`、`npm`、`rsync`(macOS 內建 rsync;Debian/Ubuntu:`sudo apt install rsync`)。
|
|
527
|
+
|
|
528
|
+
只裝了 plugin、沒裝 npm CLI 的人,仍然可以手動執行腳本 — 把路徑裡的版本換成你安裝的版本:
|
|
430
529
|
|
|
431
530
|
```bash
|
|
432
|
-
# 如果 plugin 已經是 v4.2.5 或更新,腳本已經內建:
|
|
433
531
|
bash ~/.claude/plugins/cache/pcircle-memesh/memesh/<current-version>/scripts/upgrade-plugin.sh
|
|
434
532
|
|
|
435
|
-
#
|
|
436
|
-
#
|
|
533
|
+
# v4.2.5 之前的安裝還沒內建這個腳本,改用 npm-global 的副本
|
|
534
|
+
# (參考上面「安裝路徑一覽」):
|
|
437
535
|
bash "$(npm prefix -g)/lib/node_modules/@pcircle/memesh/scripts/upgrade-plugin.sh"
|
|
438
|
-
|
|
439
|
-
# (這假設你也跑過 `npm install -g @pcircle/memesh`。如果還沒,
|
|
440
|
-
# 現在正好可以一起裝 — 參考上面「安裝路徑一覽」說明為什麼大部分人兩條路徑都裝。)
|
|
441
536
|
```
|
|
442
537
|
|
|
443
538
|
腳本會 fast-forward marketplace cache、把新版本放進 `~/.claude/plugins/cache/`、安裝 runtime deps,然後把 `installed_plugins.json` 重指向新版本。執行完請重啟 Claude Code 讓 MCP server 重連。
|
|
@@ -451,8 +546,8 @@ Session 開始時,有新版本可下載時會跳一行 banner(每版本每 2
|
|
|
451
546
|
## 貢獻
|
|
452
547
|
|
|
453
548
|
```bash
|
|
454
|
-
git clone https://github.com/PCIRCLE-AI/memesh
|
|
455
|
-
cd memesh
|
|
549
|
+
git clone https://github.com/PCIRCLE-AI/memesh
|
|
550
|
+
cd memesh && npm install && npm run build
|
|
456
551
|
npm test # 630 項測試
|
|
457
552
|
npm run test:e2e-dashboard
|
|
458
553
|
```
|