superlocalmemory 4.1.21 → 4.1.23

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 (179) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +210 -0
  3. package/README.md +101 -33
  4. package/antigravity-plugin/_GENERATED.md +33 -0
  5. package/antigravity-plugin/agents/slm-governance-advisor.md +78 -0
  6. package/antigravity-plugin/agents/slm-loop-runner.md +82 -0
  7. package/antigravity-plugin/agents/slm-memory-advisor.md +50 -0
  8. package/antigravity-plugin/agents/slm-optimize-advisor.md +44 -0
  9. package/antigravity-plugin/commands/slm-loop.md +33 -0
  10. package/antigravity-plugin/hooks/hooks.json +59 -0
  11. package/antigravity-plugin/hooks.json +42 -0
  12. package/antigravity-plugin/mcp_config.json +14 -0
  13. package/antigravity-plugin/plugin.json +25 -0
  14. package/antigravity-plugin/scripts/antigravity_hook_adapter.py +85 -0
  15. package/antigravity-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  16. package/antigravity-plugin/skills/slm-cache/SKILL.md +147 -0
  17. package/antigravity-plugin/skills/slm-compress/SKILL.md +150 -0
  18. package/antigravity-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  19. package/antigravity-plugin/skills/slm-governance/SKILL.md +221 -0
  20. package/antigravity-plugin/skills/slm-graph/SKILL.md +327 -0
  21. package/antigravity-plugin/skills/slm-loop/SKILL.md +153 -0
  22. package/antigravity-plugin/skills/slm-mesh/SKILL.md +287 -0
  23. package/antigravity-plugin/skills/slm-profile/SKILL.md +159 -0
  24. package/antigravity-plugin/skills/slm-recall/SKILL.md +430 -0
  25. package/antigravity-plugin/skills/slm-remember/SKILL.md +370 -0
  26. package/antigravity-plugin/skills/slm-scope/SKILL.md +183 -0
  27. package/antigravity-plugin/skills/slm-session/SKILL.md +291 -0
  28. package/antigravity-plugin/skills/slm-status/SKILL.md +185 -0
  29. package/antigravity-plugin/skills/slm-web-access/SKILL.md +91 -0
  30. package/codex-plugin/.claude-plugin/plugin.json +19 -0
  31. package/codex-plugin/.codex/config.toml +40 -0
  32. package/codex-plugin/.codex-plugin/plugin.json +43 -0
  33. package/codex-plugin/.mcp.json +16 -0
  34. package/codex-plugin/AGENTS.md +161 -0
  35. package/codex-plugin/README.md +205 -0
  36. package/codex-plugin/_GENERATED.md +52 -0
  37. package/codex-plugin/agents/slm-governance-advisor.md +78 -0
  38. package/codex-plugin/agents/slm-loop-runner.md +82 -0
  39. package/codex-plugin/agents/slm-memory-advisor.md +50 -0
  40. package/codex-plugin/agents/slm-optimize-advisor.md +44 -0
  41. package/codex-plugin/commands/slm-loop.md +33 -0
  42. package/codex-plugin/hooks/hooks.json +59 -0
  43. package/codex-plugin/scripts/ensure-venv.bat +108 -0
  44. package/codex-plugin/scripts/ensure-venv.sh +100 -0
  45. package/codex-plugin/scripts/slm-launch +55 -0
  46. package/codex-plugin/scripts/slm-launch.bat +30 -0
  47. package/codex-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  48. package/codex-plugin/skills/slm-cache/SKILL.md +147 -0
  49. package/codex-plugin/skills/slm-compress/SKILL.md +150 -0
  50. package/codex-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  51. package/codex-plugin/skills/slm-governance/SKILL.md +221 -0
  52. package/codex-plugin/skills/slm-graph/SKILL.md +327 -0
  53. package/codex-plugin/skills/slm-loop/SKILL.md +153 -0
  54. package/codex-plugin/skills/slm-mesh/SKILL.md +287 -0
  55. package/codex-plugin/skills/slm-profile/SKILL.md +159 -0
  56. package/codex-plugin/skills/slm-recall/SKILL.md +430 -0
  57. package/codex-plugin/skills/slm-remember/SKILL.md +370 -0
  58. package/codex-plugin/skills/slm-scope/SKILL.md +183 -0
  59. package/codex-plugin/skills/slm-session/SKILL.md +291 -0
  60. package/codex-plugin/skills/slm-status/SKILL.md +185 -0
  61. package/codex-plugin/skills/slm-web-access/SKILL.md +91 -0
  62. package/copilot-plugin/.github/agents/slm-governance-advisor.agent.md +80 -0
  63. package/copilot-plugin/.github/agents/slm-loop-runner.agent.md +84 -0
  64. package/copilot-plugin/.github/agents/slm-memory-advisor.agent.md +52 -0
  65. package/copilot-plugin/.github/agents/slm-optimize-advisor.agent.md +46 -0
  66. package/copilot-plugin/.github/copilot-instructions.md +52 -0
  67. package/copilot-plugin/.github/hooks/slm-hooks.json +44 -0
  68. package/copilot-plugin/.github/prompts/slm-bot-memory.prompt.md +147 -0
  69. package/copilot-plugin/.github/prompts/slm-cache.prompt.md +151 -0
  70. package/copilot-plugin/.github/prompts/slm-compress.prompt.md +154 -0
  71. package/copilot-plugin/.github/prompts/slm-getting-started-bot.prompt.md +147 -0
  72. package/copilot-plugin/.github/prompts/slm-governance.prompt.md +224 -0
  73. package/copilot-plugin/.github/prompts/slm-graph.prompt.md +322 -0
  74. package/copilot-plugin/.github/prompts/slm-loop.prompt.md +159 -0
  75. package/copilot-plugin/.github/prompts/slm-mesh.prompt.md +290 -0
  76. package/copilot-plugin/.github/prompts/slm-profile.prompt.md +155 -0
  77. package/copilot-plugin/.github/prompts/slm-recall.prompt.md +434 -0
  78. package/copilot-plugin/.github/prompts/slm-remember.prompt.md +375 -0
  79. package/copilot-plugin/.github/prompts/slm-scope.prompt.md +183 -0
  80. package/copilot-plugin/.github/prompts/slm-session.prompt.md +291 -0
  81. package/copilot-plugin/.github/prompts/slm-status.prompt.md +190 -0
  82. package/copilot-plugin/.github/prompts/slm-web-access.prompt.md +95 -0
  83. package/copilot-plugin/.vscode/mcp.json +11 -0
  84. package/copilot-plugin/README.md +26 -0
  85. package/copilot-plugin/_GENERATED.md +49 -0
  86. package/copilot-plugin/scripts/ensure-venv.bat +122 -0
  87. package/copilot-plugin/scripts/ensure-venv.sh +169 -0
  88. package/copilot-plugin/scripts/slm-launch +207 -0
  89. package/copilot-plugin/scripts/slm-launch.bat +32 -0
  90. package/copilot-plugin/scripts/slm-resolve.sh +128 -0
  91. package/copilot-plugin/scripts/slm-run +76 -0
  92. package/copilot-plugin/scripts/torch-cpu-resolve.sh +86 -0
  93. package/docs/pi-dev-integration.md +0 -2
  94. package/hermes-plugin/README.md +30 -0
  95. package/hermes-plugin/_GENERATED.md +3 -0
  96. package/hermes-plugin/__init__.py +417 -0
  97. package/hermes-plugin/agents/slm-governance-advisor.md +78 -0
  98. package/hermes-plugin/agents/slm-loop-runner.md +82 -0
  99. package/hermes-plugin/agents/slm-memory-advisor.md +50 -0
  100. package/hermes-plugin/agents/slm-optimize-advisor.md +44 -0
  101. package/hermes-plugin/command-inventory.json +7 -0
  102. package/hermes-plugin/plugin.yaml +24 -0
  103. package/hermes-plugin/remote.py +390 -0
  104. package/hermes-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  105. package/hermes-plugin/skills/slm-cache/SKILL.md +147 -0
  106. package/hermes-plugin/skills/slm-compress/SKILL.md +150 -0
  107. package/hermes-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  108. package/hermes-plugin/skills/slm-governance/SKILL.md +221 -0
  109. package/hermes-plugin/skills/slm-graph/SKILL.md +327 -0
  110. package/hermes-plugin/skills/slm-loop/SKILL.md +153 -0
  111. package/hermes-plugin/skills/slm-mesh/SKILL.md +287 -0
  112. package/hermes-plugin/skills/slm-profile/SKILL.md +159 -0
  113. package/hermes-plugin/skills/slm-recall/SKILL.md +430 -0
  114. package/hermes-plugin/skills/slm-remember/SKILL.md +370 -0
  115. package/hermes-plugin/skills/slm-scope/SKILL.md +183 -0
  116. package/hermes-plugin/skills/slm-session/SKILL.md +291 -0
  117. package/hermes-plugin/skills/slm-status/SKILL.md +185 -0
  118. package/hermes-plugin/skills/slm-web-access/SKILL.md +91 -0
  119. package/package.json +9 -16
  120. package/plugin/.claude-plugin/plugin.json +2 -2
  121. package/plugin/.cursor-plugin/plugin.json +24 -0
  122. package/plugin/CLAUDE.md +14 -12
  123. package/plugin/agents/slm-governance-advisor.md +14 -16
  124. package/plugin/agents/slm-loop-runner.md +22 -11
  125. package/plugin/agents/slm-memory-advisor.md +14 -14
  126. package/plugin/agents/slm-optimize-advisor.md +5 -5
  127. package/plugin/assets/logo.svg +36 -0
  128. package/plugin/commands/slm-loop.md +5 -3
  129. package/plugin/cursor-skills/slm-bot-memory/SKILL.md +146 -0
  130. package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +146 -0
  131. package/plugin/cursor-skills/slm-recall/SKILL.md +430 -0
  132. package/plugin/cursor-skills/slm-remember/SKILL.md +370 -0
  133. package/plugin/cursor-skills/slm-scope/SKILL.md +183 -0
  134. package/plugin/cursor-skills/slm-session/SKILL.md +291 -0
  135. package/plugin/hooks/hooks.json +9 -9
  136. package/plugin/mcp.cursor.json +23 -0
  137. package/plugin/requirements-cpu-torch.txt +13 -0
  138. package/plugin/requirements.txt +1 -1
  139. package/plugin/scripts/ensure-venv.sh +45 -3
  140. package/plugin/scripts/slm-launch +93 -9
  141. package/plugin/scripts/torch-cpu-resolve.sh +86 -0
  142. package/plugin/skills/slm-bot-memory/SKILL.md +146 -0
  143. package/plugin/skills/slm-cache/SKILL.md +6 -7
  144. package/plugin/skills/slm-compress/SKILL.md +3 -3
  145. package/plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  146. package/plugin/skills/slm-governance/SKILL.md +126 -153
  147. package/plugin/skills/slm-graph/SKILL.md +27 -15
  148. package/plugin/skills/slm-loop/SKILL.md +74 -20
  149. package/plugin/skills/slm-mesh/SKILL.md +17 -12
  150. package/plugin/skills/slm-profile/SKILL.md +101 -91
  151. package/plugin/skills/slm-recall/SKILL.md +151 -54
  152. package/plugin/skills/slm-remember/SKILL.md +132 -35
  153. package/plugin/skills/slm-scope/SKILL.md +24 -17
  154. package/plugin/skills/slm-session/SKILL.md +77 -57
  155. package/plugin/skills/slm-status/SKILL.md +54 -35
  156. package/plugin/skills/slm-web-access/SKILL.md +91 -0
  157. package/plugin-src/agents/slm-governance-advisor.md +78 -0
  158. package/plugin-src/agents/slm-loop-runner.md +82 -0
  159. package/plugin-src/agents/slm-memory-advisor.md +14 -14
  160. package/plugin-src/agents/slm-optimize-advisor.md +5 -5
  161. package/plugin-src/commands/slm-loop.md +33 -0
  162. package/plugin-src/rules/AGENTS.md +45 -36
  163. package/plugin-src/rules/CLAUDE.md.fragment +47 -0
  164. package/plugin-src/skills/slm-bot-memory/SKILL.md +146 -0
  165. package/plugin-src/skills/slm-cache/SKILL.md +6 -7
  166. package/plugin-src/skills/slm-compress/SKILL.md +3 -3
  167. package/plugin-src/skills/slm-getting-started-bot/SKILL.md +146 -0
  168. package/plugin-src/skills/slm-governance/SKILL.md +126 -153
  169. package/plugin-src/skills/slm-graph/SKILL.md +27 -15
  170. package/plugin-src/skills/slm-loop/SKILL.md +74 -20
  171. package/plugin-src/skills/slm-mesh/SKILL.md +17 -12
  172. package/plugin-src/skills/slm-profile/SKILL.md +101 -91
  173. package/plugin-src/skills/slm-recall/SKILL.md +151 -54
  174. package/plugin-src/skills/slm-remember/SKILL.md +132 -35
  175. package/plugin-src/skills/slm-scope/SKILL.md +24 -17
  176. package/plugin-src/skills/slm-session/SKILL.md +77 -57
  177. package/plugin-src/skills/slm-status/SKILL.md +54 -35
  178. package/plugin-src/skills/slm-web-access/SKILL.md +91 -0
  179. package/scripts/postinstall.js +107 -0
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: slm-cache
3
+ description: KV cache for repeated reads — call slm_cache_get(key) first; on a miss do the expensive operation then slm_cache_set(key, value, ttl_seconds) to store it; on a hit use the returned value directly; always fail-open (hit:false on any error, never raises); saves tokens when the same file, query result, or tool output is read more than once in a session.
4
+ when_to_use: "cache file, avoid re-reading, repeated read, cache result, cache tool output, save re-read, reuse across session, cache check, cache hit, cache miss"
5
+ allowed-tools: slm_cache_set, slm_cache_get, Bash
6
+ ---
7
+
8
+ # slm-cache — KV Cache for Repeated Reads (Surface B)
9
+
10
+ ## Purpose
11
+
12
+ When the same file, query result, or expensive tool output is needed more than once in a session, fetching it again wastes tokens and time. `slm_cache_set` stores a result under a stable key; `slm_cache_get` retrieves it on subsequent calls. The cache is agent-scoped (automatically namespaced by tenant/agent ID), TTL-bounded, and fail-open.
13
+
14
+ This is an agent-routed cache — it caches results the agent explicitly routes through SLM. It cannot cache Claude conversation turns.
15
+
16
+ ## Tool: slm_cache_set
17
+
18
+ ```
19
+ slm_cache_set(
20
+ key: str, # required — cache key (max 512 chars)
21
+ value: str, # required — value to store (max 1 MB)
22
+ ttl_seconds: int = 86400, # time-to-live in seconds (default 24 h)
23
+ ) -> dict
24
+ ```
25
+
26
+ ### Return dict
27
+
28
+ | Key | Type | Meaning |
29
+ |-----|------|---------|
30
+ | `ok` | bool | `True` on success; `False` on validation error or internal error |
31
+ | `stored` | bool | `True` when the value was written to the cache |
32
+ | `note` | str \| None | Error detail or `None` on success |
33
+
34
+ Keys are SHA-256-hashed internally per agent so they do not collide across agents. The raw key string you supply is the only handle you need. The namespace is the calling agent (`SLM_AGENT_ID`, or the `/mcp/<agent>` path), not the memory profile, so switching profiles does not give you a fresh cache. A caller on another computer gets its own namespace, keyed by its access key, and can never see a local agent's entries.
35
+
36
+ ## Tool: slm_cache_get
37
+
38
+ ```
39
+ slm_cache_get(
40
+ key: str, # required — same key used in slm_cache_set
41
+ ) -> dict
42
+ ```
43
+
44
+ ### Return dict
45
+
46
+ | Key | Type | Meaning |
47
+ |-----|------|---------|
48
+ | `ok` | bool | `True` on clean execution (including miss); `False` on internal error |
49
+ | `hit` | bool | `True` when the key exists and has not expired |
50
+ | `value` | str \| None | The stored value on a hit; `None` on miss |
51
+ | `note` | str \| None | Error detail or `None` |
52
+
53
+ `value` is the string you stored. A miss returns `{"ok": true, "hit": false, "value": null, "note": null}`. `ok: false` means something went wrong internally but the miss behaviour is the same — treat both as a cache miss and proceed with the real fetch.
54
+
55
+ ## Standard Pattern: Cache-Aside
56
+
57
+ Always check the cache first, then fill on miss:
58
+
59
+ ```python
60
+ # 1. Check cache
61
+ cached = await slm_cache_get(key="file:/absolute/path/to/config.json")
62
+
63
+ if cached["hit"]:
64
+ content = cached["value"]
65
+ else:
66
+ # 2. Expensive operation (file read, search, API call)
67
+ content = read_file("/absolute/path/to/config.json")
68
+
69
+ # 3. Store for the rest of the session
70
+ await slm_cache_set(
71
+ key="file:/absolute/path/to/config.json",
72
+ value=content,
73
+ ttl_seconds=3600, # 1 h — adjust to data volatility
74
+ )
75
+
76
+ # 4. Use content
77
+ ```
78
+
79
+ ## Key Naming Convention
80
+
81
+ Use a stable, human-readable prefix so keys are recognisable in stats and won't collide accidentally:
82
+
83
+ | Content type | Suggested prefix | Example |
84
+ |---|---|---|
85
+ | File read | `file:` | `file:/repo/src/config.py` |
86
+ | Search result | `search:` | `search:recall:session_init_context` |
87
+ | Tool output | `tool:` | `tool:build_code_graph:/repo` |
88
+ | External fetch | `url:` | `url:https://api.example.com/v1/data` |
89
+
90
+ Key length cap: 512 characters. Keys longer than that are rejected (`ok: false`).
91
+
92
+ ## When Caching Pays Off
93
+
94
+ **Cache when:**
95
+ - You will read the same file more than once in a session.
96
+ - A search or recall result is reused across multiple reasoning steps.
97
+ - An expensive MCP tool call (graph build, semantic search) produces output that is stable for the session duration.
98
+
99
+ **Do NOT cache:**
100
+ - Volatile data (live API responses that change minute-to-minute, current timestamps, streaming output).
101
+ - Secrets, credentials, tokens, or `ccr_id` values (CCR already handles its own storage).
102
+ - Data that must be fresh for correctness — a stale cache is worse than a cache miss.
103
+ - Intermediate scratchpad text you will discard.
104
+
105
+ ## Fail-Open Guarantee
106
+
107
+ Neither tool raises an exception. On any internal error:
108
+
109
+ - `slm_cache_get` returns `{"ok": false, "hit": false, "value": null, ...}` — treat as a miss and proceed with the real fetch.
110
+ - `slm_cache_set` returns `{"ok": false, "stored": false, ...}` — log the note if useful, but continue; the value is still available in memory this step.
111
+
112
+ Never block a task on a cache failure.
113
+
114
+ ## TTL Guidance
115
+
116
+ | Data type | Suggested TTL |
117
+ |---|---|
118
+ | Static config / generated file | 86400 s (24 h — the default) |
119
+ | Session-specific tool output | 3600 s (1 h) |
120
+ | Rapidly changing API data | Do not cache, or 60–300 s |
121
+
122
+ Set `ttl_seconds` to match how long the data remains valid. After expiry `slm_cache_get` returns a miss automatically.
123
+
124
+ ## Secondary CLI (fallback when MCP is unavailable)
125
+
126
+ Prefer the MCP tools above. If you must use the command line:
127
+
128
+ ```bash
129
+ slm cache status [--json] [--tenant default]
130
+ slm cache clear [--json] [--tenant default]
131
+ slm cache invalidate --tag <tag> [--json] [--tenant default]
132
+ slm cache ttl --set <seconds> [--semantic <seconds>] [--json] [--tenant default]
133
+ slm cache semantic on|off [--json] [--tenant default]
134
+ ```
135
+
136
+ These subcommands control daemon-level cache settings and bulk removal. They do not read or write individual entries — use the MCP tools for that. Entries written by `slm_cache_set` carry the tag `mcp-kv`, so `slm cache invalidate --tag mcp-kv` removes them, and `slm cache clear` deletes every entry for the tenant.
137
+
138
+ ---
139
+
140
+ ## Related skills
141
+
142
+ - `slm-compress` — for large content reduction; cache and compress work together
143
+ - `slm-status` — view `cache_kv_hits`/`cache_kv_misses` counters (daemon-persisted totals) from `slm_optimize_stats`
144
+
145
+ ---
146
+
147
+ SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: slm-compress
3
+ description: Compress large text, tool output, or transcripts to reduce context-window usage while keeping the full 1M window intact — call slm_compress(content, mode, reversible, ttl_seconds) to shrink content; if the result is lossy a ccr_id is returned so you can call slm_retrieve(ccr_id) later to recover the exact original; always fail-open (ok:false → continue with the original).
4
+ when_to_use: "compress context, shrink output, save tokens, context window full, long transcript, compress tool result, reduce tokens, large output, compress text"
5
+ allowed-tools: slm_compress, slm_retrieve, Bash
6
+ ---
7
+
8
+ # slm-compress — Reversible Context Compression (Surface B)
9
+
10
+ ## Purpose
11
+
12
+ When a tool output, transcript, or accumulated context grows large enough to crowd out working space, `slm_compress` reduces it in-place. The compressed form is used for the remainder of the session; the exact original is recoverable on demand via `slm_retrieve`. This works without a proxy and without touching `ANTHROPIC_BASE_URL`, so the full 1M context window is never sacrificed.
13
+
14
+ ## Primary MCP Tool: slm_compress
15
+
16
+ ```
17
+ slm_compress(
18
+ content: str, # required — text to compress (max 1 MB)
19
+ mode: str = "auto", # "normalize" | "auto" | "aggressive"
20
+ reversible: bool = True, # store original in CCR for later retrieval
21
+ ttl_seconds: int = 86400, # CCR lifetime in seconds (default 24 h)
22
+ ) -> dict
23
+ ```
24
+
25
+ ### Return dict (all keys always present)
26
+
27
+ | Key | Type | Meaning |
28
+ |-----|------|---------|
29
+ | `ok` | bool | `True` on success; `False` on internal error or empty input |
30
+ | `compressed` | str | Compressed text (or original on failure) |
31
+ | `strategy` | str | Which strategy was applied (e.g. `"normalize"`, `"none"`) |
32
+ | `tokens_before` | int | Word-count estimate of the input |
33
+ | `tokens_after` | int | Word-count estimate of the output |
34
+ | `ratio` | float | `tokens_after / tokens_before` (lower = more compact) |
35
+ | `lossy` | bool | Whether information was removed |
36
+ | `ccr_id` | str \| None | UUID4 session token; present only when `lossy=True` and `reversible=True` |
37
+ | `note` | str \| None | Human-readable note (e.g. warnings, recovery hint) |
38
+
39
+ ### Mode semantics (verified from source)
40
+
41
+ - **`"normalize"`** — lossless whitespace collapse; no daemon dependency; `lossy: false`, `ccr_id: null`.
42
+ - **`"auto"`** — delegates to `CompressRouter`; may be lossy depending on daemon config; default.
43
+ - **`"aggressive"`** — requests aggressive compression from the daemon; daemon must have `compress_mode=aggressive` set in config; note field will warn if daemon config does not match.
44
+
45
+ ## Recovery Tool: slm_retrieve
46
+
47
+ When `slm_compress` returns `lossy: true`, the original is stored under the `ccr_id`. Use `slm_retrieve` to get it back:
48
+
49
+ ```
50
+ slm_retrieve(ccr_id: str) -> dict
51
+ ```
52
+
53
+ | Key | Type | Meaning |
54
+ |-----|------|---------|
55
+ | `ok` | bool | `True` when content was found |
56
+ | `content` | str \| None | Original text, decoded from UTF-8 (or Latin-1 fallback) |
57
+ | `size_bytes` | int | Byte length of the stored original |
58
+ | `error` | str \| None | Error message on failure; `None` on success |
59
+
60
+ `ccr_id` must be a valid UUID4. Non-UUID4 strings return `ok: false` immediately.
61
+
62
+ ### CCR security rule
63
+
64
+ `ccr_id` values are **unguessable session tokens**, and the stored original can be read back only by the same agent (or, for a remote caller, the same access key) that compressed it. Treat them like short-lived credentials:
65
+ - Never log them.
66
+ - Never share them across agents.
67
+ - Never pass them as tool arguments to any tool other than `slm_retrieve`.
68
+ - Never compress a `ccr_id` string itself.
69
+ - They expire after `ttl_seconds` (default 24 h); `slm_retrieve` returns `ok: false` after expiry.
70
+
71
+ ## Decision: When to Compress
72
+
73
+ **Compress when:**
74
+ - A single tool output or transcript exceeds approximately 2 000 characters.
75
+ - You are accumulating repeated context (e.g. full file reads across multiple steps).
76
+ - Context is nearing the point where recall quality or response quality degrades.
77
+
78
+ **Do NOT compress:**
79
+ - Code you are about to read, edit, or diff — you need every character.
80
+ - JSON you will parse programmatically — compression may alter structure.
81
+ - Secrets, credentials, or `ccr_id` strings.
82
+ - Anything under ~500 characters — overhead exceeds benefit.
83
+ - The compressed form of content already compressed this session.
84
+
85
+ ## Fail-Open Guarantee
86
+
87
+ `slm_compress` never raises an exception. On any internal error it returns:
88
+
89
+ ```json
90
+ { "ok": false, "compressed": "<original input>", "ratio": 1.0, ... }
91
+ ```
92
+
93
+ **When `ok` is `false`, continue with the original content.** Never block a task waiting for compression to succeed.
94
+
95
+ ## Worked Example
96
+
97
+ ```python
98
+ # Step 1: compress a large tool output
99
+ result = await slm_compress(
100
+ content=long_log_text,
101
+ mode="auto",
102
+ reversible=True,
103
+ ttl_seconds=3600,
104
+ )
105
+
106
+ if result["ok"]:
107
+ working_text = result["compressed"]
108
+ ccr_id = result["ccr_id"] # None if lossless
109
+ else:
110
+ working_text = long_log_text # fail-open
111
+ ccr_id = None
112
+
113
+ # ... work with working_text ...
114
+
115
+ # Step 2: restore original when needed (e.g. before final summary)
116
+ if ccr_id:
117
+ restore = await slm_retrieve(ccr_id=ccr_id)
118
+ if restore["ok"]:
119
+ original_text = restore["content"]
120
+ ```
121
+
122
+ ## Secondary CLI (fallback when MCP is unavailable)
123
+
124
+ Prefer the MCP tools above. If you must use the command line:
125
+
126
+ ```bash
127
+ slm compress status [--json]
128
+ slm compress mode safe|aggressive [--json]
129
+ slm compress code on|off [--json]
130
+ slm compress prose on|off [--json]
131
+ slm compress ccr on|off [--json]
132
+ slm compress align on|off [--json]
133
+ ```
134
+
135
+ These subcommands control daemon-level compression settings — they do not compress content inline. For inline compression, use `slm_compress` via MCP.
136
+
137
+ ## Size Cap
138
+
139
+ Content over 1 MB (1 000 000 bytes UTF-8) is processed but `reversible` is forced to `False` and `ccr_id` will be `None`. The `note` field will state `"content over 1MB: ccr skipped"`.
140
+
141
+ ---
142
+
143
+ ## Related skills
144
+
145
+ - `slm-cache` — for repeated reads; use cache-aside before compressing a frequently re-read result
146
+ - `slm-status` — check `tokens_saved_compress` and `compress_runs` from `slm_optimize_stats`
147
+
148
+ ---
149
+
150
+ SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,146 @@
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`, `report_outcome`, `delete_memory`,
59
+ `set_memory_kind`, anything governance/compliance-shaped), that skill describes
60
+ a different, larger profile (`code`, `full`, `power`) — it is accurate for Claude
61
+ Code or Codex installs, not for this one, unless someone has deliberately
62
+ reconfigured `SLM_MCP_PROFILE`. Skip those steps rather than reporting an error.
63
+
64
+ Two things the core set does cover that other skills explain: `remember` takes
65
+ `kind` and `replaces` (a newer version of a memory should be saved with
66
+ `replaces=<fact_id>`; see `slm-remember`), and `list_corrections` /
67
+ `review_correction` handle the review of an `update_memory` edit. A bot with
68
+ no one to review should prefer `replaces` over `update_memory`.
69
+
70
+ ---
71
+
72
+ ## The first three calls on a new host
73
+
74
+ 1. **`session_init`** — nothing runs this automatically here (no hooks), so
75
+ call it yourself at the start of the first real session:
76
+ ```
77
+ session_init(project_path="<where you are working>", query="")
78
+ ```
79
+ Returns recent relevant memories and a session id to pass to later calls.
80
+
81
+ 2. **`remember`** one real fact, before doing anything else, as a smoke test:
82
+ ```
83
+ remember(content="First session on this host, verifying setup.", tags="setup", session_id="<sid>")
84
+ ```
85
+
86
+ 3. **`recall`** it back:
87
+ ```
88
+ recall(query="first session verifying setup", session_id="<sid>")
89
+ ```
90
+ If this returns the fact, the daemon, the embedding path, and the
91
+ CPU-only torch install all worked. If it does not, the result still tells
92
+ you something — see Troubleshooting below.
93
+
94
+ ---
95
+
96
+ ## Cold start is slower here than on a warm laptop
97
+
98
+ The first `remember`/`recall` on a fresh `SLM_DATA_DIR` has to: resolve
99
+ `uvx`'s pinned `superlocalmemory` package, start the daemon, and warm an
100
+ embedding model (and, unless this is the lite profile, a reranker model) —
101
+ tens of seconds, not milliseconds. A `recall` whose `channel_status` shows
102
+ `warming` (or `no_embedding`) for some channels in that window is not a bug; it
103
+ means the embedding model had not finished loading yet, and the answer is
104
+ incomplete rather than empty. Retry once rather than assuming something is
105
+ broken.
106
+
107
+ ---
108
+
109
+ ## This host already runs the lite bot-host profile
110
+
111
+ Unless something overrode it, `mcp.cursor.json` sets `SLM_RERANKER_ENABLED=
112
+ false`, `SLM_RERANKER_IDLE_TIMEOUT=120`, and `SLM_MAX_EMBEDDING_WORKERS=1` —
113
+ the RAM-conscious default for a computer shared by every bot on it. Recall
114
+ still runs every other channel (BM25, semantic, entity graph, temporal,
115
+ spreading activation, Hopfield) and fuses them; it just skips the
116
+ cross-encoder re-ranking pass. If recall quality seems to matter more than
117
+ RAM headroom for your use case, the user can set `SLM_RERANKER_ENABLED=true`
118
+ in the manifest's env block — ask before changing it, since it trades RAM for
119
+ quality on a shared box.
120
+
121
+ ---
122
+
123
+ ## Troubleshooting
124
+
125
+ - **A tool call returns a "profile" or "tool not available" style error** —
126
+ you are probably calling a tool outside the 18-tool core set. Check the
127
+ list above before assuming the server is broken.
128
+ - **Everything times out on the very first call of a session** — likely the
129
+ cold-start warmup described above. Wait and retry once before reporting a
130
+ failure.
131
+ - **You are not sure whether another bot on this computer can see what you
132
+ just stored** — read `slm-bot-memory` before storing anything you would
133
+ not want another bot on this machine to read.
134
+
135
+ ---
136
+
137
+ ## Related skills
138
+
139
+ - `slm-bot-memory` — cross-bot namespacing and what must never be stored
140
+ - `slm-remember` / `slm-recall` — full parameter reference for the two tools
141
+ you will use the most
142
+ - `slm-session` — what `session_init`/`close_session` actually do
143
+
144
+ ---
145
+
146
+ *SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later*
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: slm-governance
3
+ description: Governed-workspace behavior for SuperLocalMemory. Covers roles (admin/member/viewer) and company mode, retention and lifecycle settings, the audit trail, GDPR export and erasure, and how agents must behave when operating under workspace governance. The audit and retention tools need the power MCP profile. Agents must never bypass governance controls.
4
+ when_to_use: |
5
+ - "What can I do in this workspace?" (role check)
6
+ - "Move cold memories to archive after 60 days"
7
+ - "Show the audit trail for recent memory operations"
8
+ - "Export my data for GDPR compliance"
9
+ - "Delete all memories about user X (right to erasure)"
10
+ - "Turn on require-login for this workspace"
11
+ - Enterprise deployment with multi-team shared SLM
12
+ - Compliance, audit, or data governance task
13
+ allowed-tools: audit_trail, set_retention_policy, get_retention_stats, get_lifecycle_status, compact_memories, consistency_check, recall, search, remember, Bash
14
+ ---
15
+
16
+ # slm-governance — Governed Workspace Behavior
17
+
18
+ SuperLocalMemory can run with named users and roles per workspace (company
19
+ mode), keeps a compliance audit trail, applies a retention lifecycle, and ships
20
+ GDPR export and erasure commands. This skill documents how an agent must behave
21
+ in a governed workspace and what the governance tools really do. The MCP audit
22
+ and retention tools are in the `power` tool set (see `slm-profile`).
23
+
24
+ ---
25
+
26
+ ## Role model
27
+
28
+ By default SLM is single-user: whoever runs it is the owner and nothing asks for
29
+ a login. Company mode adds named users, each with one role per workspace
30
+ (profile). A role in one workspace grants nothing in another.
31
+
32
+ | Role | Read | Write | Share (`shared`/`global` writes) | Delete | Manage users and settings |
33
+ |------|------|-------|-------|--------|-----------------|
34
+ | `viewer` | Yes | No | No | No | No |
35
+ | `member` | Yes | Yes | Yes | No | No |
36
+ | `admin` | Yes | Yes | Yes | Yes | Yes |
37
+
38
+ **Agent behavior by role:**
39
+
40
+ - **Viewer**: Only call `recall`, `search`, `fetch`, `list_recent` and other
41
+ reads. Never call `remember`, `update_memory`, `delete_memory` or any write
42
+ tool. If a write is refused, say so: "This workspace is read-only for my role."
43
+ - **Member**: May write memories, including `scope="shared"` and `scope="global"`
44
+ when the user explicitly asks for them. May not delete memories or change
45
+ users, roles or settings.
46
+ - **Admin**: Everything above plus deletion and user administration.
47
+
48
+ No MCP tool or `slm` command reports your role (only a signed-in dashboard session can ask the daemon, at `GET /api/rbac/whoami`). Do not guess it: attempt
49
+ what the user asked and treat a permission refusal as final. Setting up users,
50
+ roles and "Require login" is done in the dashboard under **Settings → Access**;
51
+ there is no `slm user` or `slm role` command. The machine operator keeps user
52
+ administration in every mode so a mistake cannot lock everyone out.
53
+
54
+ ---
55
+
56
+ ## require-login
57
+
58
+ When login is required, every operation on memories needs a signed-in user,
59
+ including the connection your assistant uses. SLM handles this at the daemon
60
+ level; agents do not pass credentials in tool calls. If a tool call returns an
61
+ authentication or permission error, you must:
62
+
63
+ 1. Stop the current operation immediately.
64
+ 2. Report the requirement to the user.
65
+ 3. Never cache, retry, or work around the block.
66
+
67
+ In this mode, `include_global=True` and `include_shared=True` on `recall` are
68
+ quietly turned off while the recall policy forbids cross-profile reads (the
69
+ default), so an opt-in recall can come back with only personal facts. Do not try
70
+ to work around it. See `slm-scope`.
71
+
72
+ ---
73
+
74
+ ## Retention and lifecycle
75
+
76
+ Every memory moves through lifecycle states as it goes unused: active, warm, cold,
77
+ archived. Two tools set and inspect that, and a third runs the forgetting cycle.
78
+ They need the `power` tool set.
79
+
80
+ ### Set the thresholds
81
+
82
+ ```
83
+ set_retention_policy(
84
+ cold_after_days: int = 30, # days of inactivity before a memory goes cold
85
+ archive_after_days: int = 90, # days before it is archived
86
+ )
87
+ ```
88
+
89
+ It sets two thresholds and returns them. There is no `profile_id` argument and
90
+ there are no named retention zones or per-tag policies; tagging a memory does not
91
+ route it to a different policy.
92
+
93
+ ### Look at the state
94
+
95
+ ```
96
+ get_retention_stats(profile_id="")
97
+ get_lifecycle_status(limit=50, profile_id="")
98
+ ```
99
+
100
+ `get_retention_stats` reports, from the retention table, the count and average
101
+ retention score per Ebbinghaus zone (`active`, `warm`, `cold`, `archive`,
102
+ `forgotten`) and the totals. `get_lifecycle_status` counts the active, warm, cold
103
+ and archived state of up to `limit` memories and returns up to ten short
104
+ samples of each. Neither says when the next cycle runs.
105
+
106
+ ### Apply it
107
+
108
+ ```
109
+ forget(dry_run=True) # preview the decay cycle for the active profile
110
+ compact_memories(dry_run=True) # preview lifecycle-state transitions
111
+ ```
112
+
113
+ The MCP `forget` tool is not a delete: it recomputes retention scores and moves
114
+ memories between zones. `compact_memories` moves memories whose lifecycle state
115
+ has become due (for example cold to archived); it does not merge duplicates. Both
116
+ default to a dry run. Run the preview first, show it to the user, and only then
117
+ pass `dry_run=False`. Do not run either without the user's say-so.
118
+
119
+ ---
120
+
121
+ ## Audit trail
122
+
123
+ ```
124
+ audit_trail(limit: int = 50)
125
+ ```
126
+
127
+ Returns the newest `limit` rows of the compliance audit for the active profile,
128
+ as `{"success", "entries", "count"}`. Each entry has `audit_id`, `profile_id`,
129
+ `action`, `target_type`, `target_id`, `details` and `timestamp`. There are no
130
+ filter arguments. Entries are compliance actions (store, retrieve, delete, export
131
+ and the like).
132
+
133
+ Use it for compliance reviews, for investigating an unexpected change, and for
134
+ audit reports to a data controller.
135
+
136
+ ---
137
+
138
+ ## GDPR
139
+
140
+ ```bash
141
+ slm gdpr status [--profile P] [--json] # posture: receipts, audit counts, known gaps; read-only
142
+ slm gdpr export --profile P [--output FILE] [--json] # Art. 15/20 access and portability
143
+ slm gdpr erase --profile P --dry-run [--json] # preview an erasure
144
+ slm gdpr erase --profile P --yes [--json] # Art. 17 erasure, IRREVERSIBLE
145
+ slm gdpr verify --receipt-id ID [--profile P] # check an erasure receipt (exit 0 ok, 1 tampered, 2 not found)
146
+ ```
147
+
148
+ `slm gdpr erase` erases a **profile**. It refuses to run without both `--profile`
149
+ and `--yes`, and without them it only previews. It is the only irreversible
150
+ operation here, so confirm the subject, the profile and the authority to erase
151
+ with the user before running it. `slm gdpr status` lists the known gaps (for
152
+ example backups and the code graph) rather than claiming completeness.
153
+
154
+ To remove individual memories rather than a whole profile, use the deletion
155
+ commands from `slm-remember`:
156
+
157
+ ```bash
158
+ slm forget "<subject or project name>" --dry-run --json # ALWAYS first
159
+ slm forget "<subject or project name>" --yes --json
160
+ slm delete <fact_id> --yes --json
161
+ ```
162
+
163
+ Memories that belong to a reviewed correction cannot be deleted this way; the
164
+ refusal names the case. After an erasure, confirm with `slm recall "<content>"`
165
+ that nothing comes back, and never try to re-derive erased content from other
166
+ stored facts.
167
+
168
+ ---
169
+
170
+ ## Scope enforcement in governed workspaces
171
+
172
+ - **Viewers** cannot write anything, whatever the `scope` argument.
173
+ - **Members and admins** can write `shared` and `global` facts; writing either
174
+ scope needs the share permission, which both roles hold.
175
+ - Agents must not split a `global` fact into several `shared` facts, or otherwise
176
+ accumulate visibility the user did not ask for.
177
+
178
+ ---
179
+
180
+ ## Integrity checks
181
+
182
+ ```
183
+ consistency_check(limit: int = 100)
184
+ ```
185
+
186
+ Runs a sheaf-consistency check over up to `limit` memories and returns pairs of
187
+ facts that contradict each other, with a severity (`fact_a`, `fact_b`,
188
+ `severity`, `content_a`), plus `facts_checked`, `facts_errored` and
189
+ `total_contradictions`. If the checker is disabled it says so in `note`. For the
190
+ health of the store itself (orphan rows, erased words left behind, unfinished
191
+ deletes) use `slm db integrity` and `slm db repair`; see `slm-status`.
192
+
193
+ ---
194
+
195
+ ## Agent checklist for governed workspaces
196
+
197
+ Before each write operation:
198
+ - [ ] The user asked for it, and a refusal from the workspace is respected
199
+ - [ ] Scope is `personal` unless the user explicitly asked to share
200
+ - [ ] Pass `session_id` so the write is attributed
201
+
202
+ Before running any destructive or state-changing operation (`forget`,
203
+ `compact_memories`, `slm forget --yes`, `slm gdpr erase --yes`):
204
+ - [ ] The user authorized it in this conversation
205
+ - [ ] Ran the dry run or preview and showed it to the user
206
+ - [ ] GDPR: confirmed the subject or controller authorized the erasure
207
+
208
+ ---
209
+
210
+ ## Related skills
211
+
212
+ - `slm-scope` — scope model details (personal/shared/global)
213
+ - `slm-profile` — memory profiles and tool sets
214
+ - `slm-remember` — fact storage, corrections and deletion
215
+ - `slm-recall` — retrieval reference (includes scope read flags)
216
+ - `slm-mesh` — mesh tools
217
+ - To use this memory from a web assistant or another computer, see the slm-web-access skill.
218
+
219
+ ---
220
+
221
+ *SuperLocalMemory v4.1.23 · Qualixar · AGPL-3.0-or-later*