@pcircle/memesh 4.8.3 → 4.9.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 +1 -1
- package/.claude-plugin/plugin.json +2 -1
- package/.codex-plugin/mcp.json +6 -4
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +68 -17
- package/README.de.md +83 -555
- package/README.md +83 -581
- package/README.zh-TW.md +84 -572
- package/dashboard/dist/index.html +10 -10
- package/dist/cli/view-live.d.ts.map +1 -1
- package/dist/cli/view-live.js +154 -384
- package/dist/cli/view-live.js.map +1 -1
- package/dist/core/agent-message-inbox.d.ts +2 -1
- package/dist/core/agent-message-inbox.d.ts.map +1 -1
- package/dist/core/agent-message-inbox.js +23 -4
- package/dist/core/agent-message-inbox.js.map +1 -1
- package/dist/core/agent-messaging.d.ts.map +1 -1
- package/dist/core/agent-messaging.js +23 -15
- package/dist/core/agent-messaging.js.map +1 -1
- package/dist/core/agent-router.d.ts +11 -10
- package/dist/core/agent-router.d.ts.map +1 -1
- package/dist/core/agent-router.js +29 -14
- package/dist/core/agent-router.js.map +1 -1
- package/dist/core/agent-scope-id.d.ts +11 -0
- package/dist/core/agent-scope-id.d.ts.map +1 -0
- package/dist/core/agent-scope-id.js +40 -0
- package/dist/core/agent-scope-id.js.map +1 -0
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/analytics.js.map +1 -1
- package/dist/core/briefing.d.ts.map +1 -1
- package/dist/core/briefing.js +8 -2
- package/dist/core/briefing.js.map +1 -1
- package/dist/core/config.d.ts +4 -40
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +75 -141
- package/dist/core/config.js.map +1 -1
- package/dist/core/demo.d.ts.map +1 -1
- package/dist/core/demo.js +6 -6
- package/dist/core/demo.js.map +1 -1
- package/dist/core/doctor.d.ts +2 -6
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +120 -154
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/dreamer.d.ts +32 -47
- package/dist/core/dreamer.d.ts.map +1 -1
- package/dist/core/dreamer.js +214 -704
- package/dist/core/dreamer.js.map +1 -1
- package/dist/core/install-channel.d.ts.map +1 -1
- package/dist/core/install-channel.js +4 -47
- package/dist/core/install-channel.js.map +1 -1
- package/dist/core/install-id.d.ts.map +1 -1
- package/dist/core/install-id.js.map +1 -1
- package/dist/core/kg-backfill.d.ts.map +1 -1
- package/dist/core/kg-backfill.js.map +1 -1
- package/dist/core/lesson-engine.d.ts +0 -5
- package/dist/core/lesson-engine.d.ts.map +1 -1
- package/dist/core/lesson-engine.js +0 -25
- package/dist/core/lesson-engine.js.map +1 -1
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +58 -49
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/memory-tool.d.ts.map +1 -1
- package/dist/core/memory-tool.js +20 -18
- package/dist/core/memory-tool.js.map +1 -1
- package/dist/core/operations.d.ts +3 -27
- package/dist/core/operations.d.ts.map +1 -1
- package/dist/core/operations.js +10 -245
- package/dist/core/operations.js.map +1 -1
- package/dist/core/paths.d.ts +4 -1
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +88 -14
- package/dist/core/paths.js.map +1 -1
- package/dist/core/product-improvements.js +2 -2
- package/dist/core/product-improvements.js.map +1 -1
- package/dist/core/project-tags.d.ts +2 -0
- package/dist/core/project-tags.d.ts.map +1 -1
- package/dist/core/project-tags.js +29 -1
- package/dist/core/project-tags.js.map +1 -1
- package/dist/core/schema-export.d.ts.map +1 -1
- package/dist/core/schema-export.js +13 -3
- package/dist/core/schema-export.js.map +1 -1
- package/dist/core/semver.d.ts +7 -0
- package/dist/core/semver.d.ts.map +1 -0
- package/dist/core/semver.js +49 -0
- package/dist/core/semver.js.map +1 -0
- package/dist/core/serializer.d.ts.map +1 -1
- package/dist/core/serializer.js +69 -57
- package/dist/core/serializer.js.map +1 -1
- package/dist/core/signal-scorer.d.ts.map +1 -1
- package/dist/core/signal-scorer.js.map +1 -1
- package/dist/core/transcript-extractor.d.ts +1 -85
- package/dist/core/transcript-extractor.d.ts.map +1 -1
- package/dist/core/transcript-extractor.js +5 -364
- package/dist/core/transcript-extractor.js.map +1 -1
- package/dist/core/transcript-source.d.ts +22 -6
- package/dist/core/transcript-source.d.ts.map +1 -1
- package/dist/core/transcript-source.js +108 -69
- package/dist/core/transcript-source.js.map +1 -1
- package/dist/core/types.d.ts +1 -17
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/version-check.d.ts +1 -0
- package/dist/core/version-check.d.ts.map +1 -1
- package/dist/core/version-check.js +46 -1
- package/dist/core/version-check.js.map +1 -1
- package/dist/db.d.ts +0 -34
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +6 -287
- package/dist/db.js.map +1 -1
- package/dist/host-runtime/acp.d.ts.map +1 -1
- package/dist/host-runtime/acp.js +4 -3
- package/dist/host-runtime/acp.js.map +1 -1
- package/dist/host-runtime/claude.d.ts.map +1 -1
- package/dist/host-runtime/claude.js +11 -11
- package/dist/host-runtime/claude.js.map +1 -1
- package/dist/host-runtime/codex-session.d.ts +9 -1
- package/dist/host-runtime/codex-session.d.ts.map +1 -1
- package/dist/host-runtime/codex-session.js +474 -29
- package/dist/host-runtime/codex-session.js.map +1 -1
- package/dist/host-runtime/codex.d.ts.map +1 -1
- package/dist/host-runtime/codex.js +4 -3
- package/dist/host-runtime/codex.js.map +1 -1
- package/dist/host-runtime/config.d.ts +1 -0
- package/dist/host-runtime/config.d.ts.map +1 -1
- package/dist/host-runtime/config.js +4 -0
- package/dist/host-runtime/config.js.map +1 -1
- package/dist/host-runtime/entry.d.ts +5 -0
- package/dist/host-runtime/entry.d.ts.map +1 -0
- package/dist/host-runtime/entry.js +11 -0
- package/dist/host-runtime/entry.js.map +1 -0
- package/dist/host-runtime/router-client.d.ts.map +1 -1
- package/dist/host-runtime/router-client.js +62 -15
- package/dist/host-runtime/router-client.js.map +1 -1
- package/dist/host-runtime/router.js +2 -2
- package/dist/host-runtime/router.js.map +1 -1
- package/dist/knowledge-graph.d.ts +0 -1
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +77 -60
- package/dist/knowledge-graph.js.map +1 -1
- package/dist/mcp/THIRD_PARTY_NOTICES.txt +217 -0
- package/dist/mcp/server.js +30685 -38
- package/dist/mcp/server.js.map +6 -1
- package/dist/skills-manifest.json +39 -34
- package/dist/storage/entity-index.d.ts +3 -0
- package/dist/storage/entity-index.d.ts.map +1 -0
- package/dist/storage/entity-index.js +8 -0
- package/dist/storage/entity-index.js.map +1 -0
- package/dist/storage/fts-index.d.ts.map +1 -1
- package/dist/storage/fts-index.js +11 -7
- package/dist/storage/fts-index.js.map +1 -1
- package/dist/storage/graph-repairs.d.ts +7 -2
- package/dist/storage/graph-repairs.d.ts.map +1 -1
- package/dist/storage/graph-repairs.js +89 -13
- package/dist/storage/graph-repairs.js.map +1 -1
- package/dist/storage/schema.d.ts +1 -1
- package/dist/storage/schema.d.ts.map +1 -1
- package/dist/storage/schema.js +1 -2
- package/dist/storage/schema.js.map +1 -1
- package/dist/storage/sqlite.d.ts +0 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/transports/agent-messaging.d.ts.map +1 -1
- package/dist/transports/agent-messaging.js +5 -7
- package/dist/transports/agent-messaging.js.map +1 -1
- package/dist/transports/cli/cli.d.ts.map +1 -1
- package/dist/transports/cli/cli.js +75 -686
- package/dist/transports/cli/cli.js.map +1 -1
- package/dist/transports/http/retired-routes.js +1 -1
- package/dist/transports/http/retired-routes.js.map +1 -1
- package/dist/transports/http/server.d.ts.map +1 -1
- package/dist/transports/http/server.js +13 -232
- package/dist/transports/http/server.js.map +1 -1
- package/dist/transports/mcp/handlers.d.ts +130 -4
- package/dist/transports/mcp/handlers.d.ts.map +1 -1
- package/dist/transports/mcp/handlers.js +56 -7
- package/dist/transports/mcp/handlers.js.map +1 -1
- package/dist/transports/schemas.d.ts +71 -19
- package/dist/transports/schemas.d.ts.map +1 -1
- package/dist/transports/schemas.js +57 -11
- package/dist/transports/schemas.js.map +1 -1
- package/docs/platforms/README.md +6 -5
- package/docs/platforms/agent-messaging.md +241 -20
- package/hooks/hooks.json +23 -2
- package/llms-install.md +62 -30
- package/package.json +12 -9
- package/scripts/hooks/_generated/agent-message-inbox.js +23 -4
- package/scripts/hooks/_generated/core-paths.js +88 -14
- package/scripts/hooks/_generated/fts-index.js +11 -7
- package/scripts/hooks/_generated/schema.js +1 -2
- package/scripts/hooks/_shared.js +65 -23
- package/scripts/hooks/decision-nudge.js +152 -0
- package/scripts/hooks/post-commit.js +11 -0
- package/scripts/hooks/pre-compact.js +12 -4
- package/scripts/hooks/session-start.js +32 -9
- package/scripts/hooks/session-summary.js +19 -374
- package/scripts/upgrade-plugin.sh +71 -2
- package/skills/memesh/SKILL.md +24 -15
- package/skills/memesh-review/SKILL.md +7 -6
- package/dist/core/auto-tagger.d.ts +0 -10
- package/dist/core/auto-tagger.d.ts.map +0 -1
- package/dist/core/auto-tagger.js +0 -63
- package/dist/core/auto-tagger.js.map +0 -1
- package/dist/core/conflict-candidates.d.ts +0 -20
- package/dist/core/conflict-candidates.d.ts.map +0 -1
- package/dist/core/conflict-candidates.js +0 -71
- package/dist/core/conflict-candidates.js.map +0 -1
- package/dist/core/conflict-judge.d.ts +0 -58
- package/dist/core/conflict-judge.d.ts.map +0 -1
- package/dist/core/conflict-judge.js +0 -189
- package/dist/core/conflict-judge.js.map +0 -1
- package/dist/core/digest-validator.d.ts +0 -18
- package/dist/core/digest-validator.d.ts.map +0 -1
- package/dist/core/digest-validator.js +0 -85
- package/dist/core/digest-validator.js.map +0 -1
- package/dist/core/embedder.d.ts +0 -20
- package/dist/core/embedder.d.ts.map +0 -1
- package/dist/core/embedder.js +0 -242
- package/dist/core/embedder.js.map +0 -1
- package/dist/core/failure-analyzer.d.ts +0 -19
- package/dist/core/failure-analyzer.d.ts.map +0 -1
- package/dist/core/failure-analyzer.js +0 -83
- package/dist/core/failure-analyzer.js.map +0 -1
- package/dist/core/json-utils.d.ts +0 -3
- package/dist/core/json-utils.d.ts.map +0 -1
- package/dist/core/json-utils.js +0 -46
- package/dist/core/json-utils.js.map +0 -1
- package/dist/core/llm-client.d.ts +0 -22
- package/dist/core/llm-client.d.ts.map +0 -1
- package/dist/core/llm-client.js +0 -203
- package/dist/core/llm-client.js.map +0 -1
- package/dist/core/llm-telemetry.d.ts +0 -47
- package/dist/core/llm-telemetry.d.ts.map +0 -1
- package/dist/core/llm-telemetry.js +0 -117
- package/dist/core/llm-telemetry.js.map +0 -1
- package/dist/core/llm-validator.d.ts +0 -20
- package/dist/core/llm-validator.d.ts.map +0 -1
- package/dist/core/llm-validator.js +0 -231
- package/dist/core/llm-validator.js.map +0 -1
- package/dist/core/ollama-host.d.ts +0 -6
- package/dist/core/ollama-host.d.ts.map +0 -1
- package/dist/core/ollama-host.js +0 -30
- package/dist/core/ollama-host.js.map +0 -1
- package/dist/core/output-language.d.ts +0 -6
- package/dist/core/output-language.d.ts.map +0 -1
- package/dist/core/output-language.js +0 -25
- package/dist/core/output-language.js.map +0 -1
- package/dist/core/prompt-safety.d.ts +0 -4
- package/dist/core/prompt-safety.d.ts.map +0 -1
- package/dist/core/prompt-safety.js +0 -20
- package/dist/core/prompt-safety.js.map +0 -1
- package/dist/storage/vector-index.d.ts +0 -3
- package/dist/storage/vector-index.d.ts.map +0 -1
- package/dist/storage/vector-index.js +0 -13
- package/dist/storage/vector-index.js.map +0 -1
- /package/{.mcp.json → .claude-plugin/mcp.json} +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<h1 align="center">MeMesh</h1>
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>
|
|
6
|
+
<strong>A memory for your AI coding agent that survives between sessions.</strong><br />
|
|
7
7
|
One SQLite file. No Docker. No cloud required.
|
|
8
8
|
</p>
|
|
9
9
|
<p align="center">
|
|
@@ -16,566 +16,131 @@
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## What it does
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Each session, your AI coding agent starts from zero. It proposes the approach you rejected last month, trips over the same failing test, and asks you to explain the architecture it helped design.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- `message discover` gives agents a bounded, project-scoped live directory with session, principal, host kind, declared model/work (or explicit unknown), and active leases; it performs no message or receipt operation.
|
|
25
|
-
- `improvement` turns active memories into evidence-linked product-work proposals that agents can stage, but only a human can accept or reject.
|
|
23
|
+
MeMesh remembers for it. Claude Code hooks capture and restore routine context; supported clients share the same local SQLite database through their documented integration. It works with Claude Code, Codex, Cursor and other MCP clients.
|
|
26
24
|
|
|
27
|
-
## Install
|
|
28
|
-
|
|
29
|
-
**In Claude Code** — type these in the chat (hooks, memory tools and the `/memesh` skill are wired automatically):
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
/plugin marketplace add PCIRCLE-AI/memesh
|
|
33
|
-
/plugin install memesh@pcircle-memesh
|
|
34
25
|
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
you work with the agent
|
|
27
|
+
|
|
|
28
|
+
v
|
|
29
|
+
+------------------+ +------------------+
|
|
30
|
+
| capture | | recall |
|
|
31
|
+
| sessions, | ---> | at session |
|
|
32
|
+
| commits, fixes | | start and |
|
|
33
|
+
| (automatic) | | before edits |
|
|
34
|
+
+------------------+ +------------------+
|
|
35
|
+
| ^
|
|
36
|
+
v |
|
|
37
|
+
+----------------------------------------+
|
|
38
|
+
| ~/.memesh/knowledge-graph.db |
|
|
39
|
+
| decisions, lessons, links between them |
|
|
40
|
+
+----------------------------------------+
|
|
43
41
|
```
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## The Problem
|
|
50
|
-
|
|
51
|
-
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.
|
|
52
|
-
|
|
53
|
-
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.
|
|
54
|
-
|
|
55
|
-
**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.
|
|
56
|
-
|
|
57
|
-
> [!IMPORTANT]
|
|
58
|
-
> Actively developed — features may change between releases. [Open an issue](https://github.com/PCIRCLE-AI/memesh/issues) for bugs or feature requests.
|
|
43
|
+
- **Capture, recall, reminders, and safeguards at the right time.** MeMesh ships **9 hooks** (nine hook commands) across its Claude Code and Codex integrations: eight Claude Code hooks run at session start, before file edits, after `git commit`, after a plan is approved or a question answered, when Claude stops, before context compaction, when you say "remember this" (5 languages), and before a risky command that repeats an accepted lesson. The plan/question and "remember this" hooks only remind the agent to call `remember`; the ninth command handles both Codex SessionStart and SessionEnd to register and retire an eligible ordinary Codex CLI session.
|
|
44
|
+
- **One memory for all your tools.** A decision stored from Claude Code is available to Codex or Cursor the next day.
|
|
45
|
+
- **Agents can leave each other messages.** A durable inbox survives restarts; on macOS or Linux, an ordinary Codex CLI thread with the MeMesh plugin can keep a bounded post-turn native queue window and consume the accepted message when that same thread resumes.
|
|
46
|
+
- **A dashboard** to browse it all: 5 tabs, 11 languages, at `http://localhost:3737/dashboard`.
|
|
59
47
|
|
|
60
48
|
---
|
|
61
49
|
|
|
62
|
-
##
|
|
63
|
-
|
|
64
|
-
MeMesh has a real cross-agent advantage: every host connected to the same local MeMesh instance can share durable memory, while the `message` tool provides an explicit exact-recipient messaging path over MCP, HTTP, and CLI.
|
|
65
|
-
|
|
66
|
-
The optional secure host-native wakeup runtime currently supports macOS and Linux. Core MeMesh memory, durable message storage, and MCP tools remain available on Windows; Windows host-native wakeup is not yet supported.
|
|
67
|
-
|
|
68
|
-
- Works today: an MCP, HTTP, or CLI sender can durably send one untrusted JSON-encoded payload of at most 65,536 UTF-8 bytes (64 KiB) to one named local recipient. A receiver can fetch it separately, resume from an opaque cursor after restart, and record intake, acknowledgement, workflow disposition, and host activation as separate facts.
|
|
69
|
-
- With the MeMesh Codex plugin enabled and the owner-private `memesh agent setup codex-session` opt-in, an exact active Codex session receives one bounded full message through its native queue without polling or a human reminder, and without a second inbox fetch. The complete native envelope, including routing metadata and payload, is capped separately at 16,384 bytes (16 KiB). An exact-session send returns success only after that native queue accepts it; an oversized full envelope reports `native_message_too_large`, while other unavailable or rejected sessions report `recipient_unavailable`. Scoped recovery data remains durable. Principal targets retain durable store-and-forward behavior.
|
|
70
|
-
- A successful native admission (`host_accept`) means only that the local Codex queue accepted the bounded message. It does not mean an agent read it, acknowledged it, or accepted the work. Codex currently exposes message text only through its `--message` argument, so same-user process inspection may observe it while the queue command runs; keep native messages free of secrets.
|
|
71
|
-
- Durable message storage is bounded by owner policy, not silent deletion: `memesh message storage report` exposes logical payload, protected rows, reusable SQLite pages, and WAL size; bounded prune is dry-run by default and only tombstones old terminal payloads. An optional `MEMESH_AGENT_MESSAGE_STORAGE_QUOTA_BYTES` rejects a send atomically. See [bounded storage and audit retention](docs/platforms/agent-messaging.md#bounded-storage-and-audit-retention).
|
|
72
|
-
- A stopped, missing, or disconnected Codex session is not awakened or replaced. Its durable inbox remains available for audit and recovery; `poll` and `memesh message watch` are compatibility and diagnostic paths. Native delivery never resumes a stopped model session, executes a payload, or implies acknowledgement.
|
|
73
|
-
- Cooperative trust boundary: the recipient name is a logical routing ID, not a per-agent login or ACL. Every caller with access to the same local MeMesh instance must be treated as a trusted workspace participant; host adapters still enforce their own permissions and human-approval rules.
|
|
74
|
-
- Adapter boundary: the native wakeup described here is the configured local Codex-session path. Other local MCP loops can use the durable message operations their own host loop supports; this is not a universal host-support claim.
|
|
50
|
+
## Works with
|
|
75
51
|
|
|
76
|
-
|
|
52
|
+
| Platform | How | Notes |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| Claude Code | Plugin: hooks, MCP tools, `/memesh` skill | Full automatic capture and recall |
|
|
55
|
+
| Codex CLI | Plugin, or MCP server (`memesh-mcp`) | Zero-config plugin install, or `codex mcp add memesh -- memesh-mcp` |
|
|
56
|
+
| Gemini CLI | MCP server (`memesh-mcp`) | `gemini mcp add -s user memesh memesh-mcp` |
|
|
57
|
+
| Cursor, Cline and other MCP clients | MCP server (`memesh-mcp`) | Point the client at `memesh-mcp` |
|
|
58
|
+
| Hermes Agent | Native memory-provider plugin | [docs/platforms/hermes-agent.md](docs/platforms/hermes-agent.md) |
|
|
59
|
+
| OpenClaw | Native memory plugin | Source only; not published or live-tested: [docs/platforms/openclaw.md](docs/platforms/openclaw.md) |
|
|
60
|
+
| Your own scripts and apps | HTTP API from `memesh serve` | [docs/platforms/universal.md](docs/platforms/universal.md) |
|
|
61
|
+
| ChatGPT, Gemini web and other hosted chat | HTTP API through a local bridge you run | [docs/platforms/README.md](docs/platforms/README.md) |
|
|
77
62
|
|
|
78
|
-
|
|
63
|
+
Claude Code's eight hooks provide automatic capture, recall, reminders, and safeguards. The Codex plugin wires its SessionStart integration and MCP tools automatically. MCP-only clients call `recall` and `briefing` themselves.
|
|
79
64
|
|
|
80
|
-
|
|
65
|
+
Recall and capture are local and deterministic: SQLite FTS5 search, explicit memory tools, and rule-based hooks. This version does not configure or call an LLM, embedding, or vector provider. Retired provider settings from older versions stay on disk but are ignored; `memesh doctor` names the top-level keys without reading or printing their values.
|
|
81
66
|
|
|
82
67
|
---
|
|
83
68
|
|
|
84
|
-
## Install
|
|
85
|
-
|
|
86
|
-
MeMesh has **two install paths that coexist**. Most users want both. They write to the **same memory database** (`~/.memesh/knowledge-graph.db`), so memories captured in Claude Code chat appear in your shell, and vice versa.
|
|
87
|
-
|
|
88
|
-
```mermaid
|
|
89
|
-
flowchart TB
|
|
90
|
-
classDef client fill:#1f2937,stroke:#4b5563,color:#f9fafb,stroke-width:1px
|
|
91
|
-
classDef pathA fill:#1e3a8a,stroke:#3b82f6,color:#eff6ff,stroke-width:2px
|
|
92
|
-
classDef pathB fill:#14532d,stroke:#22c55e,color:#f0fdf4,stroke-width:2px
|
|
93
|
-
classDef db fill:#7c2d12,stroke:#f97316,color:#fff7ed,stroke-width:2px
|
|
94
|
-
|
|
95
|
-
subgraph clients["Where you use memesh from"]
|
|
96
|
-
direction LR
|
|
97
|
-
CC["Claude Code<br/>(chat + agent)"]:::client
|
|
98
|
-
TERM["Terminal / other<br/>MCP clients<br/>(Codex, Cursor...)"]:::client
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
subgraph paths["Two install paths"]
|
|
102
|
-
direction LR
|
|
103
|
-
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
|
|
104
|
-
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
|
|
105
|
-
end
|
|
69
|
+
## Install
|
|
106
70
|
|
|
107
|
-
|
|
71
|
+
Plugin installs and the npm-global CLI share one database. Most Claude Code users want its plugin plus the CLI; Codex can use its own plugin or the CLI's MCP server.
|
|
108
72
|
|
|
109
|
-
CC -->|uses| A
|
|
110
|
-
TERM -->|uses| B
|
|
111
|
-
A --> DB
|
|
112
|
-
B --> DB
|
|
113
73
|
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
123
|
-
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
This is the most common confusion. Read this once and you'll save yourself the loop:
|
|
129
|
-
|
|
130
|
-
- `/plugin install memesh@pcircle-memesh` from inside Claude Code → installs **Path A only**. Gives you MCP tools, hooks, the `/memesh` skill. Does **NOT** put `memesh` on your shell `PATH`.
|
|
131
|
-
- `memesh reindex` / `memesh update` / `memesh doctor` typed in a normal terminal → needs **Path B** (npm-global). Without it: `zsh: command not found: memesh`.
|
|
132
|
-
- **Recommended setup for Claude Code users**: install **both**. They coexist, share the same database, never conflict.
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# After /plugin install ..., also run this:
|
|
136
|
-
npm install -g @pcircle/memesh
|
|
74
|
+
Claude Code chat Terminal, Codex, Cursor
|
|
75
|
+
| |
|
|
76
|
+
v v
|
|
77
|
+
+-----------------+ +------------------+
|
|
78
|
+
| A: plugin | | B: npm global |
|
|
79
|
+
| /plugin install | | npm install -g |
|
|
80
|
+
| hooks + tools | | memesh CLI |
|
|
81
|
+
| + /memesh skill | | + memesh-mcp |
|
|
82
|
+
+-----------------+ +------------------+
|
|
83
|
+
| |
|
|
84
|
+
+---------------+------------------+
|
|
85
|
+
v
|
|
86
|
+
~/.memesh/knowledge-graph.db
|
|
87
|
+
(one file, both paths)
|
|
137
88
|
```
|
|
138
89
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Get Started in 60 Seconds
|
|
144
|
-
|
|
145
|
-
### Option A — Claude Code plugin (one-line install)
|
|
146
|
-
|
|
147
|
-
If you use Claude Code, install MeMesh as a plugin from inside the CLI:
|
|
90
|
+
**A. Inside Claude Code** (hooks, tools and the `/memesh` skill are wired for you):
|
|
148
91
|
|
|
149
92
|
```
|
|
150
93
|
/plugin marketplace add PCIRCLE-AI/memesh
|
|
151
94
|
/plugin install memesh@pcircle-memesh
|
|
152
95
|
```
|
|
153
96
|
|
|
154
|
-
Claude Code
|
|
155
|
-
|
|
156
|
-
**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 — this directly verifies SessionStart hook output. It does not by itself prove later capture or recall behavior. (Once you have memories, it shows counts instead.)
|
|
157
|
-
|
|
158
|
-
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.
|
|
159
|
-
|
|
160
|
-
> **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.
|
|
97
|
+
Restart Claude Code. A `◉ MeMesh` line appears at the top of the next session.
|
|
161
98
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
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, Cursor, Cline, terminal-only flows):
|
|
99
|
+
**B. In a terminal** (needs [Node 22.13+](https://nodejs.org)):
|
|
165
100
|
|
|
166
101
|
```bash
|
|
167
102
|
npm install -g @pcircle/memesh
|
|
103
|
+
memesh doctor # checks local install health and prints fixes
|
|
104
|
+
memesh install-hooks # only if you skipped A: wires Claude Code, keeps your own hooks
|
|
168
105
|
```
|
|
169
106
|
|
|
170
|
-
|
|
171
|
-
> - **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.
|
|
172
|
-
> - **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.
|
|
173
|
-
|
|
174
|
-
### Step 1.5: Wire MeMesh into Claude Code (npm path only)
|
|
107
|
+
For a zero-config Codex install, run `codex plugin marketplace add PCIRCLE-AI/memesh` and `codex plugin add memesh@pcircle-memesh`. The manual alternative is `codex mcp add memesh -- memesh-mcp`. For Cursor, add `{ "mcpServers": { "memesh": { "command": "memesh-mcp" } } }` to `~/.cursor/mcp.json`.
|
|
175
108
|
|
|
176
|
-
|
|
109
|
+
> **The plugin does not install the CLI.** After `/plugin install`, typing `memesh` in a terminal says `command not found` until you also run `npm install -g @pcircle/memesh`. If you only use Claude Code chat, A alone is enough.
|
|
177
110
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
memesh setup # checks local host wiring and reports what it finds
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Or the individual steps by hand:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
memesh install-hooks # adds memesh's hooks to ~/.claude/settings.json
|
|
188
|
-
memesh setup --check # machine-level verification: reads the hosts' own config, changes nothing
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
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`.
|
|
192
|
-
|
|
193
|
-
### Same memory from Codex CLI, Cursor, and other MCP clients
|
|
194
|
-
|
|
195
|
-
`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:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# OpenAI Codex CLI — writes [mcp_servers.memesh] into ~/.codex/config.toml
|
|
199
|
-
codex mcp add memesh -- memesh-mcp
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
For Cursor, add the same stdio server to `~/.cursor/mcp.json` (global) or
|
|
204
|
-
`.cursor/mcp.json` (project-local):
|
|
205
|
-
|
|
206
|
-
```json
|
|
207
|
-
{
|
|
208
|
-
"mcpServers": {
|
|
209
|
-
"memesh": { "command": "memesh-mcp" }
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
Every configured local host reads and writes the same `~/.memesh/knowledge-graph.db`, so a memory stored from one agent is recallable from Codex, Cursor, or another MCP client. Verify from the host by asking it to call the `recall` tool, or from a terminal:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
codex mcp list # memesh should be listed as enabled
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
> **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.
|
|
221
|
-
|
|
222
|
-
### Native integration: Hermes Agent
|
|
223
|
-
|
|
224
|
-
**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.
|
|
225
|
-
|
|
226
|
-
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)**
|
|
227
|
-
|
|
228
|
-
### Native integration: OpenClaw
|
|
229
|
-
|
|
230
|
-
**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.
|
|
231
|
-
|
|
232
|
-
**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)**
|
|
233
|
-
|
|
234
|
-
Current status: the source plugin is present under `extensions/memory-memesh/`, but it is not published or verified against a live OpenClaw runtime.
|
|
235
|
-
|
|
236
|
-
### Step 2: Store a decision
|
|
237
|
-
|
|
238
|
-
> 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.
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
memesh remember "Use OAuth 2.0 with PKCE for the new auth"
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
Or use the explicit form when you want a stable name and type for later filtering:
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
memesh remember --name "auth-decision" --type "decision" --obs "Use OAuth 2.0 with PKCE"
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Step 3: Recall it later
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
memesh recall "login security"
|
|
254
|
-
# → Finds "OAuth 2.0 with PKCE" even though you searched different words
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**That's it.** MeMesh is now remembering and recalling across sessions.
|
|
258
|
-
|
|
259
|
-
If you want to verify the install and local wiring end to end:
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
memesh doctor
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
Open the dashboard to explore your memory:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
memesh serve
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
<p align="center">
|
|
272
|
-
<img src="docs/images/dashboard-search.png" alt="MeMesh — find any memory instantly" width="100%" />
|
|
273
|
-
</p>
|
|
274
|
-
|
|
275
|
-
<p align="center">
|
|
276
|
-
<img src="docs/images/dashboard-analytics.png" alt="MeMesh analytics — health score, timeline, patterns, knowledge coverage" width="100%" />
|
|
277
|
-
</p>
|
|
278
|
-
|
|
279
|
-
<p align="center">
|
|
280
|
-
<img src="docs/images/dashboard-graph.png" alt="MeMesh Graph — interactive knowledge graph with type filters and ego mode" width="100%" />
|
|
281
|
-
</p>
|
|
282
|
-
|
|
283
|
-
### See what it remembered
|
|
284
|
-
|
|
285
|
-
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):
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
memesh briefing
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
```text
|
|
292
|
-
Where "your-project" was left off (today):
|
|
293
|
-
- Goal: Ship the payment retry logic
|
|
294
|
-
- Next: Open the PR once CI is green
|
|
295
|
-
|
|
296
|
-
Decisions and direction for "your-project":
|
|
297
|
-
- [decision] Use FTS5 as the retrieval baseline
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
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. Generic `briefing` and SessionStart context has no recipient identity, so it does not report unread messages. To check an inbox, supply the exact `project` and `recipient`; MeMesh reports only that recipient's unfetched deliveries and directs the caller to poll before fetching each message.
|
|
301
|
-
|
|
302
|
-
### Your data
|
|
303
|
-
|
|
304
|
-
- **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.
|
|
305
|
-
- **Back up = copy that one file.** Restore = copy it back.
|
|
306
|
-
- **Pause capture anytime**: `export MEMESH_AUTO_CAPTURE=false`.
|
|
307
|
-
- **Delete everything**: remove `~/.memesh/`.
|
|
111
|
+
**Update:** Claude Code plugin: `memesh upgrade-plugin` (or `npx @pcircle/memesh upgrade-plugin` without the CLI). Codex plugin: `codex plugin marketplace upgrade pcircle-memesh && codex plugin add memesh@pcircle-memesh`. npm-global CLI: `memesh update`. **Installing with an AI agent?** Point it at [llms-install.md](llms-install.md).
|
|
308
112
|
|
|
309
113
|
---
|
|
310
114
|
|
|
311
|
-
##
|
|
115
|
+
## Get started
|
|
312
116
|
|
|
313
|
-
| If you are... | MeMesh helps you... |
|
|
314
|
-
|---------------|---------------------|
|
|
315
|
-
| **A developer using Claude Code** | Auto-recall project decisions, file-specific lessons, and past failures as you work |
|
|
316
|
-
| **A coding-agent power user** | Share one local memory layer and a truthful local inbox pattern across MCP-compatible tools |
|
|
317
|
-
| **An individual using Codex, Cursor, Claude Code, or another MCP client** | Use one local memory layer across agents and sessions, and coordinate handoffs through the shared store |
|
|
318
|
-
| **A developer integrating an agent** | Add local memory through MCP, HTTP, or the CLI |
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Designed For Coding Agents First
|
|
323
|
-
|
|
324
|
-
<table>
|
|
325
|
-
<tr>
|
|
326
|
-
<td width="33%" align="center">
|
|
327
|
-
|
|
328
|
-
**Claude Code / Desktop**
|
|
329
117
|
```bash
|
|
330
|
-
memesh
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
</td>
|
|
335
|
-
<td width="33%" align="center">
|
|
118
|
+
memesh remember "Login uses OAuth 2.0 with PKCE"
|
|
119
|
+
memesh recall "login"
|
|
120
|
+
# -> finds the PKCE decision
|
|
336
121
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
curl localhost:3737/v1/recall \
|
|
340
|
-
-H "Content-Type: application/json" \
|
|
341
|
-
-d '{"query":"auth"}'
|
|
342
|
-
```
|
|
343
|
-
`memesh serve` (REST API)
|
|
344
|
-
|
|
345
|
-
</td>
|
|
346
|
-
<td width="33%" align="center">
|
|
347
|
-
|
|
348
|
-
**Any LLM (OpenAI format)**
|
|
349
|
-
```bash
|
|
350
|
-
memesh export-schema \
|
|
351
|
-
--format openai
|
|
352
|
-
```
|
|
353
|
-
Paste tools into any API call
|
|
354
|
-
|
|
355
|
-
</td>
|
|
356
|
-
</tr>
|
|
357
|
-
</table>
|
|
358
|
-
|
|
359
|
-
---
|
|
360
|
-
|
|
361
|
-
## Why Not OpenMemory, Cursor Memories, Mem0, Or Zep?
|
|
362
|
-
|
|
363
|
-
| | **MeMesh** | OpenMemory | Cursor Memories | Mem0 | Zep / Graphiti |
|
|
364
|
-
|---|---|---|---|---|---|
|
|
365
|
-
| **Best fit** | Local memory for coding agents | Local/cross-client MCP memory | Cursor-native project memory | Managed app/agent memory | Temporal knowledge graphs |
|
|
366
|
-
| **Install shape** | `npm install -g @pcircle/memesh` | Local app/server flow | Built into Cursor | Cloud API / SDK / MCP | Service/framework setup |
|
|
367
|
-
| **Storage** | One local SQLite file | Local memory stack | Cursor-managed rules/memories | Hosted or self-hosted stack | Graph database |
|
|
368
|
-
| **Cloud required** | No | No for local mode | Depends on Cursor account/settings | Yes for platform | Usually yes/self-hosted |
|
|
369
|
-
| **Claude Code hooks** | First-class | MCP tools | No | MCP tools | Not Claude Code-specific |
|
|
370
|
-
| **Dashboard** | Built in | Built in | Cursor settings | Platform dashboard | Platform/graph tooling |
|
|
371
|
-
| **Tradeoff** | Simple local wedge, not enterprise scale | Broader local app footprint | Locked to Cursor | Strong managed platform, less local-first | Strong graph model, heavier setup |
|
|
372
|
-
|
|
373
|
-
**MeMesh trades enterprise-scale managed infrastructure for instant local setup, inspectable storage, and coding-agent workflow hooks.**
|
|
374
|
-
|
|
375
|
-
---
|
|
376
|
-
|
|
377
|
-
## Benchmarks — 95.60% R@5 on LongMemEval-S
|
|
378
|
-
|
|
379
|
-
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):
|
|
380
|
-
|
|
381
|
-
| System | R@5 | Source |
|
|
382
|
-
|---|---|---|
|
|
383
|
-
| **MeMesh (Mode A, via `recallEnhanced()`)** | **95.60%** | [benchmarks/longmemeval/RESULTS.md](benchmarks/longmemeval/RESULTS.md) |
|
|
384
|
-
| MemPalace | 96.6% | Vendor self-report |
|
|
385
|
-
| Supermemory | ~82% | Vendor estimate |
|
|
386
|
-
| Zep | 63.8% | LongMemEval paper |
|
|
387
|
-
| Mem0 | 49.0% | LongMemEval paper |
|
|
388
|
-
|
|
389
|
-
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).
|
|
390
|
-
|
|
391
|
-
---
|
|
392
|
-
|
|
393
|
-
## What Happens Automatically In Claude Code
|
|
394
|
-
|
|
395
|
-
You don't need to manually remember everything. MeMesh has **8 hooks** that capture and inject knowledge while you work:
|
|
396
|
-
|
|
397
|
-
| When | What MeMesh does |
|
|
398
|
-
|------|------------------|
|
|
399
|
-
| **Every session start** | Loads your most relevant memories + proactive warnings from past lessons |
|
|
400
|
-
| **Before editing files** | Recalls memories tied to the file or project before Claude writes code |
|
|
401
|
-
| **When you ask to remember** | Detects "remember this" / "guardar en memesh" / "sauvegarder dans memesh" / "記下來" intent (5 languages) and reminds Claude to use memesh |
|
|
402
|
-
| **After every `git commit`** | Records what you changed, with diff stats |
|
|
403
|
-
| **When Claude stops** | Captures files edited, errors fixed, and auto-generates structured lessons from failures |
|
|
404
|
-
| **Before context compaction** | Saves knowledge before it's lost to context limits |
|
|
405
|
-
| **Before risky commands and edits** | Fires the lesson-guards you accepted — a warning at the exact moment a recorded mistake is about to repeat |
|
|
406
|
-
| **When an opted-in Codex session starts or resumes** | Registers that exact live thread for bounded full-message native delivery; other workspaces and stopped sessions are not attached |
|
|
407
|
-
|
|
408
|
-
> **Opt out anytime:** `export MEMESH_AUTO_CAPTURE=false`
|
|
409
|
-
|
|
410
|
-
---
|
|
411
|
-
|
|
412
|
-
## Configuration
|
|
413
|
-
|
|
414
|
-
All configuration is via environment variables. Defaults are local-only and zero-network — you don't need to set anything to get a working system.
|
|
415
|
-
|
|
416
|
-
| Variable | Default | What it does |
|
|
417
|
-
|---|---|---|
|
|
418
|
-
| `MEMESH_DB_PATH` | `~/.memesh/knowledge-graph.db` | Override the SQLite database location. |
|
|
419
|
-
| `MEMESH_AUTO_CAPTURE` | `true` | Disable the auto-capture hooks (`Stop`, `PreCompact`) entirely. |
|
|
420
|
-
| `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`. |
|
|
421
|
-
| `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). A maintainer deprecation warning never overrides `off`: update manually or choose a policy that permits the bump. |
|
|
422
|
-
| `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. |
|
|
423
|
-
| `OLLAMA_HOST` | `http://localhost:11434` | Override the Ollama endpoint when using a local Ollama provider. |
|
|
424
|
-
|
|
425
|
-
`memesh doctor` prints the resolved configuration so you can see what's active.
|
|
426
|
-
|
|
427
|
-
**Fallback LLM providers (Smart Mode).** In the dashboard **Settings → "Fallback providers"** you can set an ordered failover chain — memesh tries each provider in turn when your primary is down. Add a local [Ollama](https://ollama.com) fallback, or a cloud one (OpenAI / Anthropic, with an API key). Privacy tradeoff: when a cloud fallback is used, memory text — which can be private — is sent to that provider, so it matters if you run local-only for privacy.
|
|
428
|
-
|
|
429
|
-
When npm flags an installed version as deprecated (typically a security advisory), the next session-start prepends a strong `⚠️ MeMesh <ver> is DEPRECATED` banner and `memesh update-status` surfaces the same line until you upgrade. The check is cached at `~/.memesh/update-check.<version>.json` so a transient network failure can't dim the warning.
|
|
430
|
-
|
|
431
|
-
---
|
|
432
|
-
|
|
433
|
-
## Dashboard
|
|
434
|
-
|
|
435
|
-
5 tabs, 11 languages, zero external dependencies. Access at `http://localhost:3737/dashboard` when the server is running.
|
|
436
|
-
|
|
437
|
-
| Tab | What you see |
|
|
438
|
-
|-----|-------------|
|
|
439
|
-
| **Home** | What memesh did for you — dreamer insights lead: weekly recaps and pattern proposals with one-click accept/reject; the full analytics stack (Memory Health Score, 30-day timeline, PM velocity + KG connectivity, work patterns) folds into an on-demand expander |
|
|
440
|
-
| **Memories** | The whole library behind one surface — instant filter plus Enter for server-ranked search (full-text + vector), scope chips for the work layer (goals/decisions/lessons/plans) vs evidence vs all vs archived, a cluster composition bar, per-row expandable detail (lessons keep their structured error/root-cause/fix/prevention view), archive/restore inline |
|
|
441
|
-
| **Project** | One project's history — the roadmap view (phases, milestones, key lessons) behind a project selector |
|
|
442
|
-
| **Graph** | Interactive force-directed knowledge graph with type filters, search, ego mode, recency heatmap |
|
|
443
|
-
| **Settings** | LLM provider config, instant language selector |
|
|
444
|
-
|
|
445
|
-
---
|
|
446
|
-
|
|
447
|
-
## Smart Features
|
|
448
|
-
|
|
449
|
-
**🧠 Smart Search** — Search "login security" and find memories about "OAuth PKCE". MeMesh uses FTS5 + sqlite-vec on the hot path, LLM-free, and the vector supplement still reaches across related wording.
|
|
450
|
-
|
|
451
|
-
**🌏 Search in scripts that don't use spaces** — Chinese, Japanese, Korean, Thai, Lao, Khmer and half-width katakana are indexed as overlapping character pairs, so a memory written as 「資料庫遷移前一定要先備份」 is found by searching 「備份」 — not only by its exact full text. Text is normalised (NFC) on both the write and the query side, so memories typed on macOS or with a Korean or Vietnamese IME are found in either spelling.
|
|
452
|
-
|
|
453
|
-
**📊 Scored Ranking** — Results ranked by relevance (30%) + recency (25%) + frequency (18%) + confidence (17%) + recall impact (10%).
|
|
454
|
-
|
|
455
|
-
**🔄 Knowledge Evolution** — Decisions change. `forget` archives old memories (never deletes). `supersedes` relations link old → new. Your AI always sees the latest version.
|
|
456
|
-
|
|
457
|
-
**⚠️ 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.
|
|
458
|
-
|
|
459
|
-
**🕸️ 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.
|
|
460
|
-
|
|
461
|
-
**📦 Personal backup and migration** — `memesh export > memesh-backup.json` → copy it to another machine → `memesh import memesh-backup.json`
|
|
462
|
-
Imported bundles stay searchable, but MeMesh does not auto-inject imported memories into host context until you review or re-store them locally.
|
|
463
|
-
|
|
464
|
-
---
|
|
465
|
-
|
|
466
|
-
## Example Usage
|
|
467
|
-
|
|
468
|
-
> "MeMesh remembered that we chose PKCE over implicit flow three weeks ago. When I asked Claude about auth again, it already knew — no re-explaining needed."
|
|
469
|
-
> — **Solo developer, building a SaaS**
|
|
470
|
-
|
|
471
|
-
> "I stored a decision from Claude Code and recalled it from Codex the next day. The same local memory followed my work instead of one agent."
|
|
472
|
-
> — **Solo developer using multiple coding agents**
|
|
473
|
-
|
|
474
|
-
> "The dashboard showed me that 90% of my memories were auto-generated session logs. I started using `remember` deliberately for architecture decisions. Game changer."
|
|
475
|
-
> — **Developer who discovered the analytics panel**
|
|
476
|
-
|
|
477
|
-
---
|
|
478
|
-
|
|
479
|
-
## Recipes
|
|
480
|
-
|
|
481
|
-
### Catch a contradiction before it bites
|
|
482
|
-
|
|
483
|
-
Two decisions, made weeks apart, that cannot both be true — the failure mode
|
|
484
|
-
a memory layer exists to catch:
|
|
485
|
-
|
|
486
|
-
```bash
|
|
487
|
-
memesh remember --name retry-policy --type decision \
|
|
488
|
-
--obs "All HTTP clients retry failed requests up to 5 times with exponential backoff."
|
|
489
|
-
# ...weeks later, someone decides the opposite...
|
|
490
|
-
memesh remember --name retry-policy-v2 --type decision \
|
|
491
|
-
--obs "HTTP clients must never retry automatically — fail fast and surface the error."
|
|
492
|
-
|
|
493
|
-
memesh dream conflicts # the judge flags the pair, with its reasoning
|
|
494
|
-
memesh dream show 1 # read the verdict, the excerpts, what accepting creates
|
|
495
|
-
memesh dream accept 1 # YOU decide — nothing is ever linked automatically
|
|
496
|
-
memesh recall "retry policy" # → Warning: Conflicts detected
|
|
122
|
+
memesh briefing # what the agent knows about this project, where you left off
|
|
123
|
+
memesh serve # starts the local server and prints the dashboard URL
|
|
497
124
|
```
|
|
498
125
|
|
|
499
|
-
|
|
500
|
-
conflict — instead of confidently quoting whichever one it found first.
|
|
501
|
-
|
|
502
|
-
### One memory, three assistants
|
|
503
|
-
|
|
504
|
-
MeMesh is an MCP server, so the same SQLite file serves every MCP client on
|
|
505
|
-
the machine. Register it once per tool (exact commands in
|
|
506
|
-
[Get Started](#get-started-in-60-seconds)) and a decision recorded in Claude
|
|
507
|
-
Code is recalled by Codex or another configured local MCP client mid-session — no re-explaining, no
|
|
508
|
-
copy-pasting context between vendors.
|
|
509
|
-
|
|
510
|
-
### Record decisions so they stay findable
|
|
126
|
+
Keep `memesh serve` running and open the printed URL. In Claude Code you do not even need the terminal for memory tools: say "remember this" in chat, and the briefing arrives on its own at every session start.
|
|
511
127
|
|
|
512
|
-
|
|
513
|
-
deliberate ones:
|
|
128
|
+
Two things worth knowing once you have memories:
|
|
514
129
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
--obs "JWT with RS256; PKCE over implicit flow because the client is public." \
|
|
518
|
-
--tags "project:myapp" "topic:auth"
|
|
519
|
-
```
|
|
130
|
+
- `forget` archives a memory instead of deleting it. A newer memory can replace an older one.
|
|
131
|
+
- A running agent can call `work_package` to prepare one calendar digest or bounded visible turns from the newest eligible recent Claude Code transcript. Transcript mode requires the client's single matching MCP file root; missing or ambiguous roots and bounded scan failures fail closed. Submission retains redacted source turns and only stages pending human review; agents cannot apply or reject it, and MeMesh calls no provider. The exact discovery bounds are in the [API reference](docs/api/API_REFERENCE.md#work_package).
|
|
520
132
|
|
|
521
|
-
|
|
522
|
-
in plain words: *"remember this incident as a lesson, influenced by
|
|
523
|
-
auth-approach"*. The `remember` tool takes free-form relations, and `caused` /
|
|
524
|
-
`influenced` are the documented causal vocabulary (cause → effect, stated
|
|
525
|
-
explicitly — MeMesh never infers causality from timestamps). Weeks later,
|
|
526
|
-
`memesh recall "why did we pick PKCE"` returns the decision with its recorded
|
|
527
|
-
consequences attached — reasoning you can follow, not just text that matched.
|
|
133
|
+
Full command and tool reference: [docs/api/API_REFERENCE.md](docs/api/API_REFERENCE.md). How it is built: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). Contributing: [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
528
134
|
|
|
529
135
|
---
|
|
530
136
|
|
|
531
|
-
##
|
|
532
|
-
|
|
533
|
-
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:
|
|
534
|
-
|
|
535
|
-
```bash
|
|
536
|
-
memesh config set llm.provider anthropic
|
|
537
|
-
memesh config set llm.api-key sk-ant-...
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
Or use the dashboard Settings tab (visual setup):
|
|
541
|
-
|
|
542
|
-
```bash
|
|
543
|
-
memesh serve # opens dashboard → Settings tab
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
**Mine your past sessions into memory.** `memesh dream run --from-transcripts` reads this project's Claude Code session transcripts, asks the LLM for the decisions and lessons buried in the conversation, and stages them as proposals — nothing enters your graph automatically. Review each with `memesh dream show <id>` and accept the ones worth keeping. To run it on a schedule, enable `memesh config set transcriptMining true` and point a cron/launchd entry at `memesh dream run --from-transcripts --if-due` — it self-throttles (default once every 24h per project) and stays staging-only. See [API_REFERENCE](docs/api/API_REFERENCE.md#memesh-dream).
|
|
547
|
-
|
|
548
|
-
### Semantic search / embeddings (optional)
|
|
549
|
-
|
|
550
|
-
By default MeMesh does **keyword-only** recall (FTS5) — no API key, no model download, nothing leaves your machine. Semantic (meaning-based) search is opt-in and needs an embedder. Point one of these at it:
|
|
551
|
-
|
|
552
|
-
```bash
|
|
553
|
-
memesh config set embedder.provider ollama # local, needs `ollama serve`
|
|
554
|
-
# or, for a hosted embedder:
|
|
555
|
-
memesh config set embedder.provider openai
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
The embedder is configured **independently of the chat LLM** — changing `llm.provider` never silently changes your embeddings. Each provider pins its own model and width (`ollama` → nomic-embed-text at 768, `openai` → text-embedding-3-small at 1536); the model is not separately selectable, because a vector index is fixed at one width and a second model would put vectors from a different embedding space into it.
|
|
559
|
-
|
|
560
|
-
If you switch to an embedder with a different dimension (e.g. 768 → 1536), **nothing is deleted**. MeMesh keeps the existing index and tells you on open to run `memesh reindex`, which builds the new index beside the old one and switches over only once every memory has a vector — so an interrupted rebuild costs you nothing and resumes where it stopped. During that window semantic search is off and recall runs on keyword search alone; `recall` reports this as `degraded` rather than implying it searched. Supported `embedder.provider` values: `ollama` (local), `openai` (hosted). With none set, recall stays on keyword search.
|
|
561
|
-
|
|
562
|
-
| | Level 0 (default) | Level 1 (Smart Mode) |
|
|
563
|
-
|---|---|---|
|
|
564
|
-
| **Search** | FTS5 + sqlite-vec, 95.60% R@5 | unchanged — recall is LLM-free at every level |
|
|
565
|
-
| **Auto-capture** | Rule-based patterns | + LLM extracts decisions & lessons |
|
|
566
|
-
| **Auto-tagging** | Manual tags only | + LLM generates tags for new memories |
|
|
567
|
-
| **Failure analysis** | Not available | + LLM converts session errors into structured lessons |
|
|
568
|
-
| **Compression** | Not available | `dream` compress verbose memories |
|
|
569
|
-
| **Cost** | Free, no API key | ~$0.0001 per analysis call (Haiku) |
|
|
570
|
-
|
|
571
|
-
---
|
|
572
|
-
|
|
573
|
-
## All 11 Memory and Coordination Tools
|
|
137
|
+
## All 12 Memory and Coordination Tools
|
|
574
138
|
|
|
575
139
|
| Tool | What it does |
|
|
576
140
|
|------|-------------|
|
|
141
|
+
| `work_package` | Prepare one bounded untrusted calendar digest or Claude Code transcript package under one matching MCP workspace root; submit one strict result for pending human review, or defer without durable change. Transcript submission retains bounded redacted source turns; no file path, hidden reasoning, provider, embedding, or vector data is exposed. |
|
|
577
142
|
| `remember` | Store knowledge with observations, relations, and tags |
|
|
578
|
-
| `recall` | FTS5
|
|
143
|
+
| `recall` | Local FTS5 search with multi-factor scoring (relevance, recency, frequency, confidence, recall impact) |
|
|
579
144
|
| `forget` | Soft-archive (never deletes) or remove specific observations |
|
|
580
145
|
| `export` | Back up, migrate, or move memories as JSON between compatible agents |
|
|
581
146
|
| `import` | Import memories with merge strategies (skip / overwrite / append) |
|
|
@@ -588,81 +153,18 @@ If you switch to an embedder with a different dimension (e.g. 768 → 1536), **n
|
|
|
588
153
|
|
|
589
154
|
---
|
|
590
155
|
|
|
591
|
-
##
|
|
156
|
+
## The fine print
|
|
592
157
|
|
|
593
|
-
|
|
594
|
-
┌─────────────────┐
|
|
595
|
-
│ Core Engine │
|
|
596
|
-
│ operations │
|
|
597
|
-
└────────┬────────┘
|
|
598
|
-
┌─────────────────┼─────────────────┐
|
|
599
|
-
│ │ │
|
|
600
|
-
CLI (memesh) HTTP API (serve) MCP (memesh-mcp)
|
|
601
|
-
│ │ │
|
|
602
|
-
└─────────────────┼─────────────────┘
|
|
603
|
-
│
|
|
604
|
-
SQLite + FTS5 + sqlite-vec
|
|
605
|
-
(~/.memesh/knowledge-graph.db)
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
Core is framework-agnostic. Same logic runs from terminal, HTTP, or MCP.
|
|
158
|
+
**Scored Ranking** — Results ranked by relevance (30%) + recency (25%) + frequency (18%) + confidence (17%) + recall impact (10%).
|
|
609
159
|
|
|
610
|
-
|
|
160
|
+
**Agent messaging, the exact rules** (full guide: [docs/platforms/agent-messaging.md](docs/platforms/agent-messaging.md)):
|
|
611
161
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
**Option B — one command** (no UI clicking, idempotent; requires the npm CLI, `npm install -g @pcircle/memesh`):
|
|
619
|
-
|
|
620
|
-
```bash
|
|
621
|
-
memesh upgrade-plugin
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
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`).
|
|
625
|
-
|
|
626
|
-
Plugin-only users without the npm CLI can still run the script by hand — substitute your installed version into the path:
|
|
627
|
-
|
|
628
|
-
```bash
|
|
629
|
-
bash ~/.claude/plugins/cache/pcircle-memesh/memesh/<current-version>/scripts/upgrade-plugin.sh
|
|
630
|
-
|
|
631
|
-
# Installs from before v4.2.5 don't contain the script yet; use the
|
|
632
|
-
# npm-global copy instead (see "Install paths at a glance" above):
|
|
633
|
-
bash "$(npm prefix -g)/lib/node_modules/@pcircle/memesh/scripts/upgrade-plugin.sh"
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
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.
|
|
637
|
-
|
|
638
|
-
**npm-global installs** (`npm install -g @pcircle/memesh`) can self-update via `memesh update`. For a source checkout, with npm installed, run `git pull && npm install && npm run build`.
|
|
639
|
-
|
|
640
|
-
**Codex plugin marketplace installs** (using the Codex CLI):
|
|
641
|
-
|
|
642
|
-
```bash
|
|
643
|
-
codex plugin marketplace add PCIRCLE-AI/memesh
|
|
644
|
-
codex plugin add memesh@pcircle-memesh
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
For a stale marketplace snapshot, refresh it with `codex plugin marketplace upgrade pcircle-memesh`, then reinstall with `codex plugin remove memesh` followed by `codex plugin add memesh@pcircle-memesh`.
|
|
648
|
-
|
|
649
|
-
Session start surfaces a one-line banner (throttled to once per 24h per version) when a newer release is available, and `memesh doctor` reports the upgrade target with the channel-specific command.
|
|
650
|
-
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
## Contributing
|
|
654
|
-
|
|
655
|
-
```bash
|
|
656
|
-
git clone https://github.com/PCIRCLE-AI/memesh
|
|
657
|
-
cd memesh && npm install && npm run build
|
|
658
|
-
npm test
|
|
659
|
-
npm run test:e2e-dashboard
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
Dashboard: `cd dashboard && npm install && npm run dev`
|
|
162
|
+
- Works today: an MCP, HTTP, or CLI sender can durably send one untrusted JSON-encoded payload of at most 65,536 UTF-8 bytes (64 KiB) to one named local recipient. A receiver can fetch it separately, resume from an opaque cursor after restart, and record intake, acknowledgement, workflow disposition, and host activation as separate facts.
|
|
163
|
+
- With the MeMesh Codex plugin enabled, each startup or resumed ordinary Codex CLI thread with a valid thread identity and existing working directory registers automatically under a thread-scoped identity; no manual `agent setup` is required. SessionStart launches an owner-private detached companion because Codex reaps an async hook child when its CLI process exits. SessionEnd keeps a bounded 45-second idle queue window, resume replaces the prior exact generation, and expiry removes the registration. A message accepted during that idle window becomes model-visible when the same thread resumes; it is not a claim that a stopped UI was awakened. `memesh agent setup codex-session` remains available only when one workspace needs a stable named principal. The complete native envelope, including routing metadata and payload, is capped separately at 16,384 bytes (16 KiB). An exact-session send returns success only after that native queue accepts it; an oversized full envelope reports `native_message_too_large`, while other unavailable or rejected sessions report `recipient_unavailable`. Scoped recovery data remains durable. Principal targets retain durable store-and-forward behavior. Native acceptance is not acknowledgement or disposition, and native messages must contain no secrets.
|
|
164
|
+
- A stopped, missing, or disconnected Codex session is not woken up or replaced, and a failed exact-session native delivery is not replayed automatically; the sender must retry deliberately. Its scoped recovery data stays available; `memesh message storage report` shows what is stored. Native delivery works on macOS and Linux only.
|
|
165
|
+
- This documented native path covers ordinary Codex CLI. Do not assume Codex Desktop or an unattached task registers unless that exact running session appears in `message discover`; this is an evidence boundary, not a claim that those hosts are universally incompatible.
|
|
166
|
+
- When pairing Claude Channel with automatic Codex registration, pass the complete `project` value from `memesh briefing --json` to `memesh agent setup claude`; the repository basename is not the same routing scope.
|
|
663
167
|
|
|
664
168
|
---
|
|
665
169
|
|
|
666
|
-
<p align="center">
|
|
667
|
-
<strong>MIT</strong> — Made by <a href="https://pcircle.com">PCIRCLE AI</a>
|
|
668
|
-
</p>
|
|
170
|
+
<p align="center"><strong>MIT License</strong></p>
|