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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +145 -0
- package/README.md +72 -46
- package/antigravity-plugin/_GENERATED.md +33 -0
- package/antigravity-plugin/agents/slm-governance-advisor.md +78 -0
- package/antigravity-plugin/agents/slm-loop-runner.md +82 -0
- package/antigravity-plugin/agents/slm-memory-advisor.md +50 -0
- package/antigravity-plugin/agents/slm-optimize-advisor.md +44 -0
- package/antigravity-plugin/commands/slm-loop.md +33 -0
- package/antigravity-plugin/hooks/hooks.json +59 -0
- package/antigravity-plugin/hooks.json +42 -0
- package/antigravity-plugin/mcp_config.json +14 -0
- package/antigravity-plugin/plugin.json +25 -0
- package/antigravity-plugin/scripts/antigravity_hook_adapter.py +85 -0
- package/antigravity-plugin/skills/slm-bot-memory/SKILL.md +146 -0
- package/antigravity-plugin/skills/slm-cache/SKILL.md +147 -0
- package/antigravity-plugin/skills/slm-compress/SKILL.md +150 -0
- package/antigravity-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
- package/antigravity-plugin/skills/slm-governance/SKILL.md +221 -0
- package/antigravity-plugin/skills/slm-graph/SKILL.md +327 -0
- package/antigravity-plugin/skills/slm-loop/SKILL.md +153 -0
- package/antigravity-plugin/skills/slm-mesh/SKILL.md +287 -0
- package/antigravity-plugin/skills/slm-profile/SKILL.md +159 -0
- package/antigravity-plugin/skills/slm-recall/SKILL.md +430 -0
- package/antigravity-plugin/skills/slm-remember/SKILL.md +370 -0
- package/antigravity-plugin/skills/slm-scope/SKILL.md +183 -0
- package/antigravity-plugin/skills/slm-session/SKILL.md +291 -0
- package/antigravity-plugin/skills/slm-status/SKILL.md +185 -0
- package/antigravity-plugin/skills/slm-web-access/SKILL.md +93 -0
- package/codex-plugin/.claude-plugin/plugin.json +19 -0
- package/codex-plugin/.codex/config.toml +40 -0
- package/codex-plugin/.codex-plugin/plugin.json +43 -0
- package/codex-plugin/.mcp.json +16 -0
- package/codex-plugin/AGENTS.md +161 -0
- package/codex-plugin/README.md +205 -0
- package/codex-plugin/_GENERATED.md +52 -0
- package/codex-plugin/agents/slm-governance-advisor.md +78 -0
- package/codex-plugin/agents/slm-loop-runner.md +82 -0
- package/codex-plugin/agents/slm-memory-advisor.md +50 -0
- package/codex-plugin/agents/slm-optimize-advisor.md +44 -0
- package/codex-plugin/commands/slm-loop.md +33 -0
- package/codex-plugin/hooks/hooks.json +59 -0
- package/codex-plugin/scripts/ensure-venv.bat +108 -0
- package/codex-plugin/scripts/ensure-venv.sh +100 -0
- package/codex-plugin/scripts/slm-launch +55 -0
- package/codex-plugin/scripts/slm-launch.bat +30 -0
- package/codex-plugin/skills/slm-bot-memory/SKILL.md +146 -0
- package/codex-plugin/skills/slm-cache/SKILL.md +147 -0
- package/codex-plugin/skills/slm-compress/SKILL.md +150 -0
- package/codex-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
- package/codex-plugin/skills/slm-governance/SKILL.md +221 -0
- package/codex-plugin/skills/slm-graph/SKILL.md +327 -0
- package/codex-plugin/skills/slm-loop/SKILL.md +153 -0
- package/codex-plugin/skills/slm-mesh/SKILL.md +287 -0
- package/codex-plugin/skills/slm-profile/SKILL.md +159 -0
- package/codex-plugin/skills/slm-recall/SKILL.md +430 -0
- package/codex-plugin/skills/slm-remember/SKILL.md +370 -0
- package/codex-plugin/skills/slm-scope/SKILL.md +183 -0
- package/codex-plugin/skills/slm-session/SKILL.md +291 -0
- package/codex-plugin/skills/slm-status/SKILL.md +185 -0
- package/codex-plugin/skills/slm-web-access/SKILL.md +93 -0
- package/copilot-plugin/.github/agents/slm-governance-advisor.agent.md +80 -0
- package/copilot-plugin/.github/agents/slm-loop-runner.agent.md +84 -0
- package/copilot-plugin/.github/agents/slm-memory-advisor.agent.md +52 -0
- package/copilot-plugin/.github/agents/slm-optimize-advisor.agent.md +46 -0
- package/copilot-plugin/.github/copilot-instructions.md +52 -0
- package/copilot-plugin/.github/hooks/slm-hooks.json +44 -0
- package/copilot-plugin/.github/prompts/slm-bot-memory.prompt.md +147 -0
- package/copilot-plugin/.github/prompts/slm-cache.prompt.md +151 -0
- package/copilot-plugin/.github/prompts/slm-compress.prompt.md +154 -0
- package/copilot-plugin/.github/prompts/slm-getting-started-bot.prompt.md +147 -0
- package/copilot-plugin/.github/prompts/slm-governance.prompt.md +224 -0
- package/copilot-plugin/.github/prompts/slm-graph.prompt.md +322 -0
- package/copilot-plugin/.github/prompts/slm-loop.prompt.md +159 -0
- package/copilot-plugin/.github/prompts/slm-mesh.prompt.md +290 -0
- package/copilot-plugin/.github/prompts/slm-profile.prompt.md +155 -0
- package/copilot-plugin/.github/prompts/slm-recall.prompt.md +434 -0
- package/copilot-plugin/.github/prompts/slm-remember.prompt.md +375 -0
- package/copilot-plugin/.github/prompts/slm-scope.prompt.md +183 -0
- package/copilot-plugin/.github/prompts/slm-session.prompt.md +291 -0
- package/copilot-plugin/.github/prompts/slm-status.prompt.md +190 -0
- package/copilot-plugin/.github/prompts/slm-web-access.prompt.md +97 -0
- package/copilot-plugin/.vscode/mcp.json +11 -0
- package/copilot-plugin/README.md +26 -0
- package/copilot-plugin/_GENERATED.md +49 -0
- package/copilot-plugin/scripts/ensure-venv.bat +122 -0
- package/copilot-plugin/scripts/ensure-venv.sh +169 -0
- package/copilot-plugin/scripts/slm-launch +207 -0
- package/copilot-plugin/scripts/slm-launch.bat +32 -0
- package/copilot-plugin/scripts/slm-resolve.sh +128 -0
- package/copilot-plugin/scripts/slm-run +76 -0
- package/copilot-plugin/scripts/torch-cpu-resolve.sh +86 -0
- package/docs/pi-dev-integration.md +0 -2
- package/hermes-plugin/README.md +30 -0
- package/hermes-plugin/_GENERATED.md +3 -0
- package/hermes-plugin/__init__.py +417 -0
- package/hermes-plugin/agents/slm-governance-advisor.md +78 -0
- package/hermes-plugin/agents/slm-loop-runner.md +82 -0
- package/hermes-plugin/agents/slm-memory-advisor.md +50 -0
- package/hermes-plugin/agents/slm-optimize-advisor.md +44 -0
- package/hermes-plugin/command-inventory.json +7 -0
- package/hermes-plugin/plugin.yaml +24 -0
- package/hermes-plugin/remote.py +390 -0
- package/hermes-plugin/skills/slm-bot-memory/SKILL.md +146 -0
- package/hermes-plugin/skills/slm-cache/SKILL.md +147 -0
- package/hermes-plugin/skills/slm-compress/SKILL.md +150 -0
- package/hermes-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
- package/hermes-plugin/skills/slm-governance/SKILL.md +221 -0
- package/hermes-plugin/skills/slm-graph/SKILL.md +327 -0
- package/hermes-plugin/skills/slm-loop/SKILL.md +153 -0
- package/hermes-plugin/skills/slm-mesh/SKILL.md +287 -0
- package/hermes-plugin/skills/slm-profile/SKILL.md +159 -0
- package/hermes-plugin/skills/slm-recall/SKILL.md +430 -0
- package/hermes-plugin/skills/slm-remember/SKILL.md +370 -0
- package/hermes-plugin/skills/slm-scope/SKILL.md +183 -0
- package/hermes-plugin/skills/slm-session/SKILL.md +291 -0
- package/hermes-plugin/skills/slm-status/SKILL.md +185 -0
- package/hermes-plugin/skills/slm-web-access/SKILL.md +93 -0
- package/package.json +9 -18
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/CLAUDE.md +14 -12
- package/plugin/agents/slm-governance-advisor.md +14 -16
- package/plugin/agents/slm-loop-runner.md +22 -11
- package/plugin/agents/slm-memory-advisor.md +14 -14
- package/plugin/agents/slm-optimize-advisor.md +5 -5
- package/plugin/commands/slm-loop.md +5 -3
- package/plugin/cursor-skills/slm-bot-memory/SKILL.md +19 -12
- package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +17 -9
- package/plugin/cursor-skills/slm-recall/SKILL.md +151 -54
- package/plugin/cursor-skills/slm-remember/SKILL.md +132 -35
- package/plugin/cursor-skills/slm-scope/SKILL.md +24 -17
- package/plugin/cursor-skills/slm-session/SKILL.md +77 -57
- package/plugin/mcp.cursor.json +1 -1
- package/plugin/requirements.txt +1 -1
- package/plugin/skills/slm-bot-memory/SKILL.md +19 -12
- package/plugin/skills/slm-cache/SKILL.md +6 -7
- package/plugin/skills/slm-compress/SKILL.md +3 -3
- package/plugin/skills/slm-getting-started-bot/SKILL.md +17 -9
- package/plugin/skills/slm-governance/SKILL.md +126 -153
- package/plugin/skills/slm-graph/SKILL.md +27 -15
- package/plugin/skills/slm-loop/SKILL.md +74 -20
- package/plugin/skills/slm-mesh/SKILL.md +17 -12
- package/plugin/skills/slm-profile/SKILL.md +101 -92
- package/plugin/skills/slm-recall/SKILL.md +151 -54
- package/plugin/skills/slm-remember/SKILL.md +132 -35
- package/plugin/skills/slm-scope/SKILL.md +24 -17
- package/plugin/skills/slm-session/SKILL.md +77 -57
- package/plugin/skills/slm-status/SKILL.md +54 -35
- package/plugin/skills/slm-web-access/SKILL.md +93 -0
- package/plugin-src/agents/slm-governance-advisor.md +78 -0
- package/plugin-src/agents/slm-loop-runner.md +82 -0
- package/plugin-src/agents/slm-memory-advisor.md +14 -14
- package/plugin-src/agents/slm-optimize-advisor.md +5 -5
- package/plugin-src/commands/slm-loop.md +33 -0
- package/plugin-src/rules/AGENTS.md +45 -36
- package/plugin-src/rules/CLAUDE.md.fragment +47 -0
- package/plugin-src/skills/slm-bot-memory/SKILL.md +19 -12
- package/plugin-src/skills/slm-cache/SKILL.md +6 -7
- package/plugin-src/skills/slm-compress/SKILL.md +3 -3
- package/plugin-src/skills/slm-getting-started-bot/SKILL.md +17 -9
- package/plugin-src/skills/slm-governance/SKILL.md +126 -153
- package/plugin-src/skills/slm-graph/SKILL.md +27 -15
- package/plugin-src/skills/slm-loop/SKILL.md +74 -20
- package/plugin-src/skills/slm-mesh/SKILL.md +17 -12
- package/plugin-src/skills/slm-profile/SKILL.md +101 -92
- package/plugin-src/skills/slm-recall/SKILL.md +151 -54
- package/plugin-src/skills/slm-remember/SKILL.md +132 -35
- package/plugin-src/skills/slm-scope/SKILL.md +24 -17
- package/plugin-src/skills/slm-session/SKILL.md +77 -57
- package/plugin-src/skills/slm-status/SKILL.md +54 -35
- package/plugin-src/skills/slm-web-access/SKILL.md +93 -0
|
@@ -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.24 · 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.24 · 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.24 · Qualixar · AGPL-3.0-or-later*
|