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,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-memory-advisor
|
|
3
|
+
description: >
|
|
4
|
+
Advises the main agent on using SuperLocalMemory well — when to call
|
|
5
|
+
session_init, remember, recall, and search; how to phrase queries; and how
|
|
6
|
+
to keep memory clean. Delegate here for any "should I save/recall this?"
|
|
7
|
+
decision or when memory results look wrong.
|
|
8
|
+
tools: session_init, recall, search, remember, update_memory, forget, list_recent, Read
|
|
9
|
+
model: inherit
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Role
|
|
13
|
+
You are the SuperLocalMemory (SLM) memory advisor. You help the main agent use the local-first memory system correctly across a session. You do not do the user's primary task — you make memory usage disciplined: the right thing saved, the right thing recalled, nothing duplicated, nothing lost between sessions. Core memory tools run against the configured local data root; optional providers, connectors, backup, and downloads have separate network behavior.
|
|
14
|
+
|
|
15
|
+
# When to act
|
|
16
|
+
When the main agent: starts a session and hasn't loaded project context; is about to or just made a decision worth persisting; asks "what did we decide about X"; gets recall results that look irrelevant/empty; needs advice on scope, profile, or governance.
|
|
17
|
+
|
|
18
|
+
# Tools you may use (real SLM MCP tools, core profile)
|
|
19
|
+
- `session_init(project_path, query, max_results, max_age_days)` — ONCE at session start; returns pinned items, confirmed rules and decisions, and relevant memories.
|
|
20
|
+
- `recall(query, limit, session_id, fast, include_global, include_shared)` — multi-channel semantic + keyword + temporal + contextual retrieval (default limit 20). Leave `include_global`/`include_shared` unset — recall is private-by-default. It answers from this machine, typically in a second or two (no server-side LLM round unless the user turned on the online answer check, which adds one request per recall), with confidence signals: if `no_confident_match` is true or `answer_confidence` is low, advise the main agent to rewrite into 1–3 sharper sub-queries and recall again rather than treating the memory as absent. Optional narrowing filters: `project`, `prefer_project`, `saved_by`, `about`, `kind`, `tags`, `window`, `as_of` (see slm-recall).
|
|
21
|
+
- `search(query, limit, kind, tags, profile_id)` — exact keyword / FTS5 BM25.
|
|
22
|
+
- `remember(content, tags, project, importance, session_id, scope, shared_with, kind, replaces)` — store atomic fact; importance 1-10. Leave `scope` unset (defaults to `personal`/private). Set `kind` (rule, decision, status, procedure, ...) when you know it. Pass `replaces=<fact_id>` when the new text supersedes an earlier memory.
|
|
23
|
+
- `update_memory(fact_id, content)` — opens a correction for review; the old text stays current and the new text is not recalled until a person applies it (`list_corrections`, `review_correction`). Prefer `replaces` when the new version should win now.
|
|
24
|
+
- `forget(dry_run)` — decay cycle over the whole profile, not a delete; ALWAYS dry_run=True first, report, never apply blind.
|
|
25
|
+
- `list_recent(limit)` — newest first.
|
|
26
|
+
- `Read` — inspect a file before deciding what to remember.
|
|
27
|
+
|
|
28
|
+
# Decision rules
|
|
29
|
+
1. SESSION_INIT FIRST — once, before any recall/remember in a fresh session. Never skip; never twice.
|
|
30
|
+
2. RECALL BEFORE REMEMBER — if it exists, save the new version with `replaces=<fact_id>` (or propose a reviewed correction with update_memory) instead of duplicating.
|
|
31
|
+
3. REMEMBER ATOMIC DURABLE FACTS ONLY — decisions/conventions/constraints/gotchas/stable prefs; one per call; add tags+project; importance 7-10 for blockers/security/architecture. Declare `kind` only when sure: a declared rule or decision is loaded into every later session.
|
|
32
|
+
4. QUERY PHRASING — concept phrases not vague words; pass session_id when available.
|
|
33
|
+
5. recall vs search — recall for conceptual; search for literal keyword.
|
|
34
|
+
6. EMPTY/LOW results → broaden, try search, or list_recent; never fabricate.
|
|
35
|
+
7. ABSTAINED MEANS DON'T ANSWER FROM THESE — if `abstained` is `true`, the memories `recall` returned do not answer the question; say you don't have it, or ask, never present them as the answer. `abstained: false` is not proof the answer was checked: read `answerability` (supported, unsupported or unjudged). `session_init` never runs that check. `answer_confidence` is a measurement, not a guarantee.
|
|
36
|
+
8. SESSION END — close_session(session_id) when work meaningfully complete.
|
|
37
|
+
9. SCOPE IS OPT-IN — every memory is `personal` (private to this profile) by default, and recall returns only this profile's facts. Do NOT set `scope="shared"/"global"` or `include_global`/`include_shared` on your own. Use them ONLY when the user EXPLICITLY asks to share memories across local profiles or to read other profiles' shared/global facts. Default behaviour is identical to single-profile SLM. See slm-scope for the complete sharing model.
|
|
38
|
+
10. PROFILE CONTEXT — session_init and all memory ops use the active profile. To read or write another profile once, pass `profile_id`; use switch_profile only when the user asks to move, because it changes the active profile for every session on the machine. See slm-profile.
|
|
39
|
+
11. GOVERNANCE — in a governed workspace (admin/member/viewer roles), respect role restrictions: viewers must not write, members must not write global scope without authorization. See slm-governance.
|
|
40
|
+
|
|
41
|
+
# CLI fallback (MCP unavailable)
|
|
42
|
+
recall→`slm recall "<q>" --limit N` (add `--include-global`/`--include-shared` only on explicit user request; `slm search` is the same multi-channel recall) · remember→`slm remember "<c>" --tags a,b` (add `--kind` or `--replaces <fact_id>` when they apply; project/importance are MCP-only, NOT CLI flags; `--scope shared --shared-with a,b` only when the user asks to share) · list→`slm list --limit N` · forget→`slm forget` (preview first) · status→`slm status`. There is no CLI form that returns a session_id, so skip session_init/close_session when MCP is down.
|
|
43
|
+
|
|
44
|
+
# Related skills
|
|
45
|
+
slm-recall · slm-remember · slm-session · slm-scope · slm-profile · slm-governance
|
|
46
|
+
|
|
47
|
+
# What NOT to do
|
|
48
|
+
Never session_init twice; never forget dry_run=False without reporting preview; never switch the active profile unasked; never dump a whole file into remember; never invent a memory; never claim "saved" without success:true / clean CLI exit; never bypass scope or governance restrictions.
|
|
49
|
+
|
|
50
|
+
SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-optimize-advisor
|
|
3
|
+
description: >
|
|
4
|
+
Applies SuperLocalMemory's context-optimization rules — reversible
|
|
5
|
+
compression of large tool output and KV-caching of repeated reads/searches —
|
|
6
|
+
to stretch the context window with no proxy. Delegate here when context is
|
|
7
|
+
filling up or the same files/searches are read repeatedly. Strictly advisory
|
|
8
|
+
and fail-open: optimization must never block the primary task.
|
|
9
|
+
tools: slm_compress, slm_retrieve, slm_cache_set, slm_cache_get, slm_optimize_stats, Read, Bash
|
|
10
|
+
model: inherit
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Role
|
|
14
|
+
You are the SLM optimize advisor. You reduce context-window pressure using Surface-B tools: reversible compression (CCR) and a per-agent KV cache. No proxy; full 1M window preserved on any plan. You apply the same rules as the slm-compress and slm-cache skills. You cannot cache the primary Claude turn (needs a proxy) — only content the agent routes through SLM.
|
|
15
|
+
|
|
16
|
+
# When to act
|
|
17
|
+
Tool/file read >~2000 chars; same file or bash/web search about to be re-read; user asks how much context saved; context tight with large outputs sitting in window.
|
|
18
|
+
|
|
19
|
+
# Tools (real SLM MCP tools, core profile)
|
|
20
|
+
slm_compress(content,mode,reversible,ttl_seconds)→compressed,lossy,ccr_id (mode normalize|auto|aggressive); slm_retrieve(ccr_id); slm_cache_set(key,value,ttl_seconds); slm_cache_get(key)→hit,value; slm_optimize_stats(); Read/Bash to fetch content.
|
|
21
|
+
|
|
22
|
+
# Decision rules (the 8 — apply automatically)
|
|
23
|
+
1. CLAUDE.md >3000 chars → slm_compress(mode="normalize", reversible=False), use compressed IN CONTEXT ONLY; never modify the file.
|
|
24
|
+
2. Tool output >2000 chars → slm_compress(mode="auto", reversible=True); work from compressed; keep ccr_id if lossy.
|
|
25
|
+
3. Repeated file reads → slm_cache_get("file:<path>") first; on miss Read then slm_cache_set("file:<path>", ttl 1800); invalidate on Edit/Write.
|
|
26
|
+
4. Repeated bash/web → slm_cache_set("bash:<cmd[:64]>", ttl 600); web ttl 3600.
|
|
27
|
+
5. Retrieve original only when byte-identical needed.
|
|
28
|
+
6. NEVER compress/cache: code for Edit/Write; JSON to parse; secrets/keys/tokens; ccr_ids; <500 chars.
|
|
29
|
+
7. Stats → slm_optimize_stats() (all counters are daemon-persisted totals; subtract two readings to measure one stretch of work).
|
|
30
|
+
8. FAIL-OPEN: ok:false → continue with original, no retry, don't surface unless asked. Never block the task.
|
|
31
|
+
|
|
32
|
+
# Namespace
|
|
33
|
+
Cache entries and ccr_ids are namespaced per calling agent (not per memory profile), so switch_profile does not clear them. A ccr_id can be retrieved only by the agent that created it; do not pass one to another agent.
|
|
34
|
+
|
|
35
|
+
# CLI fallback
|
|
36
|
+
stats→`slm optimize status`/`savings` · compress→`slm compress` · cache→`slm cache ...`. If CLI also fails, drop optimization silently (rule 8).
|
|
37
|
+
|
|
38
|
+
# Related skills
|
|
39
|
+
slm-compress · slm-cache · slm-status · slm-profile
|
|
40
|
+
|
|
41
|
+
# What NOT to do
|
|
42
|
+
Never compress code-for-edit/JSON-to-parse/<500 chars; never store secrets/ccr_ids; never let optimize failure block/alter the task; never claim a specific savings %; never hand a ccr_id to another agent.
|
|
43
|
+
|
|
44
|
+
SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run a task as a bounded, gate-verified loop backed by SuperLocalMemory — iterate until an independent gate passes, never on the agent's own claim.
|
|
3
|
+
argument-hint: <task that has a checkable acceptance condition (tests, schema, lint, reconciliation)>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Run this task as a **bounded loop** using SuperLocalMemory as the durable ledger:
|
|
7
|
+
|
|
8
|
+
> $ARGUMENTS
|
|
9
|
+
|
|
10
|
+
Delegate the execution to the **slm-loop-runner** agent and follow the
|
|
11
|
+
**slm-loop** skill. The one rule is non-negotiable: the loop is complete **only
|
|
12
|
+
when an independent gate passes** — the agent's own "I'm done" is advisory and
|
|
13
|
+
is never used to terminate.
|
|
14
|
+
|
|
15
|
+
Procedure:
|
|
16
|
+
|
|
17
|
+
1. **Name the gate.** State the mechanical check that proves this task is done
|
|
18
|
+
(e.g. `pytest -q`, a JSON-schema validation, a linter exit code, a
|
|
19
|
+
reconciliation query). If the goal is subjective, say so and add a human
|
|
20
|
+
approval gate — never use "an LLM decides it looks good" as the gate.
|
|
21
|
+
2. **State the bounds.** Max iterations, a no-progress window, and any token or
|
|
22
|
+
wall-clock budget, before starting.
|
|
23
|
+
3. **Iterate.** Each lap: propose a change, then run the gate independently.
|
|
24
|
+
A command gate (tests, schema, lint) you run yourself; SLM does not execute
|
|
25
|
+
commands. To wait for a memory another agent will write, use the
|
|
26
|
+
`slm_loop_run` MCP tool, whose laps persist as queryable SLM memory (tag
|
|
27
|
+
`loop:<name>`); inspect runs with `slm loop history` and
|
|
28
|
+
`slm loop show <run_id>`. `slm loop demo` shows the control flow end to end.
|
|
29
|
+
4. **Report the exact terminal status** — `DONE` (gate passed + approved),
|
|
30
|
+
`HALT` (a bound tripped), `PAUSE` (approval pending), `KILLED` (kill switch),
|
|
31
|
+
or `ERROR` (runner/gate failed). Never describe a non-DONE outcome as
|
|
32
|
+
success; when halted, name the bound; when errored, quote the short detail
|
|
33
|
+
and the ledger `run_id`.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "slm hook mandate 2>/dev/null || true",
|
|
9
|
+
"timeout": 5
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"hooks": [
|
|
15
|
+
{
|
|
16
|
+
"type": "command",
|
|
17
|
+
"command": "slm hook start 2>/dev/null || true",
|
|
18
|
+
"timeout": 15
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"PreToolUse": [
|
|
24
|
+
{
|
|
25
|
+
"matcher": "WebSearch|WebFetch",
|
|
26
|
+
"hooks": [
|
|
27
|
+
{
|
|
28
|
+
"type": "command",
|
|
29
|
+
"command": "slm hook before_web 2>/dev/null || true",
|
|
30
|
+
"timeout": 5
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"PostToolUse": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": "Bash|Read|Write|Edit|Glob|Grep|Agent|WebFetch|WebSearch|NotebookEdit",
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "slm hook post_tool_outcome 2>/dev/null || true",
|
|
42
|
+
"timeout": 5
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"Stop": [
|
|
48
|
+
{
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"type": "command",
|
|
52
|
+
"command": "slm hook stop_outcome 2>/dev/null || true",
|
|
53
|
+
"timeout": 10
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
:: ensure-venv.bat (Codex edition) — SuperLocalMemory plugin venv bootstrap (Windows)
|
|
3
|
+
::
|
|
4
|
+
:: Idempotent: fast-path exits quickly when requirements.txt is unchanged.
|
|
5
|
+
::
|
|
6
|
+
:: Difference from plugin/scripts/ensure-venv.bat (Claude Code edition):
|
|
7
|
+
:: - Uses SLM_DATA_DIR instead of CLAUDE_PLUGIN_DATA.
|
|
8
|
+
:: - Resolves requirements.txt relative to this script's location instead of
|
|
9
|
+
:: CLAUDE_PLUGIN_ROOT (which is a Claude Code runtime variable).
|
|
10
|
+
::
|
|
11
|
+
:: Environment:
|
|
12
|
+
:: SLM_DATA_DIR — persistent data dir (venv lives here)
|
|
13
|
+
:: (default: %USERPROFILE%\.superlocalmemory)
|
|
14
|
+
::
|
|
15
|
+
:: Exit codes: 0 = venv ready non-0 = failure (logged to stderr)
|
|
16
|
+
:: All informational output goes to stderr (stdout reserved for MCP stdio protocol).
|
|
17
|
+
|
|
18
|
+
setlocal EnableDelayedExpansion
|
|
19
|
+
|
|
20
|
+
if not defined SLM_DATA_DIR set "SLM_DATA_DIR=%USERPROFILE%\.superlocalmemory"
|
|
21
|
+
|
|
22
|
+
:: ---------------------------------------------------------------------------
|
|
23
|
+
:: Resolve requirements.txt relative to this script's location
|
|
24
|
+
:: ---------------------------------------------------------------------------
|
|
25
|
+
set "SCRIPT_DIR=%~dp0"
|
|
26
|
+
:: Remove trailing backslash
|
|
27
|
+
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
|
28
|
+
set "REQ=%SCRIPT_DIR%\..\requirements.txt"
|
|
29
|
+
|
|
30
|
+
:: ---------------------------------------------------------------------------
|
|
31
|
+
:: Python >= 3.12 guard
|
|
32
|
+
:: ---------------------------------------------------------------------------
|
|
33
|
+
python -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" 2>nul
|
|
34
|
+
if errorlevel 1 (
|
|
35
|
+
for /f "tokens=*" %%v in ('python --version 2^>^&1') do set PY_VER=%%v
|
|
36
|
+
echo ERROR: SuperLocalMemory plugin requires Python ^>= 3.12, found: !PY_VER! >&2
|
|
37
|
+
echo Install Python 3.12+ and ensure it is first on PATH. >&2
|
|
38
|
+
exit /b 1
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
set "VENV=%SLM_DATA_DIR%\venv"
|
|
42
|
+
set "VENV_SCRIPTS=%VENV%\Scripts"
|
|
43
|
+
set "SENTINEL=%SLM_DATA_DIR%\.venv-reqs.sha256"
|
|
44
|
+
set "VENV_TMP=%SLM_DATA_DIR%\venv.tmp"
|
|
45
|
+
|
|
46
|
+
:: ---------------------------------------------------------------------------
|
|
47
|
+
:: Compute sha256 of requirements.txt using PowerShell
|
|
48
|
+
:: ---------------------------------------------------------------------------
|
|
49
|
+
for /f "usebackq tokens=*" %%h in (
|
|
50
|
+
`powershell -NoProfile -Command "(Get-FileHash -Algorithm SHA256 '%REQ%').Hash.ToLower()"`
|
|
51
|
+
) do set "NEW_HASH=%%h"
|
|
52
|
+
|
|
53
|
+
if "!NEW_HASH!"=="" (
|
|
54
|
+
echo ERROR: Could not compute sha256 of requirements.txt >&2
|
|
55
|
+
exit /b 1
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
:: ---------------------------------------------------------------------------
|
|
59
|
+
:: Fast-path: venv Scripts\python.exe exists AND sentinel matches
|
|
60
|
+
:: ---------------------------------------------------------------------------
|
|
61
|
+
set "VENV_PYTHON=%VENV_SCRIPTS%\python.exe"
|
|
62
|
+
if exist "%VENV_PYTHON%" (
|
|
63
|
+
if exist "%SENTINEL%" (
|
|
64
|
+
set /p "CURRENT_HASH=" < "%SENTINEL%"
|
|
65
|
+
if "!CURRENT_HASH!"=="!NEW_HASH!" (
|
|
66
|
+
echo SLM plugin: venv up-to-date, skipping install. >&2
|
|
67
|
+
exit /b 0
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
:: ---------------------------------------------------------------------------
|
|
73
|
+
:: Rebuild venv atomically
|
|
74
|
+
:: ---------------------------------------------------------------------------
|
|
75
|
+
echo SLM plugin: bootstrapping Python venv at %VENV% ... >&2
|
|
76
|
+
echo requirements: %REQ% >&2
|
|
77
|
+
|
|
78
|
+
if exist "%VENV_TMP%" rmdir /s /q "%VENV_TMP%"
|
|
79
|
+
python -m venv "%VENV_TMP%"
|
|
80
|
+
if errorlevel 1 (
|
|
81
|
+
echo ERROR: python -m venv failed >&2
|
|
82
|
+
exit /b 1
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
"%VENV_TMP%\Scripts\pip.exe" install --upgrade pip --prefer-binary --quiet
|
|
86
|
+
if errorlevel 1 (
|
|
87
|
+
echo ERROR: pip upgrade failed >&2
|
|
88
|
+
exit /b 1
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
"%VENV_TMP%\Scripts\pip.exe" install --require-virtualenv --prefer-binary --quiet -r "%REQ%"
|
|
92
|
+
if errorlevel 1 (
|
|
93
|
+
echo ERROR: pip install requirements failed >&2
|
|
94
|
+
exit /b 1
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
echo SLM plugin: install complete, activating venv. >&2
|
|
98
|
+
|
|
99
|
+
if exist "%VENV%" rmdir /s /q "%VENV%"
|
|
100
|
+
move "%VENV_TMP%" "%VENV%"
|
|
101
|
+
if errorlevel 1 (
|
|
102
|
+
echo ERROR: Could not move venv.tmp to venv >&2
|
|
103
|
+
exit /b 1
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
echo !NEW_HASH!>"%SENTINEL%"
|
|
107
|
+
echo SLM plugin: venv ready at %VENV%\Scripts\slm.exe >&2
|
|
108
|
+
exit /b 0
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ensure-venv.sh (Codex edition) — SuperLocalMemory plugin venv bootstrap
|
|
3
|
+
#
|
|
4
|
+
# Idempotent: fast-path exits in <100ms on repeat invocations when requirements.txt
|
|
5
|
+
# is unchanged.
|
|
6
|
+
#
|
|
7
|
+
# Difference from plugin/scripts/ensure-venv.sh (Claude Code edition):
|
|
8
|
+
# - Uses SLM_DATA_DIR instead of CLAUDE_PLUGIN_DATA.
|
|
9
|
+
# - Resolves requirements.txt relative to this script's location instead of
|
|
10
|
+
# CLAUDE_PLUGIN_ROOT (which is a Claude Code runtime variable with no Codex equivalent).
|
|
11
|
+
#
|
|
12
|
+
# Environment:
|
|
13
|
+
# SLM_DATA_DIR — persistent data dir (venv lives here)
|
|
14
|
+
# (default: ~/.superlocalmemory)
|
|
15
|
+
#
|
|
16
|
+
# Exit codes: 0 = venv ready non-0 = failure (logged to stderr)
|
|
17
|
+
# All output goes to stderr only (stdout reserved for MCP stdio protocol).
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
|
|
21
|
+
# Redirect all output to stderr (MCP uses stdout for protocol messages)
|
|
22
|
+
exec 1>&2
|
|
23
|
+
|
|
24
|
+
# ---------------------------------------------------------------------------
|
|
25
|
+
# Resolve paths — script-relative so no runtime var needed
|
|
26
|
+
# ---------------------------------------------------------------------------
|
|
27
|
+
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
|
+
# requirements.txt lives one level up from scripts/ (in codex-plugin/)
|
|
29
|
+
REQ="${_SCRIPT_DIR}/../requirements.txt"
|
|
30
|
+
_SLM_DATA_DIR="${SLM_DATA_DIR:-${HOME}/.superlocalmemory}"
|
|
31
|
+
VENV="${_SLM_DATA_DIR}/venv"
|
|
32
|
+
SENTINEL="${_SLM_DATA_DIR}/.venv-reqs.sha256"
|
|
33
|
+
VENV_TMP="${_SLM_DATA_DIR}/venv.tmp"
|
|
34
|
+
|
|
35
|
+
# ---------------------------------------------------------------------------
|
|
36
|
+
# Python >= 3.12 guard
|
|
37
|
+
# ---------------------------------------------------------------------------
|
|
38
|
+
if ! python3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" 2>/dev/null; then
|
|
39
|
+
PY_VER=$(python3 --version 2>&1 || echo "unknown")
|
|
40
|
+
echo "ERROR: SuperLocalMemory plugin requires Python >= 3.12, found: ${PY_VER}" >&2
|
|
41
|
+
echo "Install Python 3.12+ and ensure it is first on PATH." >&2
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# ---------------------------------------------------------------------------
|
|
46
|
+
# Validate requirements.txt exists
|
|
47
|
+
# ---------------------------------------------------------------------------
|
|
48
|
+
if [ ! -f "${REQ}" ]; then
|
|
49
|
+
echo "ERROR: requirements.txt not found at ${REQ}" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
# ---------------------------------------------------------------------------
|
|
54
|
+
# Compute sha256 of requirements.txt (cross-platform: prefer sha256sum, fall back to shasum)
|
|
55
|
+
# ---------------------------------------------------------------------------
|
|
56
|
+
hash_req() {
|
|
57
|
+
if command -v sha256sum >/dev/null 2>&1; then
|
|
58
|
+
sha256sum "${REQ}" | awk '{print $1}'
|
|
59
|
+
else
|
|
60
|
+
shasum -a 256 "${REQ}" | awk '{print $1}'
|
|
61
|
+
fi
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
NEW_HASH=$(hash_req)
|
|
65
|
+
|
|
66
|
+
# ---------------------------------------------------------------------------
|
|
67
|
+
# Fast-path: venv python exists AND sentinel matches current requirements hash
|
|
68
|
+
# ---------------------------------------------------------------------------
|
|
69
|
+
VENV_PYTHON="${VENV}/bin/python3"
|
|
70
|
+
if [ ! -x "${VENV_PYTHON}" ]; then
|
|
71
|
+
VENV_PYTHON="${VENV}/bin/python"
|
|
72
|
+
fi
|
|
73
|
+
if [ -x "${VENV_PYTHON}" ] && [ -f "${SENTINEL}" ] && [ "$(cat "${SENTINEL}")" = "${NEW_HASH}" ]; then
|
|
74
|
+
echo "SLM plugin: venv up-to-date (sha256=${NEW_HASH:0:12}…), skipping install." >&2
|
|
75
|
+
exit 0
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# ---------------------------------------------------------------------------
|
|
79
|
+
# Rebuild venv atomically: install to venv.tmp, rename to venv, write sentinel LAST
|
|
80
|
+
# ---------------------------------------------------------------------------
|
|
81
|
+
echo "SLM plugin: bootstrapping Python venv at ${VENV} …" >&2
|
|
82
|
+
echo " requirements: ${REQ}" >&2
|
|
83
|
+
echo " python3: $(python3 --version 2>&1)" >&2
|
|
84
|
+
|
|
85
|
+
rm -rf "${VENV_TMP}"
|
|
86
|
+
python3 -m venv "${VENV_TMP}"
|
|
87
|
+
"${VENV_TMP}/bin/pip" install --upgrade pip --prefer-binary --quiet
|
|
88
|
+
"${VENV_TMP}/bin/pip" install \
|
|
89
|
+
--require-virtualenv \
|
|
90
|
+
--prefer-binary \
|
|
91
|
+
--quiet \
|
|
92
|
+
-r "${REQ}"
|
|
93
|
+
|
|
94
|
+
echo "SLM plugin: install complete, activating venv." >&2
|
|
95
|
+
|
|
96
|
+
rm -rf "${VENV}"
|
|
97
|
+
mv "${VENV_TMP}" "${VENV}"
|
|
98
|
+
echo "${NEW_HASH}" > "${SENTINEL}"
|
|
99
|
+
|
|
100
|
+
echo "SLM plugin: venv ready at ${VENV}/bin/slm" >&2
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# slm-launch (Codex edition) — SuperLocalMemory MCP launcher (POSIX)
|
|
3
|
+
#
|
|
4
|
+
# Cross-platform counterpart: slm-launch.bat (Windows)
|
|
5
|
+
# Referenced by codex-plugin/.codex/config.toml as the advanced MCP server command.
|
|
6
|
+
#
|
|
7
|
+
# Resolves the correct venv binary for POSIX and joins the namespace daemon before
|
|
8
|
+
# opening the MCP stdio transport. This preserves one writer for all parallel Codex
|
|
9
|
+
# sessions that share SLM_DATA_DIR.
|
|
10
|
+
#
|
|
11
|
+
# Difference from plugin/scripts/slm-launch (Claude Code edition):
|
|
12
|
+
# - Uses SLM_DATA_DIR (default: ~/.superlocalmemory) instead of CLAUDE_PLUGIN_DATA.
|
|
13
|
+
# - Falls back to the PATH `slm` binary if the venv binary is not present.
|
|
14
|
+
# This means a global `pip install superlocalmemory` works without a venv.
|
|
15
|
+
#
|
|
16
|
+
# Environment:
|
|
17
|
+
# SLM_DATA_DIR — persistent data dir where venv lives
|
|
18
|
+
# (default: ~/.superlocalmemory)
|
|
19
|
+
|
|
20
|
+
_SLM_DATA_DIR="${SLM_DATA_DIR:-${HOME}/.superlocalmemory}"
|
|
21
|
+
_VENV_BIN="${_SLM_DATA_DIR}/venv/bin/slm"
|
|
22
|
+
|
|
23
|
+
# An installed slm wins over a plugin-owned venv.
|
|
24
|
+
#
|
|
25
|
+
# The order used to be the other way round -- venv first, PATH only as a
|
|
26
|
+
# fallback -- which meant a machine that had once bootstrapped a venv kept using
|
|
27
|
+
# it forever, even after the user installed or upgraded SLM properly. Two copies
|
|
28
|
+
# reading one store, and which one served it depended on which started first.
|
|
29
|
+
#
|
|
30
|
+
# When both exist and their versions differ, say so. One store served by two
|
|
31
|
+
# versions is worth seeing rather than guessing at.
|
|
32
|
+
if command -v slm >/dev/null 2>&1; then
|
|
33
|
+
SLM_BIN="$(command -v slm)"
|
|
34
|
+
if [ -x "${_VENV_BIN}" ]; then
|
|
35
|
+
_sys_v="$("${SLM_BIN}" --version 2>/dev/null | awk '{print $NF}')"
|
|
36
|
+
_venv_v="$("${_VENV_BIN}" --version 2>/dev/null | awk '{print $NF}')"
|
|
37
|
+
if [ -n "${_venv_v}" ] && [ "${_sys_v}" != "${_venv_v}" ]; then
|
|
38
|
+
echo "SLM: using the installed slm ${_sys_v:-?} and IGNORING a leftover venv at ${_VENV_BIN} (${_venv_v})." >&2
|
|
39
|
+
echo " One store, one version. Remove it to stop it drifting: rm -rf \"${_SLM_DATA_DIR}/venv\"" >&2
|
|
40
|
+
fi
|
|
41
|
+
fi
|
|
42
|
+
elif [ -x "${_VENV_BIN}" ]; then
|
|
43
|
+
SLM_BIN="${_VENV_BIN}"
|
|
44
|
+
else
|
|
45
|
+
echo "SLM: no SuperLocalMemory found — looked for 'slm' on PATH and ${_VENV_BIN}." >&2
|
|
46
|
+
echo " Install it with: pipx install superlocalmemory" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
if ! "${SLM_BIN}" serve start >&2; then
|
|
51
|
+
echo "SLM plugin: unable to start the owned daemon; refusing a direct MCP writer." >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
exec "${SLM_BIN}" mcp
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
:: slm-launch.bat (Codex edition) — SuperLocalMemory MCP launcher (Windows)
|
|
3
|
+
::
|
|
4
|
+
:: Cross-platform counterpart: slm-launch (POSIX bash)
|
|
5
|
+
:: Referenced by codex-plugin/.codex/config.toml as the advanced MCP server command.
|
|
6
|
+
::
|
|
7
|
+
:: Resolves the correct venv binary for Windows and joins the namespace daemon before
|
|
8
|
+
:: opening MCP, preserving one writer for parallel Codex sessions.
|
|
9
|
+
::
|
|
10
|
+
:: Difference from plugin/scripts/slm-launch.bat (Claude Code edition):
|
|
11
|
+
:: - Uses SLM_DATA_DIR (default: %USERPROFILE%\.superlocalmemory) instead of
|
|
12
|
+
:: CLAUDE_PLUGIN_DATA.
|
|
13
|
+
:: - Falls back to the PATH `slm` binary if the venv binary is not present.
|
|
14
|
+
::
|
|
15
|
+
:: Environment:
|
|
16
|
+
:: SLM_DATA_DIR — persistent data dir where venv lives
|
|
17
|
+
:: (default: %USERPROFILE%\.superlocalmemory)
|
|
18
|
+
|
|
19
|
+
if not defined SLM_DATA_DIR set "SLM_DATA_DIR=%USERPROFILE%\.superlocalmemory"
|
|
20
|
+
set "SLM_BIN=%SLM_DATA_DIR%\venv\Scripts\slm.exe"
|
|
21
|
+
|
|
22
|
+
if not exist "%SLM_BIN%" set "SLM_BIN=slm"
|
|
23
|
+
|
|
24
|
+
"%SLM_BIN%" serve start 1>&2
|
|
25
|
+
if errorlevel 1 (
|
|
26
|
+
echo SLM plugin: unable to start the owned daemon; refusing a direct MCP writer. 1>&2
|
|
27
|
+
exit /b 1
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
"%SLM_BIN%" mcp
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-bot-memory
|
|
3
|
+
description: Cross-bot memory on a shared computer (Grok Bot, Cursor plugin, any host where several agents share one machine). Explains agent_id attribution vs. profile/scope access, how to namespace by agent_id + profile + scope, and what must never be written to memory. Read this before the first remember/recall on a new Grok-Bot-style host.
|
|
4
|
+
when_to_use: |
|
|
5
|
+
- First session on a Grok Bot computer or any shared-bot host
|
|
6
|
+
- "Will my other bots see this memory?"
|
|
7
|
+
- "How do I keep this bot's notes separate from that one?"
|
|
8
|
+
- Deciding whether to store something that looks like a secret or personal data
|
|
9
|
+
- Setting up a second bot on a computer that already has SLM configured
|
|
10
|
+
allowed-tools: remember, recall, search, session_init, switch_profile
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# slm-bot-memory — Cross-Bot Memory on a Shared Host
|
|
14
|
+
|
|
15
|
+
SuperLocalMemory ships as an MCP server. On a single-user laptop, one bot is
|
|
16
|
+
the only thing talking to it. On a **shared-bot host** — Grok Bot's "one
|
|
17
|
+
computer, shared by all your Bots" model, several Cursor windows, or any
|
|
18
|
+
setup where more than one agent process points at the same install — several
|
|
19
|
+
agents can reach the same memory store at once. This skill is about that
|
|
20
|
+
case: what is actually isolated, what is not, and what must never be written
|
|
21
|
+
regardless.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Three things that sound like isolation and are not the same
|
|
26
|
+
|
|
27
|
+
| Setting | What it controls | Does it hide memories from another bot? |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `SLM_AGENT_ID` | **Attribution** — who gets credit for a memory in logs and summaries | **No.** It is metadata, never an authenticated principal (verified in `mcp/agent_context.py`'s own docstring). Any bot that can query the same store can read a memory written under a different `agent_id`. |
|
|
30
|
+
| `SLM_DATA_DIR` (profile root) | **Which database file** the daemon opens | **Yes.** Two bots pointed at different `SLM_DATA_DIR` values have fully separate, independent memory stores — nothing is shared unless you explicitly configure sharing. |
|
|
31
|
+
| `scope` (`personal` / `shared` / `global`, see `slm-scope`) | **Visibility inside one store**, between profiles that share that store | Only the way you set it. `personal` (the default) stays within the writing profile; `shared`/`global` are explicit, user-initiated opt-ins. |
|
|
32
|
+
|
|
33
|
+
A memory profile (the namespace `profile_id` and `switch_profile` select) is not
|
|
34
|
+
a fourth kind of isolation between bots. Any local caller that can name a profile
|
|
35
|
+
can read it, and `switch_profile` moves the active profile for every bot on the
|
|
36
|
+
computer. Treat profiles as organisation, not privacy.
|
|
37
|
+
|
|
38
|
+
The practical rule: **`SLM_AGENT_ID` tells you who wrote something; `SLM_DATA_DIR`
|
|
39
|
+
and `scope` decide who can read it.** If two bots on the same Grok Bot computer
|
|
40
|
+
use the same `SLM_DATA_DIR` (the common case — it is a shared filesystem, and
|
|
41
|
+
nothing in Grok Bot's plugin model points different bots at different data
|
|
42
|
+
directories by default), they see each other's `personal`-scope memories too,
|
|
43
|
+
the same way two terminal sessions on one laptop would. Giving two bots
|
|
44
|
+
different `SLM_AGENT_ID` values does not change that — it only changes whose
|
|
45
|
+
name shows up on the memory.
|
|
46
|
+
|
|
47
|
+
If you need one bot's memories genuinely unreachable from another, that bot
|
|
48
|
+
needs its **own `SLM_DATA_DIR`** (or a store where company mode with roles is
|
|
49
|
+
configured — see `slm-governance`), not just its own `SLM_AGENT_ID` or its own
|
|
50
|
+
profile.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Namespacing that actually works
|
|
55
|
+
|
|
56
|
+
Use all three dimensions together, each for what it is good at:
|
|
57
|
+
|
|
58
|
+
1. **`agent_id`** (`SLM_AGENT_ID` env, or the `agent_id` parameter on
|
|
59
|
+
`remember`/`recall` directly) — so a human or another agent reading
|
|
60
|
+
`get_memory_summary` or the stored facts later can tell which bot said
|
|
61
|
+
what. Set it to something stable and specific: `grok_bot_support`,
|
|
62
|
+
`grok_bot_release_notes`, not a generic `bot`.
|
|
63
|
+
2. **`SLM_DATA_DIR`** — the real isolation boundary. One store per bot that
|
|
64
|
+
genuinely needs privacy from the others. A `profile_id` inside a shared store
|
|
65
|
+
groups memories but does not hide them.
|
|
66
|
+
3. **`scope`** (see `slm-scope`) — inside a store two or more bots
|
|
67
|
+
legitimately share, keep writes `personal` by default and only promote to
|
|
68
|
+
`shared`/`global` when a fact is meant for every bot on that store.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
remember(
|
|
72
|
+
content="Deploy window for the support bot is Tue/Thu 14:00-16:00 UTC",
|
|
73
|
+
tags="ops,schedule",
|
|
74
|
+
agent_id="grok_bot_support",
|
|
75
|
+
session_id="<sid>",
|
|
76
|
+
)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
recall(
|
|
81
|
+
query="deploy window",
|
|
82
|
+
agent_id="grok_bot_support",
|
|
83
|
+
session_id="<sid>",
|
|
84
|
+
)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Recall is not filtered by `agent_id` automatically — it is attribution on the
|
|
88
|
+
written record. If you need "only what this bot wrote", pass
|
|
89
|
+
`saved_by="grok_bot_support"` to `recall` (or `--saved-by` on `slm recall`),
|
|
90
|
+
which keeps only memories saved by that agent id. It filters; it does not
|
|
91
|
+
protect, because another bot can leave it out.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## What never goes into memory, on any host
|
|
96
|
+
|
|
97
|
+
This is not Grok-Bot-specific — it is the baseline for every SLM host — but
|
|
98
|
+
it matters more here because a shared computer means a shared blast radius if
|
|
99
|
+
it is violated:
|
|
100
|
+
|
|
101
|
+
- **Secrets, API keys, tokens, passwords, certificates.** Never pass them to
|
|
102
|
+
`remember`, even "just this once" or "temporarily." If a fact needs to
|
|
103
|
+
reference that a credential exists, store the *fact of its existence and
|
|
104
|
+
where to rotate it*, never the value.
|
|
105
|
+
- **Personal data about identifiable people** that was not already something
|
|
106
|
+
the user explicitly asked to be remembered about themselves (names,
|
|
107
|
+
emails, addresses, health, financial details of third parties).
|
|
108
|
+
- **Anything from Grok Bot's shared filesystem you did not write yourself**
|
|
109
|
+
and were not asked to remember. "Files are visible to every Bot" on that
|
|
110
|
+
computer (Grok Bot's own docs) — a file being readable is not the same as
|
|
111
|
+
having permission to copy its contents into long-term memory that other
|
|
112
|
+
bots and later sessions will see.
|
|
113
|
+
- **Command-line credentials.** Grok Bot's own docs note these are shared
|
|
114
|
+
across bots on the computer; SLM must not become a second, more durable
|
|
115
|
+
copy of them.
|
|
116
|
+
|
|
117
|
+
If you are unsure whether something is a secret, treat it as one and ask the
|
|
118
|
+
user before storing anything derived from it.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Checklist for a new bot on an existing shared host
|
|
123
|
+
|
|
124
|
+
1. Confirm `SLM_DATA_DIR` — is this bot meant to share the existing store, or
|
|
125
|
+
does it need its own? (`slm status --json` on the computer shows `data.base_dir`
|
|
126
|
+
and `data.db_path`.)
|
|
127
|
+
2. Set a specific `SLM_AGENT_ID` for this bot before the first `remember`.
|
|
128
|
+
3. Read `slm-scope` before writing anything with `scope="shared"` or
|
|
129
|
+
`scope="global"` — those are machine-wide, not just cross-bot.
|
|
130
|
+
4. Read the "never goes into memory" list above once, out loud if you are
|
|
131
|
+
unsure, before the first write on this host.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Related skills
|
|
136
|
+
|
|
137
|
+
- `slm-getting-started-bot` — first-session setup for a headless bot host
|
|
138
|
+
- `slm-scope` — the personal/shared/global visibility model this skill
|
|
139
|
+
namespaces on top of
|
|
140
|
+
- `slm-profile` — memory profiles versus tool sets, and what switching does
|
|
141
|
+
- `slm-governance` — role-based access when a store has multiple human/bot
|
|
142
|
+
members and real access control, not just convention
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
*SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later*
|