parallelclaw 1.0.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/CHANGELOG.md +204 -0
- package/HELP.md +600 -0
- package/LICENSE +21 -0
- package/MULTI_MACHINE.md +152 -0
- package/README.md +417 -0
- package/README.ru.md +740 -0
- package/SYNC.md +844 -0
- package/bot/README.md +173 -0
- package/bot/config.js +66 -0
- package/bot/inbox.js +153 -0
- package/bot/index.js +294 -0
- package/bot/nexara.js +61 -0
- package/bot/poll.js +304 -0
- package/bot/search.js +155 -0
- package/bot/telegram.js +96 -0
- package/ingest.js +2712 -0
- package/lib/cli/index.js +1987 -0
- package/lib/config.js +220 -0
- package/lib/db-init.js +158 -0
- package/lib/hook/install.js +268 -0
- package/lib/import-telegram.js +158 -0
- package/lib/ingest-file.js +779 -0
- package/lib/notify-click-action.js +281 -0
- package/lib/openclaw-channel.js +643 -0
- package/lib/parse-cursor.js +172 -0
- package/lib/parse-obsidian.js +256 -0
- package/lib/parse-telegram-html.js +384 -0
- package/lib/parse.js +175 -0
- package/lib/render-markdown.js +0 -0
- package/lib/store-doc/canonicalize.js +116 -0
- package/lib/store-doc/detect.js +209 -0
- package/lib/store-doc/extract-title.js +162 -0
- package/lib/sync/auth.js +80 -0
- package/lib/sync/cert.js +144 -0
- package/lib/sync/cli.js +906 -0
- package/lib/sync/client.js +138 -0
- package/lib/sync/config.js +130 -0
- package/lib/sync/pair.js +145 -0
- package/lib/sync/pull.js +158 -0
- package/lib/sync/push.js +305 -0
- package/lib/sync/replicate.js +335 -0
- package/lib/sync/server.js +224 -0
- package/lib/sync/service.js +726 -0
- package/lib/tasks.js +215 -0
- package/lib/telegram-decisions.js +165 -0
- package/lib/telegram-discovery.js +373 -0
- package/lib/telegram-notify.js +272 -0
- package/lib/telegram-pending.js +200 -0
- package/lib/web/index.js +265 -0
- package/lib/web/routes/conversation.js +193 -0
- package/lib/web/routes/conversations.js +180 -0
- package/lib/web/routes/dashboard.js +175 -0
- package/lib/web/routes/pending.js +277 -0
- package/lib/web/routes/settings.js +226 -0
- package/lib/web/static/style.css +393 -0
- package/lib/web/templates.js +234 -0
- package/package.json +84 -0
- package/server.js +3816 -0
- package/skills/install-memex/README.md +109 -0
- package/skills/install-memex/SKILL.md +342 -0
- package/skills/install-memex/examples.md +294 -0
- package/skills/install-memex-claw/SKILL.md +423 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# ๐ Install memex โ cross-AI memory in 2 minutes
|
|
2
|
+
|
|
3
|
+
> One prompt sets up local-first AI memory across **Claude Code, Cowork, Cursor, and OpenClaw** โ plus Obsidian notes and Telegram chats. No cloud. No account. No data leaves your machine.
|
|
4
|
+
|
|
5
|
+
## What this skill does
|
|
6
|
+
|
|
7
|
+
After you drop the skill into your agent (`~/.claude/skills/` for Claude Code, or your client's equivalent), saying **"install memex"** triggers a guided installation:
|
|
8
|
+
|
|
9
|
+
1. **Discovery** โ read-only checks for which MCP client you're using and what AI data already exists on your machine
|
|
10
|
+
2. **Fast path (v1.1+)** โ `curl -fsSL https://memex.parallelclaw.ai/install.sh | bash`: one hosted bash script does npm install (with EACCES auto-fix to `~/.npm-global`), daemon setup, v0.8 auto-context hook, history backfill, and `claude mcp add memex` if Claude Code CLI is on PATH. Idempotent.
|
|
11
|
+
3. **Fallback: manual five-step** โ if curl fails, the user declines, or the agent is inside a GUI client (Cursor) where the MCP config still needs editing: `npm install -g parallelclaw` โ MCP config merge โ `memex-sync install` โ `memex-sync scan`.
|
|
12
|
+
4. **MCP config merge** (only needed for GUI clients) โ adds a single absolute-path `command` entry into your client's `mcpServers` config. Never overwrites your other servers.
|
|
13
|
+
5. **Restart hint + verification commands** โ including the v0.7+ CLI fallback (`memex overview`, `memex search "foo"`) so you can verify memex works even if MCP didn't wire up cleanly.
|
|
14
|
+
|
|
15
|
+
End-to-end: **~60 seconds** via fast path, **~2 minutes** via manual flow, fully observable (agent shows each command before running).
|
|
16
|
+
|
|
17
|
+
## What is memex?
|
|
18
|
+
|
|
19
|
+
Memex is a **local-first MCP server** that captures every conversation you have with an AI โ across **Claude Code, Cowork (including subagent transcripts), Cursor, OpenClaw**, plus **Obsidian notes**, **Telegram chats**, and **web pages / AI chat shares** (v0.6+ via `memex_store_document` โ agent fetches, memex stores verbatim) โ into one searchable SQLite + FTS5 corpus.
|
|
20
|
+
|
|
21
|
+
Any MCP-compatible agent can then query that corpus through 18 standard tools (`memex_search`, `memex_recent`, `memex_overview`, `memex_store_document`, the `memex_telegram_*` family for v0.10+ chat capture, โฆ).
|
|
22
|
+
|
|
23
|
+
| Pain | Memex |
|
|
24
|
+
|-------------------------------------------------|--------------------------------------|
|
|
25
|
+
| Claude forgets every session | One unified history across all sessions, all clients |
|
|
26
|
+
| Switching from Claude Code to Cursor = lost context | Cursor can read your Claude history (same SQLite DB) |
|
|
27
|
+
| Cloud memory services hold your data hostage | One `~/.memex/data/memex.db` file on your disk |
|
|
28
|
+
| Mem0 / Supermemory pricing per token | 0 LLM calls on write โ free at any scale |
|
|
29
|
+
| Vendor ban = lose everything | Your DB stays even if Claude blocks your account |
|
|
30
|
+
|
|
31
|
+
๐ฆ npm: [parallelclaw](https://www.npmjs.com/package/parallelclaw) ยท ๐ [memex.parallelclaw.ai](https://memex.parallelclaw.ai) ยท ๐ [GitHub](https://github.com/parallelclaw/memex-mvp)
|
|
32
|
+
|
|
33
|
+
## Why a skill (vs. just copy-pasting the install prompt)
|
|
34
|
+
|
|
35
|
+
The install playbook also exists as a copy-paste prompt on the landing page. But once you have the skill installed, you skip a friction layer:
|
|
36
|
+
|
|
37
|
+
| Without skill | With skill |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Open landing page in browser | (already in your agent) |
|
|
40
|
+
| Click "Copy install prompt" | โ |
|
|
41
|
+
| Paste a wall of text into Claude/Cursor | Just say "install memex" |
|
|
42
|
+
| Hope the prompt is up-to-date | Skill version updates auto-fetched |
|
|
43
|
+
|
|
44
|
+
The skill description is written so Claude / OpenClaw auto-invoke it from any phrasing of "install memex", "set up memex", "add memory to my AI", etc. โ no need to remember `/install-memex` exactly.
|
|
45
|
+
|
|
46
|
+
## Example dialogue
|
|
47
|
+
|
|
48
|
+
> **User:** install memex
|
|
49
|
+
>
|
|
50
|
+
> **Agent:** ๐ You're running inside Cursor. Quick discovery before any install actions...
|
|
51
|
+
>
|
|
52
|
+
> โ Found Claude Code data at `~/.claude/projects/` (8 sessions)
|
|
53
|
+
> โ Found Cowork sessions (3 subagent transcripts)
|
|
54
|
+
> โ Continue not installed
|
|
55
|
+
> โ Zed not installed
|
|
56
|
+
> โ Cursor data found (this is where I'll write the MCP config)
|
|
57
|
+
>
|
|
58
|
+
> After install, memex will auto-index conversations from: **Claude Code, Cowork, Cursor**. v0.10+ also auto-detects Telegram Desktop exports โ when you export a chat, memex stages it and I'll ask which to import (privacy-first per-chat consent).
|
|
59
|
+
>
|
|
60
|
+
> Best path is the curl one-liner โ does npm install (auto-fixes EACCES), daemon, auto-context hook, and history backfill in ~60 seconds. Want me to run:
|
|
61
|
+
>
|
|
62
|
+
> ```
|
|
63
|
+
> curl -fsSL https://memex.parallelclaw.ai/install.sh | bash
|
|
64
|
+
> ```
|
|
65
|
+
>
|
|
66
|
+
> **User:** yes
|
|
67
|
+
>
|
|
68
|
+
> **Agent:** [streams curl output, then edits `~/.cursor/mcp.json` to add `memex` MCP entry, prints restart hint, and offers Telegram capture setup]
|
|
69
|
+
|
|
70
|
+
See [examples.md](examples.md) for more sample dialogues, including EACCES recovery and partial-install scenarios.
|
|
71
|
+
|
|
72
|
+
## Requirements
|
|
73
|
+
|
|
74
|
+
- **Node.js 20โ24** (LTS recommended). Install via [nodejs.org](https://nodejs.org), `brew install node`, or [nvm](https://github.com/nvm-sh/nvm)
|
|
75
|
+
- **macOS or Linux** (Windows untested for memex itself; skill works anywhere your agent has shell access)
|
|
76
|
+
- **An MCP-compatible CLI agent**: Claude Code, OpenClaw, or Cursor (with MCP). Web-only agents (ChatGPT, Claude.ai) can't execute install steps
|
|
77
|
+
|
|
78
|
+
## Install the skill
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
mkdir -p ~/.claude/skills/install-memex
|
|
82
|
+
curl -fsSL https://raw.githubusercontent.com/parallelclaw/memex-mvp/main/skills/install-memex/SKILL.md \
|
|
83
|
+
-o ~/.claude/skills/install-memex/SKILL.md
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or, if you've already done `npm install -g parallelclaw`, the skill ships inside the package:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
cp -r "$(npm root -g)/parallelclaw/skills/install-memex" ~/.claude/skills/
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then in your agent: `install memex` (or `/install-memex` if your client supports slash-commands).
|
|
93
|
+
|
|
94
|
+
## What the skill won't do
|
|
95
|
+
|
|
96
|
+
- โ Install Node.js for you โ it stops and asks you to install it
|
|
97
|
+
- โ Run `sudo` without asking โ EACCES fallback always confirms with you first
|
|
98
|
+
- โ Overwrite your existing `mcpServers` config โ always merges
|
|
99
|
+
- โ Redirect any host application's data location โ memex reads from each tool's native path
|
|
100
|
+
- โ Send anything over the network (besides `npm install` itself)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
[MIT](https://github.com/parallelclaw/memex-mvp/blob/main/LICENSE) for memex itself.
|
|
105
|
+
This skill bundle is published on ClawHub under [MIT-0](https://opensource.org/license/mit-0) (effectively public domain โ no attribution required) per ClawHub's publishing terms.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
๐ Built by [@parallelclaw](https://github.com/parallelclaw) ยท Star the repo if memex helps you: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp)
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: install-memex
|
|
3
|
+
description: Make Claude, Cursor, and OpenClaw remember every AI conversation forever โ one local SQLite corpus shared across all of them. Installs memex (local-first MCP server) in ~60 seconds via curl one-liner. Includes auto-capture daemon for Claude Code / Cowork / Cursor / Obsidian; v0.10 Telegram auto-detect (export from Desktop โ memex stages it โ AI proactively asks which to import, privacy-first per-chat consent); v0.8 SessionStart hook for the Brian Chesky moment ("Claude already knows what you were doing"); URL / Perplexity / AI chat share capture via memex_store_document. 18 MCP tools, no cloud, no account, verbatim storage. Use when the user says "install memex", "set up memex", "add memory to my AI", "make my agent remember across sessions", "ัะพั
ัะฐะฝะธ ะผะพะธ ัะฐัั", or similar.
|
|
4
|
+
version: 1.6.0
|
|
5
|
+
metadata:
|
|
6
|
+
openclaw:
|
|
7
|
+
emoji: "๐"
|
|
8
|
+
homepage: https://memex.parallelclaw.ai
|
|
9
|
+
requires:
|
|
10
|
+
bins:
|
|
11
|
+
- node
|
|
12
|
+
- npm
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Install memex
|
|
16
|
+
|
|
17
|
+
## โ For ClawHub reviewers, security scanners, and curious users
|
|
18
|
+
|
|
19
|
+
This skill is an **installer for memex** โ a local-first MCP memory server.
|
|
20
|
+
Static scanners flag several patterns as "suspicious"; every single one is
|
|
21
|
+
intentional and necessary for installing a memory tool. Below is the full
|
|
22
|
+
list so a human reviewer (or the user) can verify legitimacy in one glance.
|
|
23
|
+
|
|
24
|
+
**What the skill instructs the agent to do:**
|
|
25
|
+
|
|
26
|
+
| Action | Why | Source-of-truth |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `curl -fsSL https://memex.parallelclaw.ai/install.sh \| bash` | Fast-path installer (the user can `\| less` first to inspect) | [docs/install.sh](https://github.com/parallelclaw/memex-mvp/blob/main/docs/install.sh) โ open-source bash, hosted on GitHub Pages |
|
|
29
|
+
| `npm install -g parallelclaw` | Manual install (fallback if user declines the curl) | [npmjs.com/package/parallelclaw](https://www.npmjs.com/package/parallelclaw), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |
|
|
30
|
+
| `echo 'export PATH=...' >> ~/.zshrc` | EACCES auto-fix โ moves npm prefix to `~/.npm-global` so `npm install -g` works without sudo. **Idempotent** โ re-running is safe. | Standard npm prefix workaround [docs.npmjs.com](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally) |
|
|
31
|
+
| `sudo npm install -g parallelclaw` | Offered as Plan A on EACCES if user explicitly wants quick (not default โ skill recommends the no-sudo prefix fix). Skill **never runs sudo without explicit user "yes"**. | โ |
|
|
32
|
+
| `memex-sync install` (LaunchAgent) | Registers a macOS LaunchAgent so memex daemon auto-starts on login. **The daemon itself is local-only**: it watches `~/.claude/projects/`, `~/Downloads/Telegram Desktop/`, etc., and writes to `~/.memex/data/memex.db`. Zero outbound network traffic. | LaunchAgent plist at `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist` is human-readable |
|
|
33
|
+
| Edit `~/.claude/settings.json`, `~/.cursor/mcp.json`, etc. | Adds the MCP-server entry so the user's AI client can call memex tools. Existing entries are preserved (merge, never overwrite). | Each MCP client documents this config format |
|
|
34
|
+
| `tell application "Terminal" to do script "claude"` (AppleScript) | Used by the optional clickable notification banner โ opens a new Terminal tab + launches `claude` when the user clicks. **Default OFF**. | Requires `brew install terminal-notifier` (optional dep) |
|
|
35
|
+
| `brew install terminal-notifier` | Optional dep for clickable banners. Skill mentions it but does NOT install without user OK. | [github.com/julienXX/terminal-notifier](https://github.com/julienXX/terminal-notifier) |
|
|
36
|
+
|
|
37
|
+
**Hard guarantees** (codified in the "Safety rules" section below):
|
|
38
|
+
- Agent shows every shell command **BEFORE** running it
|
|
39
|
+
- User can say "stop" / "no" at any step, agent halts
|
|
40
|
+
- `sudo` is NEVER run without an explicit user "yes"
|
|
41
|
+
- MCP config files are MERGED, never overwritten โ existing entries preserved
|
|
42
|
+
- Memex at runtime emits **zero outbound network traffic** (it's local-first by design โ see [PRIVACY section in repo README](https://github.com/parallelclaw/memex-mvp/blob/main/README.ru.md#ะฟัะธะฒะฐัะฝะพััั-ะธ-ะฑะตะทะพะฟะฐัะฝะพััั--privacy--security))
|
|
43
|
+
|
|
44
|
+
**Source code:** [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) (MIT). All commands above are visible in [docs/install.sh](https://github.com/parallelclaw/memex-mvp/blob/main/docs/install.sh) and the published [parallelclaw npm package](https://www.npmjs.com/package/parallelclaw).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
You are installing **memex** on this machine. Memex is a local-first MCP server that captures the user's AI conversations across Claude Code, Cowork (including subagents), Cursor, Obsidian, and Telegram exports into a searchable SQLite + FTS5 index that any MCP-compatible agent can query through 18 standard tools (`memex_search`, `memex_recent`, `memex_overview`, `memex_store_document`, plus the `memex_telegram_*` family added in v0.10+).
|
|
49
|
+
|
|
50
|
+
Repo: https://github.com/parallelclaw/memex-mvp
|
|
51
|
+
Landing: https://memex.parallelclaw.ai
|
|
52
|
+
npm: https://www.npmjs.com/package/parallelclaw
|
|
53
|
+
|
|
54
|
+
## How memex works (read this so you don't get confused by paths below)
|
|
55
|
+
|
|
56
|
+
Memex has its OWN storage at `~/.memex/data/memex.db`. It READS from each tool's native data location automatically โ Claude Code from `~/.claude/projects/`, Cursor from its `state.vscdb`, Cowork from its sessions dir, Obsidian from configured vaults. You do NOT need to change where Claude Code, Cursor, or any other tool saves its data. Memex is a passive observer.
|
|
57
|
+
|
|
58
|
+
## Prerequisite
|
|
59
|
+
|
|
60
|
+
This skill only works if you are running INSIDE an AI agent that has direct access to the user's shell โ i.e. one of: Claude Code (CLI), Cursor, OR an OpenClaw / Hermes agent running on a Linux VPS. Web-based agents (ChatGPT in browser, Claude.ai web, Claude Desktop without tools, etc.) cannot execute `npm`/file operations. If you are NOT a CLI-based agent with shell access, stop now and tell the user to use the manual install at https://memex.parallelclaw.ai/#quickstart.
|
|
61
|
+
|
|
62
|
+
**Platform note (v0.10.14+):** memex now runs natively on **both macOS and Linux**. `memex-sync install` auto-detects platform: macOS โ LaunchAgent, Linux โ systemd user-service. On Linux it will also try to `loginctl enable-linger $USER` so the daemon survives SSH logout โ if that needs sudo, the script prints a clear next step instead of failing. **VPS deployments** (OpenClaw / Hermes running on Ubuntu/Debian etc.) work end-to-end โ capture sessions from `~/.openclaw/agents/main/sessions/` automatically.
|
|
63
|
+
|
|
64
|
+
## Discovery โ do this BEFORE the numbered steps
|
|
65
|
+
|
|
66
|
+
Scan the user's setup so you can tailor advice and tell them exactly what memex will pick up.
|
|
67
|
+
|
|
68
|
+
1. Identify which MCP client you're running inside (you should know from context โ Claude Code CLI, Cursor, or OpenClaw).
|
|
69
|
+
2. Run these read-only checks one by one:
|
|
70
|
+
```sh
|
|
71
|
+
ls -d ~/.claude/projects 2>/dev/null
|
|
72
|
+
ls -d ~/Library/Application\ Support/Claude/local-agent-mode-sessions 2>/dev/null
|
|
73
|
+
ls -d ~/Library/Application\ Support/Cursor 2>/dev/null
|
|
74
|
+
ls ~/.continue/config.json 2>/dev/null
|
|
75
|
+
ls -d ~/.config/zed 2>/dev/null
|
|
76
|
+
```
|
|
77
|
+
3. Report to the user in plain language:
|
|
78
|
+
- "You're running inside [X]. I will edit [path] in step 2 below."
|
|
79
|
+
- "Tools with data found on this machine: [list]"
|
|
80
|
+
- "Tools NOT found (memex won't capture from these): [list]"
|
|
81
|
+
- "After install, memex will auto-index conversations from: [detected sources]"
|
|
82
|
+
4. Wait for the user's "ok" before starting step 1.
|
|
83
|
+
|
|
84
|
+
## Fast path โ one-line installer (try this first)
|
|
85
|
+
|
|
86
|
+
memex ships a hosted bash installer that does steps 1, 3, and 4 in a single run โ and also wires up Claude Code's MCP entry if `claude` is on PATH. It's idempotent (safe to re-run), auto-fixes the `EACCES` case by moving npm's prefix to `~/.npm-global`, and prompts before enabling the auto-context hook.
|
|
87
|
+
|
|
88
|
+
Show this command to the user, explain what it does, get their **explicit ok**, then run:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
curl -fsSL https://memex.parallelclaw.ai/install.sh | bash
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
What the script does, in order:
|
|
95
|
+
1. Checks Node โฅ 20.
|
|
96
|
+
2. `npm install -g parallelclaw` โ on EACCES, sets `npm config set prefix ~/.npm-global`, appends PATH to `~/.zshrc`, retries.
|
|
97
|
+
3. `memex-sync install` with `--auto-context yes` (Brian Chesky hook into `~/.claude/settings.json` โ preserves other hooks).
|
|
98
|
+
4. `memex-sync scan` โ backfills existing history.
|
|
99
|
+
5. `claude mcp add memex --scope user -- memex` if Claude Code CLI is detected.
|
|
100
|
+
|
|
101
|
+
After the script finishes:
|
|
102
|
+
- If the user is in **Claude Code (CLI)** โ install is complete. Skip straight to step 6 (verification + restart). Also do step 5 (offer Telegram capture).
|
|
103
|
+
- If the user is in **Cursor** โ the npm install + daemon + auto-context + scan are done, but the GUI client's MCP config still needs the memex entry. **Skip step 1 (already installed)**, **skip step 3** (daemon already installed) and **skip step 4** (scan already ran). **Do step 2** (wire MCP into the GUI client's config), **step 5** (offer Telegram), and **step 6** (verify + restart).
|
|
104
|
+
|
|
105
|
+
If the script fails for any reason โ non-zero exit, weird output, user uncomfortable piping curl to bash โ fall back to the **Manual install** below.
|
|
106
|
+
|
|
107
|
+
To inspect what the script does first: `curl -fsSL https://memex.parallelclaw.ai/install.sh | less` (don't pipe to bash).
|
|
108
|
+
|
|
109
|
+
## Manual install (if the fast path didn't fit)
|
|
110
|
+
|
|
111
|
+
Do these in order. Show each command before running it. Stop and ask if anything fails or looks wrong.
|
|
112
|
+
|
|
113
|
+
### 1. Install memex from npm
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
npm install -g parallelclaw
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
If you get `EACCES` (macOS system Node), **recommend Option B (permanent prefix fix) by default** and proceed unless the user explicitly chooses sudo.
|
|
120
|
+
|
|
121
|
+
Say to the user:
|
|
122
|
+
|
|
123
|
+
> "Hit EACCES โ your Node is installed in a system directory that npm can't write to without admin rights. Two fixes:
|
|
124
|
+
>
|
|
125
|
+
> **A)** Quick: `sudo npm install -g parallelclaw` โ one-time, requires your password
|
|
126
|
+
> **B)** Permanent fix: I'll move npm's install location to your home directory. After this, no `npm install -g` will ever ask for sudo again, for any package. Five commands, one-time.
|
|
127
|
+
>
|
|
128
|
+
> I recommend **B** โ it's a permanent improvement that benefits all your future Node tools, not just memex. Proceed with B?"
|
|
129
|
+
|
|
130
|
+
If the user agrees (or says anything like "ok", "yes", "default", "go", "B") โ proceed with B without further questions:
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
mkdir -p ~/.npm-global
|
|
134
|
+
npm config set prefix ~/.npm-global
|
|
135
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
|
|
136
|
+
source ~/.zshrc
|
|
137
|
+
npm install -g parallelclaw
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
If the user **explicitly** picks A (or says "sudo", "fast", "quick"), use sudo:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
sudo npm install -g parallelclaw
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
After the install completes, verify with `which memex` (should print an absolute path) and `memex --version` (should print the version).
|
|
147
|
+
|
|
148
|
+
**Important if Option B was used + user already had memex from a prior sudo install:** the old sudo-installed copy in `/usr/local/lib/node_modules/parallelclaw/` is now orphaned (PATH prefers the new home install). Mention this once:
|
|
149
|
+
|
|
150
|
+
> "By the way, you have an older sudo-installed memex copy in `/usr/local/lib/`. It's harmless but takes ~60 MB. Clean it up when convenient: `sudo npm uninstall -g parallelclaw` โ not urgent."
|
|
151
|
+
|
|
152
|
+
Don't run that uninstall yourself โ let the user decide when.
|
|
153
|
+
|
|
154
|
+
If `node` or `npm` are missing, STOP and tell the user to install Node.js (recommend nvm.sh or `brew install node`). Don't try to install Node yourself.
|
|
155
|
+
|
|
156
|
+
**Verify:** `which memex` prints an absolute path; `memex-sync --help` runs without error.
|
|
157
|
+
|
|
158
|
+
### 2. Wire memex into the MCP client
|
|
159
|
+
|
|
160
|
+
Common config locations:
|
|
161
|
+
|
|
162
|
+
| Client | Config file |
|
|
163
|
+
|--------------|-----------------------------------------------------|
|
|
164
|
+
| Claude Code | `~/.claude/config.json` (or platform equivalent) |
|
|
165
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
166
|
+
| OpenClaw | dedicated guide: memex.parallelclaw.ai/openclaw/ |
|
|
167
|
+
|
|
168
|
+
Tell the user which one you've inferred and which file you'll edit. If unclear, ask.
|
|
169
|
+
|
|
170
|
+
Read the existing config (if present). Show the user a diff before saving.
|
|
171
|
+
|
|
172
|
+
Get the **absolute** path to the memex binary โ GUI apps (Cursor, Claude Desktop) on macOS often don't inherit shell PATH, so a bare `"command": "memex"` fails with `spawn memex ENOENT`. Run:
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
which memex
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Capture that path (e.g. `/Users/<you>/.npm-global/bin/memex` or `/usr/local/bin/memex`). If it's a shim, also run `realpath $(which memex)` to resolve to the real binary.
|
|
179
|
+
|
|
180
|
+
MERGE this entry into `mcpServers` โ never overwrite other servers the user has:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"memex": {
|
|
186
|
+
"command": "<absolute path from which memex>"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
One path, no `args`. The published npm package wires up its own entry point.
|
|
193
|
+
|
|
194
|
+
If the config file doesn't exist, create the parent directory and write a minimal valid file with just memex.
|
|
195
|
+
|
|
196
|
+
**Verify:** re-read the file after save; confirm `memex` entry is present and `command` is an absolute path.
|
|
197
|
+
|
|
198
|
+
### 3. Turn on live auto-capture + auto-context (v0.8+)
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
memex-sync install
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
During `memex-sync install`, you'll see a prompt:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
Auto-context (Brian Chesky mode):
|
|
208
|
+
When you open Claude Code in a project, memex can inject 500-1500 tokens
|
|
209
|
+
of relevant context so Claude knows what you were doing โ without you
|
|
210
|
+
having to ask. Adds a SessionStart hook to ~/.claude/settings.json.
|
|
211
|
+
Other hooks (e.g. gstack) are preserved.
|
|
212
|
+
|
|
213
|
+
Enable? [Y/n]
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Answer Y unless the user has stated privacy concerns** about Claude seeing context from their other AI conversations. Auto-context is the "10/10 magic moment" of memex โ without it the install ships at base capability. Other hooks (gstack, custom) are preserved untouched.
|
|
217
|
+
|
|
218
|
+
For non-interactive flows (CI / scripts): pass `--auto-context yes` or `--yes`.
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
memex-sync status
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`status` should print "daemon installed", "running (PID โฆ)", "watching N sessions".
|
|
225
|
+
|
|
226
|
+
**Verify:** status output shows a non-zero PID. Also run `memex hook status` โ should show `INSTALLED` if auto-context was accepted.
|
|
227
|
+
|
|
228
|
+
### 4. Backfill existing history
|
|
229
|
+
|
|
230
|
+
The daemon only catches NEW sessions going forward. To index everything already on disk:
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
memex-sync scan
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
This walks `~/.claude/projects/`, Cowork sessions, Cursor `state.vscdb`, and any configured Obsidian vaults once, ingesting whatever exists.
|
|
237
|
+
|
|
238
|
+
Optionally:
|
|
239
|
+
```sh
|
|
240
|
+
memex-sync backfill-projects
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Tags older conversations with their `project_path` so `memex_list_projects` works on them.
|
|
244
|
+
|
|
245
|
+
**Verify:** after scan, `memex-sync status` shows a non-zero "ingested" count.
|
|
246
|
+
|
|
247
|
+
### 5. Offer Telegram-export capture (v0.10+)
|
|
248
|
+
|
|
249
|
+
After the core install is done, **proactively** ask:
|
|
250
|
+
|
|
251
|
+
> "Memex can also remember your Telegram chats โ work, family, group chats, whatever you want indexed. Want me to set that up too? It's about 2 minutes."
|
|
252
|
+
|
|
253
|
+
If yes, run `memex_telegram_check` (MCP tool) or `memex telegram check` (CLI). The result tells you the user's state and the next step. Walk them through:
|
|
254
|
+
|
|
255
|
+
- **No Telegram Desktop?** โ Give the download URL from the check output. Wait for them to install + log in.
|
|
256
|
+
- **Logged in <24h ago?** โ Tell them: "Telegram blocks export for the first 24h. Wait ~X hours, then come back."
|
|
257
|
+
- **Ready to export?** โ Show the click-path: open chat โ โฎ menu (top-right) โ "Export chat history" โ format HTML or JSON โ Export.
|
|
258
|
+
|
|
259
|
+
After the user exports, memex's daemon **auto-detects** the file in ~/Downloads/Telegram Desktop/ within ~7 seconds and stages it in `~/.memex/pending/`. Then:
|
|
260
|
+
|
|
261
|
+
- Call `memex_telegram_pending` to list staged exports (chat name, msg count, date range).
|
|
262
|
+
- **Present as a numbered list**, ask which to import. Accept indices, titles, or natural language ("import family and work, skip bank").
|
|
263
|
+
- Call `memex_telegram_import` with selected indices/titles. The chat is added to the allow-list โ future re-exports auto-merge via UNIQUE(msg_id).
|
|
264
|
+
- For sensitive chats user doesn't want (Bank, Therapist, etc.), call `memex_telegram_skip`.
|
|
265
|
+
|
|
266
|
+
**โ Existing exports back-fill (v0.10.13+):** if the user had Telegram Desktop exports SITTING IN `~/Downloads/Telegram Desktop/` BEFORE memex was installed, the daemon's chokidar watcher may or may not detect them (race with FSEvents on first run). The fast remedy is `memex telegram scan` โ it walks the Downloads dir and stages every `ChatExport_*` folder (HTML or JSON, both work). v0.10.13's `memex-sync install` also runs this scan automatically at the end, but if the user already installed pre-0.10.13, OR if `memex telegram pending` reports zero entries despite a populated Downloads dir, run `memex telegram scan` explicitly. Both HTML and JSON formats are supported โ don't tell the user to re-export in JSON.
|
|
267
|
+
|
|
268
|
+
**Optional โ clickable native macOS banner (v0.10.4+):** memex can fire a macOS notification the moment an export is staged. Default OFF for privacy. If the user wants this:
|
|
269
|
+
|
|
270
|
+
```sh
|
|
271
|
+
brew install terminal-notifier # required for clickable banner
|
|
272
|
+
memex telegram notifications on # enable; default: titles hidden
|
|
273
|
+
memex telegram notifications on --show-titles # include chat names in banner
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
When enabled with `terminal-notifier`, clicking the banner opens (auto-detect priority): Claude Code CLI in a fresh Terminal tab โ Claude Desktop โ Terminal with `memex telegram pending`. The CLI launch path triggers the SessionStart hook โ Brian Chesky moment. Override target: `memex telegram notifications target <auto|claude-cli|claude-desktop|terminal|none>`.
|
|
277
|
+
|
|
278
|
+
**Other useful Telegram commands** (no MCP-tool wiring needed):
|
|
279
|
+
|
|
280
|
+
```sh
|
|
281
|
+
memex telegram check # diagnostic: Desktop? login age (24h)? watcher?
|
|
282
|
+
memex telegram open-pending # one-shot: open pending list in best client
|
|
283
|
+
memex telegram mode auto # auto-import allow-listed chats on re-export
|
|
284
|
+
memex telegram status # decisions counts (allowed/skipped/blocked)
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Privacy is the core promise. Never auto-import. Always get explicit per-chat consent on the first round.**
|
|
288
|
+
|
|
289
|
+
If the user declines Telegram setup ("not now" / "skip"): say "OK, I'll skip Telegram. You can run `memex telegram check` anytime later to start." Don't push.
|
|
290
|
+
|
|
291
|
+
### 6. Tell the user what to do next
|
|
292
|
+
|
|
293
|
+
Tell the user to fully quit and reopen the MCP client (Cmd+Q on macOS) so it picks up the new memex tools.
|
|
294
|
+
|
|
295
|
+
**๐ OFFER TO IMPORT THEIR EXISTING DATA RIGHT NOW (v0.10.12+):** before anything else, ask the user if they have a Telegram export or a chat-history file sitting somewhere on disk that they'd like to load. Many users come with a `result.json` they exported yesterday, sitting in `~/Downloads/` or a project folder. Don't make them figure out memex's "magic paths" โ just ask:
|
|
296
|
+
|
|
297
|
+
> "Do you have any chat exports already on disk you want loaded into memex right now? Tell me the path (e.g. `~/Downloads/result.json` or `~/projects/memex/result.json`) โ I'll handle it."
|
|
298
|
+
|
|
299
|
+
Then call `memex_import_file({path: "<their-path>"})`. The tool auto-detects format (Telegram JSON / HTML / Claude JSONL / Cowork JSONL), respects the privacy gate for Telegram (returns `needs_consent` with a preview โ surface it, get user OK, retry with `force: true`), and gives you a structured result in one call. **Do not use bash `mv`/`cp` to shuffle files into `~/.memex/inbox/`** โ that was the old workflow and burned ~10k tokens per file. Use `memex_import_file` instead.
|
|
300
|
+
|
|
301
|
+
**๐ ALSO STRONGLY RECOMMEND THIS (v0.10.8+):** offer to run `memex web --open` for them right now. It's the single most magical post-install moment โ a local browser tab opens at `http://127.0.0.1:8765` with 5 pages showing every conversation memex has captured, dialogue rendered as chat-bubbles, full-text searchable. Verbatim โ not AI-summarized. Read-only, localhost-only, Ctrl+C to stop. Phrase it naturally, e.g.:
|
|
302
|
+
|
|
303
|
+
> "I can open a local web dashboard that lets you actually *see* what memex captured โ every message, in chat-bubble form, searchable. It's just a browser tab on `localhost:8765`. Run it now? It's a way better demo than asking me search queries blind."
|
|
304
|
+
|
|
305
|
+
Then run `memex web --open` (in a backgrounded shell if your shell wrapper supports it โ otherwise tell the user to run it themselves in another terminal). Wait for them to react before continuing.
|
|
306
|
+
|
|
307
|
+
**After that, suggest other ways to confirm end-to-end:**
|
|
308
|
+
- "show me what memex has in memory" โ triggers `memex_overview`
|
|
309
|
+
- "what projects has memex captured" โ triggers `memex_list_projects`
|
|
310
|
+
- "search memex for [recent topic]" โ triggers `memex_search`
|
|
311
|
+
- "save https://en.wikipedia.org/wiki/As_We_May_Think to memex" โ triggers `memex_store_document` and teaches the user that URL-saving exists (v0.6+)
|
|
312
|
+
- **Open Claude Code in any project the user worked on recently** โ the SessionStart auto-context (v0.8+) should kick in and Claude will mention prior work _before_ the user types anything. This is the "Brian Chesky moment" โ the magical-first-impression of memex.
|
|
313
|
+
- **(if Telegram was set up)** `memex telegram check` โ confirms daemon's Telegram-Downloads watcher is active and shows the user's full capture pipeline state.
|
|
314
|
+
|
|
315
|
+
These confirm everything works end-to-end.
|
|
316
|
+
|
|
317
|
+
**Brian Chesky moment beyond Claude Code (v0.10.7+):** the SessionStart hook works only in Claude Code CLI. But starting v0.10.7, the same proactive behaviour is taught to agents in Cursor / Claude Desktop via SERVER_INSTRUCTIONS โ these agents call `memex_overview` automatically on first interaction, read its `telegram_pending` field, and surface pending exports in their first reply. Slightly higher latency (one MCP roundtrip vs hook's instant inject), but same UX.
|
|
318
|
+
|
|
319
|
+
**CLI fallback (v0.7+):** if the MCP integration doesn't pick up in the user's client for any reason, tell them they can verify memex from the terminal directly โ same binary, no MCP needed:
|
|
320
|
+
|
|
321
|
+
```sh
|
|
322
|
+
memex overview # confirms memex itself is healthy
|
|
323
|
+
memex search "foo" # FTS search from CLI
|
|
324
|
+
memex list # list conversations
|
|
325
|
+
memex --help # command reference
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
This is also useful for agents without native MCP support (OpenCode + Kimi, plain shell scripts, CI pipelines) โ they can shell out to `memex` directly.
|
|
329
|
+
|
|
330
|
+
## Safety rules โ read before starting
|
|
331
|
+
|
|
332
|
+
- If `node` or `npm` aren't installed, stop and tell the user to install Node.js (recommend nvm.sh or `brew install node`). Don't try to install Node yourself.
|
|
333
|
+
- Never run `rm`, `sudo`, or anything destructive without explicit confirmation from the user.
|
|
334
|
+
- Show every command before running it. If the user says "no" or "stop", halt and explain.
|
|
335
|
+
- If a step fails, do NOT auto-retry or auto-fix โ tell the user what failed and ask how to proceed.
|
|
336
|
+
- When editing the MCP config, always preserve existing entries. If you can't merge cleanly, abort and tell the user.
|
|
337
|
+
- Do NOT modify the host application's settings beyond adding the memex entry to its `mcpServers` config. Specifically: do not redirect where Cursor / Claude Code / any other tool saves its data. Memex reads from each tool's native location automatically. The only file you should touch is the MCP config file listed in step 2.
|
|
338
|
+
- Stay focused on the main install task. If sidetracked into a sub-task (changing workspace, fixing an unrelated config issue, looking up something else), once it's done you MUST return to the memex install and explicitly tell the user: "OK, back to memex install. We were at step N โ should I continue?". Don't go silent after a side task. Don't assume the user wants to abandon the install โ always confirm.
|
|
339
|
+
|
|
340
|
+
## Begin
|
|
341
|
+
|
|
342
|
+
Greet the user, confirm which MCP client you're running inside, and run the Discovery checks before any install actions. After Discovery, **propose the fast path (curl one-liner) first** โ it covers ~90% of cases in one shot. After the core install completes, **proactively offer Telegram-export capture (step 5)** unless the user has already declined. Only fall back to the manual flow if the user objects, the script fails, or you're inside a GUI client where you'll still need to do step 2 manually after the script runs.
|