superlocalmemory 4.1.21 → 4.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +111 -0
  3. package/README.md +53 -8
  4. package/package.json +3 -1
  5. package/plugin/.claude-plugin/plugin.json +2 -2
  6. package/plugin/.cursor-plugin/plugin.json +24 -0
  7. package/plugin/CLAUDE.md +3 -3
  8. package/plugin/agents/slm-governance-advisor.md +1 -1
  9. package/plugin/agents/slm-loop-runner.md +1 -1
  10. package/plugin/agents/slm-memory-advisor.md +1 -1
  11. package/plugin/agents/slm-optimize-advisor.md +1 -1
  12. package/plugin/assets/logo.svg +36 -0
  13. package/plugin/cursor-skills/slm-bot-memory/SKILL.md +139 -0
  14. package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +138 -0
  15. package/plugin/cursor-skills/slm-recall/SKILL.md +333 -0
  16. package/plugin/cursor-skills/slm-remember/SKILL.md +273 -0
  17. package/plugin/cursor-skills/slm-scope/SKILL.md +176 -0
  18. package/plugin/cursor-skills/slm-session/SKILL.md +271 -0
  19. package/plugin/hooks/hooks.json +9 -9
  20. package/plugin/mcp.cursor.json +23 -0
  21. package/plugin/requirements-cpu-torch.txt +13 -0
  22. package/plugin/requirements.txt +1 -1
  23. package/plugin/scripts/ensure-venv.sh +45 -3
  24. package/plugin/scripts/slm-launch +93 -9
  25. package/plugin/scripts/torch-cpu-resolve.sh +86 -0
  26. package/plugin/skills/slm-bot-memory/SKILL.md +139 -0
  27. package/plugin/skills/slm-cache/SKILL.md +1 -1
  28. package/plugin/skills/slm-compress/SKILL.md +1 -1
  29. package/plugin/skills/slm-getting-started-bot/SKILL.md +138 -0
  30. package/plugin/skills/slm-governance/SKILL.md +1 -1
  31. package/plugin/skills/slm-graph/SKILL.md +1 -1
  32. package/plugin/skills/slm-loop/SKILL.md +1 -1
  33. package/plugin/skills/slm-mesh/SKILL.md +1 -1
  34. package/plugin/skills/slm-profile/SKILL.md +3 -2
  35. package/plugin/skills/slm-recall/SKILL.md +1 -1
  36. package/plugin/skills/slm-remember/SKILL.md +1 -1
  37. package/plugin/skills/slm-scope/SKILL.md +1 -1
  38. package/plugin/skills/slm-session/SKILL.md +1 -1
  39. package/plugin/skills/slm-status/SKILL.md +1 -1
  40. package/plugin-src/agents/slm-memory-advisor.md +1 -1
  41. package/plugin-src/agents/slm-optimize-advisor.md +1 -1
  42. package/plugin-src/rules/AGENTS.md +1 -1
  43. package/plugin-src/skills/slm-bot-memory/SKILL.md +139 -0
  44. package/plugin-src/skills/slm-cache/SKILL.md +1 -1
  45. package/plugin-src/skills/slm-compress/SKILL.md +1 -1
  46. package/plugin-src/skills/slm-getting-started-bot/SKILL.md +138 -0
  47. package/plugin-src/skills/slm-governance/SKILL.md +1 -1
  48. package/plugin-src/skills/slm-graph/SKILL.md +1 -1
  49. package/plugin-src/skills/slm-loop/SKILL.md +1 -1
  50. package/plugin-src/skills/slm-mesh/SKILL.md +1 -1
  51. package/plugin-src/skills/slm-profile/SKILL.md +3 -2
  52. package/plugin-src/skills/slm-recall/SKILL.md +1 -1
  53. package/plugin-src/skills/slm-remember/SKILL.md +1 -1
  54. package/plugin-src/skills/slm-scope/SKILL.md +1 -1
  55. package/plugin-src/skills/slm-session/SKILL.md +1 -1
  56. package/plugin-src/skills/slm-status/SKILL.md +1 -1
  57. package/scripts/postinstall.js +107 -0
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: slm-getting-started-bot
3
+ description: First-session orientation for SuperLocalMemory on a headless bot host (Grok Bot, or any Cursor-format plugin install with no hooks, no dashboard, and no interactive setup wizard). What is different here vs. Claude Code/Codex, which 18 tools are actually available, and the first three calls to make.
4
+ when_to_use: |
5
+ - The very first session after SLM is installed as a Grok Bot / Cursor plugin
6
+ - "What can I do with SuperLocalMemory here?"
7
+ - A recall or remember call fails and you are not sure why on this host
8
+ - Comparing what works here vs. what the other skills describe for Claude Code
9
+ allowed-tools: session_init, remember, recall, switch_profile
10
+ ---
11
+
12
+ # slm-getting-started-bot — First Session on a Headless Bot Host
13
+
14
+ You are talking to SuperLocalMemory through its MCP server, started as
15
+ `uvx --from superlocalmemory==<version> slm mcp` by the plugin manifest. This
16
+ skill is for the ways that is different from a Claude Code or Codex install —
17
+ read it once per new host, not once per session.
18
+
19
+ ---
20
+
21
+ ## What is NOT available here
22
+
23
+ Grok Bot (and Cursor's plugin host generally) reads only two parts of a
24
+ plugin: `mcpServers` and `skills`. It does not run:
25
+
26
+ - **Hooks** — no automatic session-start context load, no automatic
27
+ checkpoint on session end. Call `session_init` yourself at the start of a
28
+ session if you want prior context; nothing injects it for you.
29
+ - **Slash commands or sub-agents** — the `commands/` and `agents/` components
30
+ other SLM plugins ship are Claude-Code-shaped and are not part of this
31
+ install. Everything you can do here, you do through the MCP tools
32
+ directly.
33
+ - **A dashboard.** There is no browser UI to check on this host. `slm status`
34
+ style information comes back from the tools themselves (`session_init`'s
35
+ response, or asking `recall` for recent memories) — there is nothing to
36
+ click.
37
+ - **`ANTHROPIC_BASE_URL` or any Claude-specific proxy behavior.** SLM does not
38
+ depend on it anywhere; nothing to configure here either way.
39
+
40
+ None of this is a degraded mode — it is the whole surface. Do not tell the
41
+ user a feature is "missing" when it was simply never wired to this host
42
+ format in the first place.
43
+
44
+ ---
45
+
46
+ ## What IS available: the core profile (18 tools)
47
+
48
+ This plugin sets `SLM_MCP_PROFILE=core`, the smallest tool tier, on purpose —
49
+ a shared, memory-tight computer should not load tool descriptions or RAM for
50
+ tiers it will not use. The 18 tools:
51
+
52
+ `remember`, `recall`, `search`, `fetch`, `list_recent`, `update_memory`,
53
+ `forget`, `session_init`, `close_session`, `slm_compress`, `slm_retrieve`,
54
+ `slm_cache_set`, `slm_cache_get`, `slm_optimize_stats`, `review_correction`,
55
+ `list_corrections`, `get_memory_summary`, `switch_profile`.
56
+
57
+ If you are looking at another skill that mentions a tool NOT in this list
58
+ (`build_code_graph`, `mesh_send`, anything governance/compliance-shaped), that
59
+ skill describes a different, larger profile (`code`, `full`, `power`) — it is
60
+ accurate for Claude Code or Codex installs, not for this one, unless someone
61
+ has deliberately reconfigured `SLM_MCP_PROFILE`.
62
+
63
+ ---
64
+
65
+ ## The first three calls on a new host
66
+
67
+ 1. **`session_init`** — nothing runs this automatically here (no hooks), so
68
+ call it yourself at the start of the first real session:
69
+ ```
70
+ session_init(project_path="<where you are working>", query="")
71
+ ```
72
+ Returns recent relevant memories and a session id to pass to later calls.
73
+
74
+ 2. **`remember`** one real fact, before doing anything else, as a smoke test:
75
+ ```
76
+ remember(content="First session on this host, verifying setup.", tags="setup", session_id="<sid>")
77
+ ```
78
+
79
+ 3. **`recall`** it back:
80
+ ```
81
+ recall(query="first session verifying setup", session_id="<sid>")
82
+ ```
83
+ If this returns the fact, the daemon, the embedding path, and the
84
+ CPU-only torch install all worked. If it does not, the result still tells
85
+ you something — see Troubleshooting below.
86
+
87
+ ---
88
+
89
+ ## Cold start is slower here than on a warm laptop
90
+
91
+ The first `remember`/`recall` on a fresh `SLM_DATA_DIR` has to: resolve
92
+ `uvx`'s pinned `superlocalmemory` package, start the daemon, and warm an
93
+ embedding model (and, unless this is the lite profile, a reranker model) —
94
+ tens of seconds, not milliseconds. A `recall` that comes back marked
95
+ `"incomplete"` or with a channel reporting not-ready in that window is not a
96
+ bug; it means the embedding worker had not finished loading yet. Retry once
97
+ rather than assuming something is broken.
98
+
99
+ ---
100
+
101
+ ## This host already runs the lite bot-host profile
102
+
103
+ Unless something overrode it, `mcp.cursor.json` sets `SLM_RERANKER_ENABLED=
104
+ false`, `SLM_RERANKER_IDLE_TIMEOUT=120`, and `SLM_MAX_EMBEDDING_WORKERS=1` —
105
+ the RAM-conscious default for a computer shared by every bot on it. Recall
106
+ still runs every other channel (BM25, semantic, entity graph, temporal,
107
+ spreading activation, Hopfield) and fuses them; it just skips the
108
+ cross-encoder re-ranking pass. If recall quality seems to matter more than
109
+ RAM headroom for your use case, the user can set `SLM_RERANKER_ENABLED=true`
110
+ in the manifest's env block — ask before changing it, since it trades RAM for
111
+ quality on a shared box.
112
+
113
+ ---
114
+
115
+ ## Troubleshooting
116
+
117
+ - **A tool call returns a "profile" or "tool not available" style error** —
118
+ you are probably calling a tool outside the 18-tool core set. Check the
119
+ list above before assuming the server is broken.
120
+ - **Everything times out on the very first call of a session** — likely the
121
+ cold-start warmup described above. Wait and retry once before reporting a
122
+ failure.
123
+ - **You are not sure whether another bot on this computer can see what you
124
+ just stored** — read `slm-bot-memory` before storing anything you would
125
+ not want another bot on this machine to read.
126
+
127
+ ---
128
+
129
+ ## Related skills
130
+
131
+ - `slm-bot-memory` — cross-bot namespacing and what must never be stored
132
+ - `slm-remember` / `slm-recall` — full parameter reference for the two tools
133
+ you will use the most
134
+ - `slm-session` — what `session_init`/`close_session` actually do
135
+
136
+ ---
137
+
138
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -245,4 +245,4 @@ Before running any destructive operation (`forget`, `compact_memories`):
245
245
 
246
246
  ---
247
247
 
248
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
248
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -312,4 +312,4 @@ profile. See `slm-profile` for the full profile switching workflow.
312
312
 
313
313
  ---
314
314
 
315
- SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later
315
+ SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later
@@ -96,4 +96,4 @@ paused, name the approval needed; when errored, quote the short detail.
96
96
 
97
97
  ---
98
98
 
99
- SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later
99
+ SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later
@@ -279,4 +279,4 @@ mesh availability.
279
279
 
280
280
  ---
281
281
 
282
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
282
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -99,7 +99,8 @@ configured MCP server instance.
99
99
 
100
100
  ## Configuring the initial profile
101
101
 
102
- In your `.mcp.json` (Claude Code) or `.codex/config.toml` (Codex):
102
+ Set it where your host defines the MCP server's environment — `.mcp.json` (Claude
103
+ Code), `.codex/config.toml` (Codex), or `mcp.cursor.json` (Cursor / Grok Bot):
103
104
 
104
105
  ```json
105
106
  "env": {
@@ -146,4 +147,4 @@ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
146
147
 
147
148
  ---
148
149
 
149
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
150
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -330,4 +330,4 @@ before recalling, then switch back. See `slm-profile` for workspace switching.
330
330
 
331
331
  ---
332
332
 
333
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
333
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -270,4 +270,4 @@ different workspace, use `switch_profile` first. See `slm-profile`.
270
270
 
271
271
  ---
272
272
 
273
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
273
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -173,4 +173,4 @@ to review the impact. See `slm-remember` for the full deletion discipline.
173
173
 
174
174
  ---
175
175
 
176
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -268,4 +268,4 @@ explicitly and call `recall` with `include_global`/`include_shared` after
268
268
 
269
269
  ---
270
270
 
271
- *SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later*
271
+ *SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later*
@@ -163,4 +163,4 @@ multi-profile setup. To switch the active profile, see `slm-profile`.
163
163
 
164
164
  ---
165
165
 
166
- SuperLocalMemory v4.1.21 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.1.22 · Qualixar · AGPL-3.0-or-later
@@ -21,6 +21,12 @@ const MIN_PYTHON = Object.freeze([3, 12]);
21
21
  const MAX_PYTHON_EXCLUSIVE = Object.freeze([3, 15]);
22
22
  const INSTALL_TIMEOUT_MS = 15 * 60 * 1000;
23
23
 
24
+ // The official CPU-only wheel index (https://pytorch.org/get-started/locally/,
25
+ // fetched 2026-10-06). PyPI's plain `torch` wheel is CPU-only on macOS/Windows but
26
+ // a CUDA build on Linux (torch + triton + ~18 nvidia-* packages, ~2.6 GiB) even
27
+ // with no GPU present to use it.
28
+ const TORCH_CPU_INDEX_URL = 'https://download.pytorch.org/whl/cpu';
29
+
24
30
  function parsePythonVersion(output) {
25
31
  const match = String(output || '').match(/Python\s+(\d+)\.(\d+)(?:\.(\d+))?/i);
26
32
  if (!match) return null;
@@ -107,6 +113,72 @@ function findSupportedPython() {
107
113
  return null;
108
114
  }
109
115
 
116
+ /**
117
+ * Is an NVIDIA GPU visible on this host? Linux-only signal: the three cheap,
118
+ * side-effect-free checks pip itself has no equivalent for. False on any
119
+ * error — a check that cannot tell is not evidence of a GPU.
120
+ * @param {string} platform
121
+ * @returns {boolean}
122
+ */
123
+ function hasNvidiaGpu(platform = os.platform()) {
124
+ if (platform !== 'linux') return false;
125
+ if (fs.existsSync('/proc/driver/nvidia/version') || fs.existsSync('/dev/nvidia0')) {
126
+ return true;
127
+ }
128
+ try {
129
+ const probe = spawnSync('nvidia-smi', [], { stdio: 'ignore', timeout: 2000 });
130
+ return probe.status === 0;
131
+ } catch {
132
+ return false;
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Should this install pre-fetch the CPU-only torch wheel before the
138
+ * main package? Mirrors plugin-src/scripts/torch-cpu-resolve.sh's
139
+ * `torch_cpu_should_force` (same questions, same answers, separate runtime).
140
+ * False covers: not Linux, a GPU is visible, or the user already steered pip
141
+ * (their own index) or torch (SLM_TORCH_BACKEND set to anything but "cpu")
142
+ * themselves.
143
+ * @param {NodeJS.ProcessEnv} env
144
+ * @param {string} platform
145
+ * @param {(platform: string) => boolean} gpuCheck injected for testing
146
+ * @returns {boolean}
147
+ */
148
+ function shouldForceCpuTorch(env = process.env, platform = os.platform(), gpuCheck = hasNvidiaGpu) {
149
+ if (platform !== 'linux') return false;
150
+
151
+ const backend = String(env.SLM_TORCH_BACKEND || '').trim();
152
+ if (backend === 'cpu') return true;
153
+ if (backend) return false; // cuda / cuXXX / auto / ... — the user already decided
154
+
155
+ if (env.PIP_INDEX_URL || env.PIP_EXTRA_INDEX_URL) return false;
156
+
157
+ return !gpuCheck(platform);
158
+ }
159
+
160
+ /**
161
+ * Read the `torch==X.Y.Z` pin shipped at plugin/requirements-cpu-torch.txt
162
+ * (kept equal to pyproject.toml's torch pin by
163
+ * tests/test_plugin_src/test_torch_cpu_pin_matches_pyproject.py). Returns
164
+ * null — fail-open — when the file is missing or has no such line, so a
165
+ * missing/stale pin file can never block an install that would otherwise
166
+ * succeed; it only means this optimization is skipped for this run.
167
+ * @param {string} packageRoot
168
+ * @returns {string | null}
169
+ */
170
+ function cpuTorchPin(packageRoot) {
171
+ const pinFile = path.join(packageRoot, 'plugin', 'requirements-cpu-torch.txt');
172
+ let content;
173
+ try {
174
+ content = fs.readFileSync(pinFile, 'utf8');
175
+ } catch {
176
+ return null;
177
+ }
178
+ const match = content.match(/^torch==\S+/m);
179
+ return match ? match[0].trim() : null;
180
+ }
181
+
110
182
  function runtimePythonPath(packageRoot, platform = os.platform()) {
111
183
  return platform === 'win32'
112
184
  ? path.join(packageRoot, '.slm-venv', 'Scripts', 'python.exe')
@@ -244,6 +316,37 @@ function main(argv = process.argv.slice(2)) {
244
316
  }
245
317
 
246
318
  const runtimePython = runtimePythonPath(packageRoot);
319
+
320
+ // Pre-install the pinned CPU-only torch wheel so the main install
321
+ // below finds it already satisfied and never resolves the CUDA build.
322
+ // Best-effort: a failure here just means this run keeps the default
323
+ // resolution (and therefore the CUDA wheels on Linux) — it must never be
324
+ // the reason the whole install fails.
325
+ if (shouldForceCpuTorch()) {
326
+ const torchPin = cpuTorchPin(packageRoot);
327
+ if (torchPin) {
328
+ console.log(` Linux, no GPU detected — installing ${torchPin} from ${TORCH_CPU_INDEX_URL}`);
329
+ console.log(' (set SLM_TORCH_BACKEND=cuda to opt out).');
330
+ const installTorch = spawnSync(
331
+ runtimePython,
332
+ [
333
+ '-m', 'pip', 'install',
334
+ '--disable-pip-version-check',
335
+ '--no-input',
336
+ '--index-url', TORCH_CPU_INDEX_URL,
337
+ torchPin,
338
+ ],
339
+ { stdio: 'inherit', timeout: INSTALL_TIMEOUT_MS, env: process.env },
340
+ );
341
+ if (installTorch.status !== 0) {
342
+ console.error(
343
+ `SuperLocalMemory: CPU-only torch pre-install failed (${failureDetail(installTorch)}); `
344
+ + 'continuing with the default index.',
345
+ );
346
+ }
347
+ }
348
+ }
349
+
247
350
  const installPackage = spawnSync(
248
351
  runtimePython,
249
352
  [
@@ -322,7 +425,9 @@ if (require.main === module) {
322
425
  }
323
426
 
324
427
  module.exports = {
428
+ cpuTorchPin,
325
429
  findSupportedPython,
430
+ hasNvidiaGpu,
326
431
  isSupportedPython,
327
432
  main,
328
433
  parsePythonVersion,
@@ -330,5 +435,7 @@ module.exports = {
330
435
  pypiSpecifier,
331
436
  pythonCandidates,
332
437
  runtimePythonPath,
438
+ shouldForceCpuTorch,
439
+ TORCH_CPU_INDEX_URL,
333
440
  validateRuntimeLocation,
334
441
  };