superlocalmemory 4.1.22 → 4.1.24

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 (172) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +145 -0
  3. package/README.md +72 -46
  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 +93 -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 +93 -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 +97 -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 +93 -0
  119. package/package.json +9 -18
  120. package/plugin/.claude-plugin/plugin.json +1 -1
  121. package/plugin/.cursor-plugin/plugin.json +1 -1
  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/commands/slm-loop.md +5 -3
  128. package/plugin/cursor-skills/slm-bot-memory/SKILL.md +19 -12
  129. package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +17 -9
  130. package/plugin/cursor-skills/slm-recall/SKILL.md +151 -54
  131. package/plugin/cursor-skills/slm-remember/SKILL.md +132 -35
  132. package/plugin/cursor-skills/slm-scope/SKILL.md +24 -17
  133. package/plugin/cursor-skills/slm-session/SKILL.md +77 -57
  134. package/plugin/mcp.cursor.json +1 -1
  135. package/plugin/requirements.txt +1 -1
  136. package/plugin/skills/slm-bot-memory/SKILL.md +19 -12
  137. package/plugin/skills/slm-cache/SKILL.md +6 -7
  138. package/plugin/skills/slm-compress/SKILL.md +3 -3
  139. package/plugin/skills/slm-getting-started-bot/SKILL.md +17 -9
  140. package/plugin/skills/slm-governance/SKILL.md +126 -153
  141. package/plugin/skills/slm-graph/SKILL.md +27 -15
  142. package/plugin/skills/slm-loop/SKILL.md +74 -20
  143. package/plugin/skills/slm-mesh/SKILL.md +17 -12
  144. package/plugin/skills/slm-profile/SKILL.md +101 -92
  145. package/plugin/skills/slm-recall/SKILL.md +151 -54
  146. package/plugin/skills/slm-remember/SKILL.md +132 -35
  147. package/plugin/skills/slm-scope/SKILL.md +24 -17
  148. package/plugin/skills/slm-session/SKILL.md +77 -57
  149. package/plugin/skills/slm-status/SKILL.md +54 -35
  150. package/plugin/skills/slm-web-access/SKILL.md +93 -0
  151. package/plugin-src/agents/slm-governance-advisor.md +78 -0
  152. package/plugin-src/agents/slm-loop-runner.md +82 -0
  153. package/plugin-src/agents/slm-memory-advisor.md +14 -14
  154. package/plugin-src/agents/slm-optimize-advisor.md +5 -5
  155. package/plugin-src/commands/slm-loop.md +33 -0
  156. package/plugin-src/rules/AGENTS.md +45 -36
  157. package/plugin-src/rules/CLAUDE.md.fragment +47 -0
  158. package/plugin-src/skills/slm-bot-memory/SKILL.md +19 -12
  159. package/plugin-src/skills/slm-cache/SKILL.md +6 -7
  160. package/plugin-src/skills/slm-compress/SKILL.md +3 -3
  161. package/plugin-src/skills/slm-getting-started-bot/SKILL.md +17 -9
  162. package/plugin-src/skills/slm-governance/SKILL.md +126 -153
  163. package/plugin-src/skills/slm-graph/SKILL.md +27 -15
  164. package/plugin-src/skills/slm-loop/SKILL.md +74 -20
  165. package/plugin-src/skills/slm-mesh/SKILL.md +17 -12
  166. package/plugin-src/skills/slm-profile/SKILL.md +101 -92
  167. package/plugin-src/skills/slm-recall/SKILL.md +151 -54
  168. package/plugin-src/skills/slm-remember/SKILL.md +132 -35
  169. package/plugin-src/skills/slm-scope/SKILL.md +24 -17
  170. package/plugin-src/skills/slm-session/SKILL.md +77 -57
  171. package/plugin-src/skills/slm-status/SKILL.md +54 -35
  172. package/plugin-src/skills/slm-web-access/SKILL.md +93 -0
@@ -0,0 +1,154 @@
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
+ version: "4.1.24"
5
+ agent: agent
6
+ tools:
7
+ - slm_compress
8
+ - slm_retrieve
9
+ - Bash
10
+ ---
11
+
12
+ # slm-compress — Reversible Context Compression (Surface B)
13
+
14
+ ## Purpose
15
+
16
+ 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.
17
+
18
+ ## Primary MCP Tool: slm_compress
19
+
20
+ ```
21
+ slm_compress(
22
+ content: str, # required — text to compress (max 1 MB)
23
+ mode: str = "auto", # "normalize" | "auto" | "aggressive"
24
+ reversible: bool = True, # store original in CCR for later retrieval
25
+ ttl_seconds: int = 86400, # CCR lifetime in seconds (default 24 h)
26
+ ) -> dict
27
+ ```
28
+
29
+ ### Return dict (all keys always present)
30
+
31
+ | Key | Type | Meaning |
32
+ |-----|------|---------|
33
+ | `ok` | bool | `True` on success; `False` on internal error or empty input |
34
+ | `compressed` | str | Compressed text (or original on failure) |
35
+ | `strategy` | str | Which strategy was applied (e.g. `"normalize"`, `"none"`) |
36
+ | `tokens_before` | int | Word-count estimate of the input |
37
+ | `tokens_after` | int | Word-count estimate of the output |
38
+ | `ratio` | float | `tokens_after / tokens_before` (lower = more compact) |
39
+ | `lossy` | bool | Whether information was removed |
40
+ | `ccr_id` | str \| None | UUID4 session token; present only when `lossy=True` and `reversible=True` |
41
+ | `note` | str \| None | Human-readable note (e.g. warnings, recovery hint) |
42
+
43
+ ### Mode semantics (verified from source)
44
+
45
+ - **`"normalize"`** — lossless whitespace collapse; no daemon dependency; `lossy: false`, `ccr_id: null`.
46
+ - **`"auto"`** — delegates to `CompressRouter`; may be lossy depending on daemon config; default.
47
+ - **`"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.
48
+
49
+ ## Recovery Tool: slm_retrieve
50
+
51
+ When `slm_compress` returns `lossy: true`, the original is stored under the `ccr_id`. Use `slm_retrieve` to get it back:
52
+
53
+ ```
54
+ slm_retrieve(ccr_id: str) -> dict
55
+ ```
56
+
57
+ | Key | Type | Meaning |
58
+ |-----|------|---------|
59
+ | `ok` | bool | `True` when content was found |
60
+ | `content` | str \| None | Original text, decoded from UTF-8 (or Latin-1 fallback) |
61
+ | `size_bytes` | int | Byte length of the stored original |
62
+ | `error` | str \| None | Error message on failure; `None` on success |
63
+
64
+ `ccr_id` must be a valid UUID4. Non-UUID4 strings return `ok: false` immediately.
65
+
66
+ ### CCR security rule
67
+
68
+ `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:
69
+ - Never log them.
70
+ - Never share them across agents.
71
+ - Never pass them as tool arguments to any tool other than `slm_retrieve`.
72
+ - Never compress a `ccr_id` string itself.
73
+ - They expire after `ttl_seconds` (default 24 h); `slm_retrieve` returns `ok: false` after expiry.
74
+
75
+ ## Decision: When to Compress
76
+
77
+ **Compress when:**
78
+ - A single tool output or transcript exceeds approximately 2 000 characters.
79
+ - You are accumulating repeated context (e.g. full file reads across multiple steps).
80
+ - Context is nearing the point where recall quality or response quality degrades.
81
+
82
+ **Do NOT compress:**
83
+ - Code you are about to read, edit, or diff — you need every character.
84
+ - JSON you will parse programmatically — compression may alter structure.
85
+ - Secrets, credentials, or `ccr_id` strings.
86
+ - Anything under ~500 characters — overhead exceeds benefit.
87
+ - The compressed form of content already compressed this session.
88
+
89
+ ## Fail-Open Guarantee
90
+
91
+ `slm_compress` never raises an exception. On any internal error it returns:
92
+
93
+ ```json
94
+ { "ok": false, "compressed": "<original input>", "ratio": 1.0, ... }
95
+ ```
96
+
97
+ **When `ok` is `false`, continue with the original content.** Never block a task waiting for compression to succeed.
98
+
99
+ ## Worked Example
100
+
101
+ ```python
102
+ # Step 1: compress a large tool output
103
+ result = await slm_compress(
104
+ content=long_log_text,
105
+ mode="auto",
106
+ reversible=True,
107
+ ttl_seconds=3600,
108
+ )
109
+
110
+ if result["ok"]:
111
+ working_text = result["compressed"]
112
+ ccr_id = result["ccr_id"] # None if lossless
113
+ else:
114
+ working_text = long_log_text # fail-open
115
+ ccr_id = None
116
+
117
+ # ... work with working_text ...
118
+
119
+ # Step 2: restore original when needed (e.g. before final summary)
120
+ if ccr_id:
121
+ restore = await slm_retrieve(ccr_id=ccr_id)
122
+ if restore["ok"]:
123
+ original_text = restore["content"]
124
+ ```
125
+
126
+ ## Secondary CLI (fallback when MCP is unavailable)
127
+
128
+ Prefer the MCP tools above. If you must use the command line:
129
+
130
+ ```bash
131
+ slm compress status [--json]
132
+ slm compress mode safe|aggressive [--json]
133
+ slm compress code on|off [--json]
134
+ slm compress prose on|off [--json]
135
+ slm compress ccr on|off [--json]
136
+ slm compress align on|off [--json]
137
+ ```
138
+
139
+ These subcommands control daemon-level compression settings — they do not compress content inline. For inline compression, use `slm_compress` via MCP.
140
+
141
+ ## Size Cap
142
+
143
+ 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"`.
144
+
145
+ ---
146
+
147
+ ## Related skills
148
+
149
+ - `slm-cache` — for repeated reads; use cache-aside before compressing a frequently re-read result
150
+ - `slm-status` — check `tokens_saved_compress` and `compress_runs` from `slm_optimize_stats`
151
+
152
+ ---
153
+
154
+ SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,147 @@
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
+ version: "4.1.24"
5
+ agent: agent
6
+ tools:
7
+ - session_init
8
+ - remember
9
+ - recall
10
+ - switch_profile
11
+ ---
12
+
13
+ # slm-getting-started-bot — First Session on a Headless Bot Host
14
+
15
+ You are talking to SuperLocalMemory through its MCP server, started as
16
+ `uvx --from superlocalmemory==<version> slm mcp` by the plugin manifest. This
17
+ skill is for the ways that is different from a Claude Code or Codex install —
18
+ read it once per new host, not once per session.
19
+
20
+ ---
21
+
22
+ ## What is NOT available here
23
+
24
+ Grok Bot (and Cursor's plugin host generally) reads only two parts of a
25
+ plugin: `mcpServers` and `skills`. It does not run:
26
+
27
+ - **Hooks** — no automatic session-start context load, no automatic
28
+ checkpoint on session end. Call `session_init` yourself at the start of a
29
+ session if you want prior context; nothing injects it for you.
30
+ - **Slash commands or sub-agents** — the `commands/` and `agents/` components
31
+ other SLM plugins ship are Claude-Code-shaped and are not part of this
32
+ install. Everything you can do here, you do through the MCP tools
33
+ directly.
34
+ - **A dashboard.** There is no browser UI to check on this host. `slm status`
35
+ style information comes back from the tools themselves (`session_init`'s
36
+ response, or asking `recall` for recent memories) — there is nothing to
37
+ click.
38
+ - **`ANTHROPIC_BASE_URL` or any Claude-specific proxy behavior.** SLM does not
39
+ depend on it anywhere; nothing to configure here either way.
40
+
41
+ None of this is a degraded mode — it is the whole surface. Do not tell the
42
+ user a feature is "missing" when it was simply never wired to this host
43
+ format in the first place.
44
+
45
+ ---
46
+
47
+ ## What IS available: the core profile (18 tools)
48
+
49
+ This plugin sets `SLM_MCP_PROFILE=core`, the smallest tool tier, on purpose —
50
+ a shared, memory-tight computer should not load tool descriptions or RAM for
51
+ tiers it will not use. The 18 tools:
52
+
53
+ `remember`, `recall`, `search`, `fetch`, `list_recent`, `update_memory`,
54
+ `forget`, `session_init`, `close_session`, `slm_compress`, `slm_retrieve`,
55
+ `slm_cache_set`, `slm_cache_get`, `slm_optimize_stats`, `review_correction`,
56
+ `list_corrections`, `get_memory_summary`, `switch_profile`.
57
+
58
+ If you are looking at another skill that mentions a tool NOT in this list
59
+ (`build_code_graph`, `mesh_send`, `report_outcome`, `delete_memory`,
60
+ `set_memory_kind`, anything governance/compliance-shaped), that skill describes
61
+ a different, larger profile (`code`, `full`, `power`) — it is accurate for Claude
62
+ Code or Codex installs, not for this one, unless someone has deliberately
63
+ reconfigured `SLM_MCP_PROFILE`. Skip those steps rather than reporting an error.
64
+
65
+ Two things the core set does cover that other skills explain: `remember` takes
66
+ `kind` and `replaces` (a newer version of a memory should be saved with
67
+ `replaces=<fact_id>`; see `slm-remember`), and `list_corrections` /
68
+ `review_correction` handle the review of an `update_memory` edit. A bot with
69
+ no one to review should prefer `replaces` over `update_memory`.
70
+
71
+ ---
72
+
73
+ ## The first three calls on a new host
74
+
75
+ 1. **`session_init`** — nothing runs this automatically here (no hooks), so
76
+ call it yourself at the start of the first real session:
77
+ ```
78
+ session_init(project_path="<where you are working>", query="")
79
+ ```
80
+ Returns recent relevant memories and a session id to pass to later calls.
81
+
82
+ 2. **`remember`** one real fact, before doing anything else, as a smoke test:
83
+ ```
84
+ remember(content="First session on this host, verifying setup.", tags="setup", session_id="<sid>")
85
+ ```
86
+
87
+ 3. **`recall`** it back:
88
+ ```
89
+ recall(query="first session verifying setup", session_id="<sid>")
90
+ ```
91
+ If this returns the fact, the daemon, the embedding path, and the
92
+ CPU-only torch install all worked. If it does not, the result still tells
93
+ you something — see Troubleshooting below.
94
+
95
+ ---
96
+
97
+ ## Cold start is slower here than on a warm laptop
98
+
99
+ The first `remember`/`recall` on a fresh `SLM_DATA_DIR` has to: resolve
100
+ `uvx`'s pinned `superlocalmemory` package, start the daemon, and warm an
101
+ embedding model (and, unless this is the lite profile, a reranker model) —
102
+ tens of seconds, not milliseconds. A `recall` whose `channel_status` shows
103
+ `warming` (or `no_embedding`) for some channels in that window is not a bug; it
104
+ means the embedding model had not finished loading yet, and the answer is
105
+ incomplete rather than empty. Retry once rather than assuming something is
106
+ broken.
107
+
108
+ ---
109
+
110
+ ## This host already runs the lite bot-host profile
111
+
112
+ Unless something overrode it, `mcp.cursor.json` sets `SLM_RERANKER_ENABLED=
113
+ false`, `SLM_RERANKER_IDLE_TIMEOUT=120`, and `SLM_MAX_EMBEDDING_WORKERS=1` —
114
+ the RAM-conscious default for a computer shared by every bot on it. Recall
115
+ still runs every other channel (BM25, semantic, entity graph, temporal,
116
+ spreading activation, Hopfield) and fuses them; it just skips the
117
+ cross-encoder re-ranking pass. If recall quality seems to matter more than
118
+ RAM headroom for your use case, the user can set `SLM_RERANKER_ENABLED=true`
119
+ in the manifest's env block — ask before changing it, since it trades RAM for
120
+ quality on a shared box.
121
+
122
+ ---
123
+
124
+ ## Troubleshooting
125
+
126
+ - **A tool call returns a "profile" or "tool not available" style error** —
127
+ you are probably calling a tool outside the 18-tool core set. Check the
128
+ list above before assuming the server is broken.
129
+ - **Everything times out on the very first call of a session** — likely the
130
+ cold-start warmup described above. Wait and retry once before reporting a
131
+ failure.
132
+ - **You are not sure whether another bot on this computer can see what you
133
+ just stored** — read `slm-bot-memory` before storing anything you would
134
+ not want another bot on this machine to read.
135
+
136
+ ---
137
+
138
+ ## Related skills
139
+
140
+ - `slm-bot-memory` — cross-bot namespacing and what must never be stored
141
+ - `slm-remember` / `slm-recall` — full parameter reference for the two tools
142
+ you will use the most
143
+ - `slm-session` — what `session_init`/`close_session` actually do
144
+
145
+ ---
146
+
147
+ *SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later*
@@ -0,0 +1,224 @@
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
+ version: "4.1.24"
5
+ agent: agent
6
+ tools:
7
+ - audit_trail
8
+ - set_retention_policy
9
+ - get_retention_stats
10
+ - get_lifecycle_status
11
+ - compact_memories
12
+ - consistency_check
13
+ - recall
14
+ - search
15
+ - remember
16
+ - Bash
17
+ ---
18
+
19
+ # slm-governance — Governed Workspace Behavior
20
+
21
+ SuperLocalMemory can run with named users and roles per workspace (company
22
+ mode), keeps a compliance audit trail, applies a retention lifecycle, and ships
23
+ GDPR export and erasure commands. This skill documents how an agent must behave
24
+ in a governed workspace and what the governance tools really do. The MCP audit
25
+ and retention tools are in the `power` tool set (see `slm-profile`).
26
+
27
+ ---
28
+
29
+ ## Role model
30
+
31
+ By default SLM is single-user: whoever runs it is the owner and nothing asks for
32
+ a login. Company mode adds named users, each with one role per workspace
33
+ (profile). A role in one workspace grants nothing in another.
34
+
35
+ | Role | Read | Write | Share (`shared`/`global` writes) | Delete | Manage users and settings |
36
+ |------|------|-------|-------|--------|-----------------|
37
+ | `viewer` | Yes | No | No | No | No |
38
+ | `member` | Yes | Yes | Yes | No | No |
39
+ | `admin` | Yes | Yes | Yes | Yes | Yes |
40
+
41
+ **Agent behavior by role:**
42
+
43
+ - **Viewer**: Only call `recall`, `search`, `fetch`, `list_recent` and other
44
+ reads. Never call `remember`, `update_memory`, `delete_memory` or any write
45
+ tool. If a write is refused, say so: "This workspace is read-only for my role."
46
+ - **Member**: May write memories, including `scope="shared"` and `scope="global"`
47
+ when the user explicitly asks for them. May not delete memories or change
48
+ users, roles or settings.
49
+ - **Admin**: Everything above plus deletion and user administration.
50
+
51
+ 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
52
+ what the user asked and treat a permission refusal as final. Setting up users,
53
+ roles and "Require login" is done in the dashboard under **Settings → Access**;
54
+ there is no `slm user` or `slm role` command. The machine operator keeps user
55
+ administration in every mode so a mistake cannot lock everyone out.
56
+
57
+ ---
58
+
59
+ ## require-login
60
+
61
+ When login is required, every operation on memories needs a signed-in user,
62
+ including the connection your assistant uses. SLM handles this at the daemon
63
+ level; agents do not pass credentials in tool calls. If a tool call returns an
64
+ authentication or permission error, you must:
65
+
66
+ 1. Stop the current operation immediately.
67
+ 2. Report the requirement to the user.
68
+ 3. Never cache, retry, or work around the block.
69
+
70
+ In this mode, `include_global=True` and `include_shared=True` on `recall` are
71
+ quietly turned off while the recall policy forbids cross-profile reads (the
72
+ default), so an opt-in recall can come back with only personal facts. Do not try
73
+ to work around it. See `slm-scope`.
74
+
75
+ ---
76
+
77
+ ## Retention and lifecycle
78
+
79
+ Every memory moves through lifecycle states as it goes unused: active, warm, cold,
80
+ archived. Two tools set and inspect that, and a third runs the forgetting cycle.
81
+ They need the `power` tool set.
82
+
83
+ ### Set the thresholds
84
+
85
+ ```
86
+ set_retention_policy(
87
+ cold_after_days: int = 30, # days of inactivity before a memory goes cold
88
+ archive_after_days: int = 90, # days before it is archived
89
+ )
90
+ ```
91
+
92
+ It sets two thresholds and returns them. There is no `profile_id` argument and
93
+ there are no named retention zones or per-tag policies; tagging a memory does not
94
+ route it to a different policy.
95
+
96
+ ### Look at the state
97
+
98
+ ```
99
+ get_retention_stats(profile_id="")
100
+ get_lifecycle_status(limit=50, profile_id="")
101
+ ```
102
+
103
+ `get_retention_stats` reports, from the retention table, the count and average
104
+ retention score per Ebbinghaus zone (`active`, `warm`, `cold`, `archive`,
105
+ `forgotten`) and the totals. `get_lifecycle_status` counts the active, warm, cold
106
+ and archived state of up to `limit` memories and returns up to ten short
107
+ samples of each. Neither says when the next cycle runs.
108
+
109
+ ### Apply it
110
+
111
+ ```
112
+ forget(dry_run=True) # preview the decay cycle for the active profile
113
+ compact_memories(dry_run=True) # preview lifecycle-state transitions
114
+ ```
115
+
116
+ The MCP `forget` tool is not a delete: it recomputes retention scores and moves
117
+ memories between zones. `compact_memories` moves memories whose lifecycle state
118
+ has become due (for example cold to archived); it does not merge duplicates. Both
119
+ default to a dry run. Run the preview first, show it to the user, and only then
120
+ pass `dry_run=False`. Do not run either without the user's say-so.
121
+
122
+ ---
123
+
124
+ ## Audit trail
125
+
126
+ ```
127
+ audit_trail(limit: int = 50)
128
+ ```
129
+
130
+ Returns the newest `limit` rows of the compliance audit for the active profile,
131
+ as `{"success", "entries", "count"}`. Each entry has `audit_id`, `profile_id`,
132
+ `action`, `target_type`, `target_id`, `details` and `timestamp`. There are no
133
+ filter arguments. Entries are compliance actions (store, retrieve, delete, export
134
+ and the like).
135
+
136
+ Use it for compliance reviews, for investigating an unexpected change, and for
137
+ audit reports to a data controller.
138
+
139
+ ---
140
+
141
+ ## GDPR
142
+
143
+ ```bash
144
+ slm gdpr status [--profile P] [--json] # posture: receipts, audit counts, known gaps; read-only
145
+ slm gdpr export --profile P [--output FILE] [--json] # Art. 15/20 access and portability
146
+ slm gdpr erase --profile P --dry-run [--json] # preview an erasure
147
+ slm gdpr erase --profile P --yes [--json] # Art. 17 erasure, IRREVERSIBLE
148
+ slm gdpr verify --receipt-id ID [--profile P] # check an erasure receipt (exit 0 ok, 1 tampered, 2 not found)
149
+ ```
150
+
151
+ `slm gdpr erase` erases a **profile**. It refuses to run without both `--profile`
152
+ and `--yes`, and without them it only previews. It is the only irreversible
153
+ operation here, so confirm the subject, the profile and the authority to erase
154
+ with the user before running it. `slm gdpr status` lists the known gaps (for
155
+ example backups and the code graph) rather than claiming completeness.
156
+
157
+ To remove individual memories rather than a whole profile, use the deletion
158
+ commands from `slm-remember`:
159
+
160
+ ```bash
161
+ slm forget "<subject or project name>" --dry-run --json # ALWAYS first
162
+ slm forget "<subject or project name>" --yes --json
163
+ slm delete <fact_id> --yes --json
164
+ ```
165
+
166
+ Memories that belong to a reviewed correction cannot be deleted this way; the
167
+ refusal names the case. After an erasure, confirm with `slm recall "<content>"`
168
+ that nothing comes back, and never try to re-derive erased content from other
169
+ stored facts.
170
+
171
+ ---
172
+
173
+ ## Scope enforcement in governed workspaces
174
+
175
+ - **Viewers** cannot write anything, whatever the `scope` argument.
176
+ - **Members and admins** can write `shared` and `global` facts; writing either
177
+ scope needs the share permission, which both roles hold.
178
+ - Agents must not split a `global` fact into several `shared` facts, or otherwise
179
+ accumulate visibility the user did not ask for.
180
+
181
+ ---
182
+
183
+ ## Integrity checks
184
+
185
+ ```
186
+ consistency_check(limit: int = 100)
187
+ ```
188
+
189
+ Runs a sheaf-consistency check over up to `limit` memories and returns pairs of
190
+ facts that contradict each other, with a severity (`fact_a`, `fact_b`,
191
+ `severity`, `content_a`), plus `facts_checked`, `facts_errored` and
192
+ `total_contradictions`. If the checker is disabled it says so in `note`. For the
193
+ health of the store itself (orphan rows, erased words left behind, unfinished
194
+ deletes) use `slm db integrity` and `slm db repair`; see `slm-status`.
195
+
196
+ ---
197
+
198
+ ## Agent checklist for governed workspaces
199
+
200
+ Before each write operation:
201
+ - [ ] The user asked for it, and a refusal from the workspace is respected
202
+ - [ ] Scope is `personal` unless the user explicitly asked to share
203
+ - [ ] Pass `session_id` so the write is attributed
204
+
205
+ Before running any destructive or state-changing operation (`forget`,
206
+ `compact_memories`, `slm forget --yes`, `slm gdpr erase --yes`):
207
+ - [ ] The user authorized it in this conversation
208
+ - [ ] Ran the dry run or preview and showed it to the user
209
+ - [ ] GDPR: confirmed the subject or controller authorized the erasure
210
+
211
+ ---
212
+
213
+ ## Related skills
214
+
215
+ - `slm-scope` — scope model details (personal/shared/global)
216
+ - `slm-profile` — memory profiles and tool sets
217
+ - `slm-remember` — fact storage, corrections and deletion
218
+ - `slm-recall` — retrieval reference (includes scope read flags)
219
+ - `slm-mesh` — mesh tools
220
+ - To use this memory from a web assistant or another computer, see the slm-web-access skill.
221
+
222
+ ---
223
+
224
+ *SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later*