superlocalmemory 3.7.7 → 3.8.0
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 +1 -1
- package/ATTRIBUTION.md +1 -3
- package/CHANGELOG.md +85 -0
- package/README.md +199 -29
- package/package.json +4 -2
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/CLAUDE.md +8 -8
- package/plugin/agents/slm-governance-advisor.md +80 -0
- package/plugin/agents/slm-loop-runner.md +71 -0
- package/plugin/agents/slm-memory-advisor.md +10 -5
- package/plugin/agents/slm-optimize-advisor.md +9 -3
- package/plugin/commands/slm-loop.md +31 -0
- package/plugin/hooks/hooks.json +79 -0
- package/plugin/requirements.txt +1 -1
- package/plugin/scripts/slm-launch +46 -7
- package/plugin/settings.json +9 -0
- package/plugin/skills/slm-cache/SKILL.md +9 -1
- package/plugin/skills/slm-compress/SKILL.md +8 -1
- package/plugin/skills/slm-governance/SKILL.md +248 -0
- package/plugin/skills/slm-graph/SKILL.md +17 -3
- package/plugin/skills/slm-loop/SKILL.md +99 -0
- package/plugin/skills/slm-mesh/SKILL.md +282 -0
- package/plugin/skills/slm-profile/SKILL.md +148 -0
- package/plugin/skills/slm-recall/SKILL.md +46 -10
- package/plugin/skills/slm-remember/SKILL.md +48 -1
- package/plugin/skills/slm-scope/SKILL.md +176 -0
- package/plugin/skills/slm-session/SKILL.md +24 -1
- package/plugin/skills/slm-status/SKILL.md +18 -1
- package/plugin-src/agents/slm-governance-advisor.md +80 -0
- package/plugin-src/agents/slm-loop-runner.md +71 -0
- package/plugin-src/agents/slm-memory-advisor.md +10 -5
- package/plugin-src/agents/slm-optimize-advisor.md +9 -3
- package/plugin-src/commands/slm-loop.md +31 -0
- package/plugin-src/hooks/hooks.json +79 -0
- package/plugin-src/manifest.json +7 -2
- package/plugin-src/requirements.txt +1 -1
- package/plugin-src/rules/AGENTS.md +57 -18
- package/plugin-src/rules/CLAUDE.md.fragment +8 -8
- package/plugin-src/scripts/slm-launch +46 -7
- package/plugin-src/settings.json +9 -0
- package/plugin-src/skills/slm-cache/SKILL.md +9 -1
- package/plugin-src/skills/slm-compress/SKILL.md +8 -1
- package/plugin-src/skills/slm-governance/SKILL.md +248 -0
- package/plugin-src/skills/slm-graph/SKILL.md +17 -3
- package/plugin-src/skills/slm-loop/SKILL.md +99 -0
- package/plugin-src/skills/slm-mesh/SKILL.md +282 -0
- package/plugin-src/skills/slm-profile/SKILL.md +148 -0
- package/plugin-src/skills/slm-recall/SKILL.md +46 -10
- package/plugin-src/skills/slm-remember/SKILL.md +48 -1
- package/plugin-src/skills/slm-scope/SKILL.md +176 -0
- package/plugin-src/skills/slm-session/SKILL.md +24 -1
- package/plugin-src/skills/slm-status/SKILL.md +18 -1
- package/pyproject.toml +1 -2
- package/scripts/postinstall/validation.js +2 -0
- package/scripts/postinstall-interactive.js +74 -2
- package/src/superlocalmemory/__init__.py +1 -1
- package/src/superlocalmemory/access/__init__.py +3 -0
- package/src/superlocalmemory/access/rbac.py +477 -0
- package/src/superlocalmemory/cli/commands.py +96 -12
- package/src/superlocalmemory/cli/compress_cmd.py +17 -7
- package/src/superlocalmemory/cli/loop_cmd.py +192 -0
- package/src/superlocalmemory/cli/main.py +39 -4
- package/src/superlocalmemory/cli/mesh_cmd.py +38 -0
- package/src/superlocalmemory/cli/optimize_cmd.py +3 -0
- package/src/superlocalmemory/cli/pending_store.py +49 -13
- package/src/superlocalmemory/cli/proxy_cmd.py +4 -0
- package/src/superlocalmemory/cli/scale_engine_cmd.py +6 -0
- package/src/superlocalmemory/cli/setup_wizard.py +22 -13
- package/src/superlocalmemory/compliance/audit.py +6 -0
- package/src/superlocalmemory/compliance/gdpr.py +128 -138
- package/src/superlocalmemory/compliance/retention.py +176 -45
- package/src/superlocalmemory/core/backend_orchestrator.py +5 -43
- package/src/superlocalmemory/core/community_summary.py +267 -0
- package/src/superlocalmemory/core/config.py +216 -3
- package/src/superlocalmemory/core/consolidation_engine.py +95 -22
- package/src/superlocalmemory/core/context_cache.py +61 -18
- package/src/superlocalmemory/core/embedding_worker.py +17 -2
- package/src/superlocalmemory/core/embeddings.py +12 -1
- package/src/superlocalmemory/core/engine.py +17 -1
- package/src/superlocalmemory/core/engine_ingestion.py +29 -0
- package/src/superlocalmemory/core/engine_wiring.py +13 -0
- package/src/superlocalmemory/core/entity_community.py +178 -0
- package/src/superlocalmemory/core/graph_analyzer.py +39 -2
- package/src/superlocalmemory/core/graph_pruner.py +13 -8
- package/src/superlocalmemory/core/key_expander.py +138 -0
- package/src/superlocalmemory/core/maintenance.py +23 -0
- package/src/superlocalmemory/core/modes.py +1 -1
- package/src/superlocalmemory/core/mutations.py +2 -2
- package/src/superlocalmemory/core/pii.py +105 -0
- package/src/superlocalmemory/core/progressive_abstraction.py +208 -0
- package/src/superlocalmemory/core/recall_pipeline.py +2 -0
- package/src/superlocalmemory/core/recall_worker.py +20 -6
- package/src/superlocalmemory/core/scale_engine.py +60 -1
- package/src/superlocalmemory/core/security_primitives.py +40 -2
- package/src/superlocalmemory/core/store_pipeline.py +35 -11
- package/src/superlocalmemory/core/worker_pool.py +21 -6
- package/src/superlocalmemory/encoding/entity_reflexion.py +200 -0
- package/src/superlocalmemory/encoding/entity_resolver.py +34 -24
- package/src/superlocalmemory/encoding/fact_extractor.py +26 -1
- package/src/superlocalmemory/encoding/temporal_validator.py +64 -1
- package/src/superlocalmemory/evolution/evolution_store.py +122 -45
- package/src/superlocalmemory/evolution/llm_dispatch.py +12 -1
- package/src/superlocalmemory/evolution/model_selection.py +160 -0
- package/src/superlocalmemory/evolution/mutation_generator.py +16 -0
- package/src/superlocalmemory/evolution/skill_evolver.py +127 -42
- package/src/superlocalmemory/evolution/triggers.py +22 -13
- package/src/superlocalmemory/graph/cozo_backend.py +43 -20
- package/src/superlocalmemory/hooks/adapter_base.py +5 -1
- package/src/superlocalmemory/hooks/auto_recall.py +13 -1
- package/src/superlocalmemory/hooks/claude_code_hooks.py +11 -0
- package/src/superlocalmemory/hooks/codex_assets.py +64 -5
- package/src/superlocalmemory/hooks/hook_daemon.py +20 -3
- package/src/superlocalmemory/hooks/memory_protocol.py +54 -0
- package/src/superlocalmemory/hooks/portable_kit.py +114 -1
- package/src/superlocalmemory/infra/auth_middleware.py +28 -0
- package/src/superlocalmemory/infra/backup.py +12 -1
- package/src/superlocalmemory/infra/daemon_identity.py +40 -4
- package/src/superlocalmemory/infra/data_root.py +43 -4
- package/src/superlocalmemory/infra/event_bus.py +107 -24
- package/src/superlocalmemory/infra/rate_limiter.py +93 -0
- package/src/superlocalmemory/ingestion/adapter_manager.py +4 -1
- package/src/superlocalmemory/ingestion/credentials.py +1 -1
- package/src/superlocalmemory/learning/cross_project.py +28 -19
- package/src/superlocalmemory/learning/reward_proxy.py +42 -9
- package/src/superlocalmemory/loops/__init__.py +56 -0
- package/src/superlocalmemory/loops/budget.py +58 -0
- package/src/superlocalmemory/loops/engine.py +164 -0
- package/src/superlocalmemory/loops/ledger.py +243 -0
- package/src/superlocalmemory/loops/models.py +152 -0
- package/src/superlocalmemory/loops/rules.py +52 -0
- package/src/superlocalmemory/mcp/_daemon_proxy.py +3 -0
- package/src/superlocalmemory/mcp/_pool_adapter.py +2 -0
- package/src/superlocalmemory/mcp/profiles.py +103 -0
- package/src/superlocalmemory/mcp/server.py +21 -49
- package/src/superlocalmemory/mcp/tools_active.py +4 -7
- package/src/superlocalmemory/mcp/tools_code_graph.py +51 -5
- package/src/superlocalmemory/mcp/tools_core.py +50 -5
- package/src/superlocalmemory/mcp/tools_evolution.py +6 -3
- package/src/superlocalmemory/mcp/tools_loops.py +300 -0
- package/src/superlocalmemory/mcp/tools_mesh.py +140 -4
- package/src/superlocalmemory/mcp/tools_optimize.py +15 -8
- package/src/superlocalmemory/mesh/broker.py +237 -129
- package/src/superlocalmemory/mesh/remote_sync.py +50 -8
- package/src/superlocalmemory/optimize/NOTICE +1 -6
- package/src/superlocalmemory/optimize/adapters/anthropic_adapter.py +1 -4
- package/src/superlocalmemory/optimize/adapters/openai_adapter.py +1 -4
- package/src/superlocalmemory/optimize/cache/semantic.py +27 -19
- package/src/superlocalmemory/optimize/compress/align.py +32 -26
- package/src/superlocalmemory/optimize/compress/ccr.py +14 -71
- package/src/superlocalmemory/optimize/compress/router.py +105 -22
- package/src/superlocalmemory/optimize/config/defaults.py +1 -1
- package/src/superlocalmemory/optimize/config/schema.py +87 -4
- package/src/superlocalmemory/optimize/metrics/counters.py +13 -4
- package/src/superlocalmemory/optimize/metrics/estimator.py +0 -3
- package/src/superlocalmemory/optimize/proxy/_helpers.py +31 -4
- package/src/superlocalmemory/optimize/storage/db.py +38 -9
- package/src/superlocalmemory/optimize/storage/schema.py +10 -0
- package/src/superlocalmemory/parameterization/pattern_extractor.py +6 -3
- package/src/superlocalmemory/retrieval/agentic.py +1 -1
- package/src/superlocalmemory/retrieval/bm25_channel.py +68 -10
- package/src/superlocalmemory/retrieval/engine.py +168 -26
- package/src/superlocalmemory/retrieval/entity_channel.py +7 -5
- package/src/superlocalmemory/retrieval/hopfield_channel.py +9 -2
- package/src/superlocalmemory/retrieval/semantic_channel.py +114 -21
- package/src/superlocalmemory/retrieval/spreading_activation.py +11 -2
- package/src/superlocalmemory/retrieval/temporal_channel.py +48 -9
- package/src/superlocalmemory/retrieval/temporal_frame.py +102 -0
- package/src/superlocalmemory/retrieval/temporal_validity_filter.py +135 -0
- package/src/superlocalmemory/retrieval/time_window.py +181 -0
- package/src/superlocalmemory/server/api.py +21 -4
- package/src/superlocalmemory/server/profile_runtime.py +125 -8
- package/src/superlocalmemory/server/rbac_enforce.py +142 -0
- package/src/superlocalmemory/server/recall_health.py +24 -3
- package/src/superlocalmemory/server/recall_serializer.py +19 -1
- package/src/superlocalmemory/server/routes/abstraction.py +115 -0
- package/src/superlocalmemory/server/routes/agents.py +128 -38
- package/src/superlocalmemory/server/routes/backup.py +34 -10
- package/src/superlocalmemory/server/routes/behavioral.py +13 -12
- package/src/superlocalmemory/server/routes/brain.py +21 -5
- package/src/superlocalmemory/server/routes/chat.py +72 -16
- package/src/superlocalmemory/server/routes/compliance.py +171 -21
- package/src/superlocalmemory/server/routes/config_api.py +436 -0
- package/src/superlocalmemory/server/routes/data_io.py +30 -8
- package/src/superlocalmemory/server/routes/entity.py +9 -4
- package/src/superlocalmemory/server/routes/events.py +24 -8
- package/src/superlocalmemory/server/routes/evolution.py +135 -17
- package/src/superlocalmemory/server/routes/helpers.py +16 -1
- package/src/superlocalmemory/server/routes/ingest.py +7 -4
- package/src/superlocalmemory/server/routes/insights.py +3 -3
- package/src/superlocalmemory/server/routes/learning.py +14 -14
- package/src/superlocalmemory/server/routes/lifecycle.py +59 -8
- package/src/superlocalmemory/server/routes/memories.py +221 -49
- package/src/superlocalmemory/server/routes/mesh.py +95 -15
- package/src/superlocalmemory/server/routes/optimize.py +33 -1
- package/src/superlocalmemory/server/routes/prewarm.py +2 -0
- package/src/superlocalmemory/server/routes/profiles.py +63 -17
- package/src/superlocalmemory/server/routes/ratelimit.py +124 -0
- package/src/superlocalmemory/server/routes/rbac.py +367 -0
- package/src/superlocalmemory/server/routes/stats.py +13 -6
- package/src/superlocalmemory/server/routes/tiers.py +11 -9
- package/src/superlocalmemory/server/routes/v3_api.py +194 -81
- package/src/superlocalmemory/server/routes/ws.py +5 -2
- package/src/superlocalmemory/server/security_middleware.py +12 -5
- package/src/superlocalmemory/server/ui.py +30 -5
- package/src/superlocalmemory/server/unified_daemon.py +431 -75
- package/src/superlocalmemory/server/write_identity.py +38 -8
- package/src/superlocalmemory/storage/database.py +265 -53
- package/src/superlocalmemory/storage/migration_runner.py +53 -0
- package/src/superlocalmemory/storage/migrations/M021_ingestion_log_profile.py +108 -0
- package/src/superlocalmemory/storage/migrations/M022_entity_aliases_profile.py +86 -0
- package/src/superlocalmemory/storage/migrations/M023_mesh_profile_isolation.py +194 -0
- package/src/superlocalmemory/storage/migrations/M024_rbac_users_roles.py +87 -0
- package/src/superlocalmemory/storage/migrations/M025_perf_indexes.py +90 -0
- package/src/superlocalmemory/storage/migrations/M026_rbac_memberships_fk.py +136 -0
- package/src/superlocalmemory/storage/migrations/M027_transferable_patterns_profile.py +163 -0
- package/src/superlocalmemory/storage/models.py +4 -0
- package/src/superlocalmemory/storage/schema.py +87 -0
- package/src/superlocalmemory/storage/schema_v32.py +0 -9
- package/src/superlocalmemory/storage/schema_v343.py +24 -12
- package/src/superlocalmemory/trust/gate.py +49 -8
- package/src/superlocalmemory/ui/assets/slm-icon-white.svg +64 -0
- package/src/superlocalmemory/ui/assets/slm-icon.svg +36 -0
- package/src/superlocalmemory/ui/css/design-system.css +621 -0
- package/src/superlocalmemory/ui/css/neural-glass.css +6 -0
- package/src/superlocalmemory/ui/css/od-bridge.css +158 -0
- package/src/superlocalmemory/ui/favicon.svg +35 -4
- package/src/superlocalmemory/ui/index.html +306 -173
- package/src/superlocalmemory/ui/js/brain.js +5 -20
- package/src/superlocalmemory/ui/js/core.js +47 -31
- package/src/superlocalmemory/ui/js/dashboard.js +314 -63
- package/src/superlocalmemory/ui/js/event-delegation.js +102 -0
- package/src/superlocalmemory/ui/js/knowledge-graph.js +11 -11
- package/src/superlocalmemory/ui/js/math-health.js +1 -1
- package/src/superlocalmemory/ui/js/memories.js +15 -4
- package/src/superlocalmemory/ui/js/memory-chat.js +7 -7
- package/src/superlocalmemory/ui/js/ng-entities.js +6 -8
- package/src/superlocalmemory/ui/js/ng-ingestion.js +4 -4
- package/src/superlocalmemory/ui/js/ng-mesh.js +4 -9
- package/src/superlocalmemory/ui/js/ng-shell.js +8 -8
- package/src/superlocalmemory/ui/js/ng-skills.js +54 -2
- package/src/superlocalmemory/ui/js/od-agents.js +544 -0
- package/src/superlocalmemory/ui/js/od-auth-gate.js +257 -0
- package/src/superlocalmemory/ui/js/od-backup.js +780 -0
- package/src/superlocalmemory/ui/js/od-brain.js +779 -0
- package/src/superlocalmemory/ui/js/od-entities.js +579 -0
- package/src/superlocalmemory/ui/js/od-graph.js +593 -0
- package/src/superlocalmemory/ui/js/od-health.js +539 -0
- package/src/superlocalmemory/ui/js/od-mcp.js +508 -0
- package/src/superlocalmemory/ui/js/od-memories.js +887 -0
- package/src/superlocalmemory/ui/js/od-mesh.js +539 -0
- package/src/superlocalmemory/ui/js/od-operations.js +1250 -0
- package/src/superlocalmemory/ui/js/od-optimize.js +787 -0
- package/src/superlocalmemory/ui/js/od-settings.js +1053 -0
- package/src/superlocalmemory/ui/js/od-shell.js +593 -0
- package/src/superlocalmemory/ui/js/od-skills.js +573 -0
- package/src/superlocalmemory/ui/js/od-team.js +258 -0
- package/src/superlocalmemory/ui/js/profiles.js +159 -46
- package/src/superlocalmemory/ui/js/settings.js +2 -2
- package/src/superlocalmemory/ui/js/timeline.js +34 -5
- package/src/superlocalmemory/ui/js/trust-dashboard.js +2 -2
- package/src/superlocalmemory/vector/lancedb_backend.py +8 -6
- package/src/superlocalmemory/learning/behavioral_listener.py +0 -94
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-loop-runner
|
|
3
|
+
description: >
|
|
4
|
+
Runs a task as a bounded loop backed by SuperLocalMemory: iterate until an
|
|
5
|
+
INDEPENDENT gate passes — never the agent's own claim. Delegate here when a
|
|
6
|
+
task has a checkable acceptance condition (a test suite, a JSON schema, a
|
|
7
|
+
linter, a reconciliation rule, a security scan) and you want gate-verified
|
|
8
|
+
completion with an auditable, resumable ledger persisted in SLM. Reports the
|
|
9
|
+
exact terminal status (DONE/HALT/PAUSE/KILLED/ERROR) and never dresses a
|
|
10
|
+
non-DONE outcome up as success.
|
|
11
|
+
tools: Bash, slm_recall, slm_remember, Read
|
|
12
|
+
model: inherit
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Role
|
|
16
|
+
|
|
17
|
+
You are the SLM loop runner. You take a task that has a **checkable acceptance
|
|
18
|
+
condition** and drive it to completion as a *bounded loop*, using
|
|
19
|
+
SuperLocalMemory as the durable ledger. The bounded-loop discipline is defined
|
|
20
|
+
in the `slm-loop` skill — follow it exactly.
|
|
21
|
+
|
|
22
|
+
# The one rule
|
|
23
|
+
|
|
24
|
+
The loop is complete **only when an independent gate passes**. The agent's own
|
|
25
|
+
"I'm done" is advisory and is recorded for audit, never used to terminate. If
|
|
26
|
+
the gate has not passed, the task is not done — keep iterating within the
|
|
27
|
+
bounds, or report the exact non-DONE status.
|
|
28
|
+
|
|
29
|
+
# How you work
|
|
30
|
+
|
|
31
|
+
1. **Frame the gate first.** Identify the mechanical check that proves the task
|
|
32
|
+
is done (e.g. `pytest -q`, a JSON-schema validation, a linter exit code, a
|
|
33
|
+
reconciliation query). If the goal is subjective, say so and require a human
|
|
34
|
+
approval gate — never use "an LLM decides it looks good" as the gate.
|
|
35
|
+
2. **Establish bounds.** Max iterations, a no-progress window, and (where
|
|
36
|
+
relevant) a token or wall-clock budget. State them before you start.
|
|
37
|
+
3. **Iterate.** Each lap: propose a change, then run the gate independently.
|
|
38
|
+
Persist the lap. Inspect prior laps with the `slm loop` surface
|
|
39
|
+
(`slm loop history`, `slm loop show <run_id>`); every lap is stored as
|
|
40
|
+
queryable SLM memory under the tag `loop:<name>`, so a run is auditable and
|
|
41
|
+
resumable across sessions.
|
|
42
|
+
4. **Terminate honestly.** Report the exact terminal status:
|
|
43
|
+
- `DONE` — the gate passed and any required approval was granted.
|
|
44
|
+
- `HALT` — a bound tripped (iterations, no-progress, token/wall-clock budget).
|
|
45
|
+
- `PAUSE` — the gate passed but approval is required and not yet granted.
|
|
46
|
+
- `KILLED` — an external kill switch tripped.
|
|
47
|
+
- `ERROR` — the runner or gate failed to execute; name which and quote the
|
|
48
|
+
short detail.
|
|
49
|
+
Never convert HALT, PAUSE, or ERROR into success language.
|
|
50
|
+
|
|
51
|
+
# Gate discipline
|
|
52
|
+
|
|
53
|
+
- The gate verifies; you only propose. They are separate.
|
|
54
|
+
- Prefer a typed, parseable gate (a test exit code, a schema validation, a
|
|
55
|
+
scanner report) over a vague check. A missing tool, an empty report, or a
|
|
56
|
+
crashed scanner is **not** a clean pass — fail closed.
|
|
57
|
+
|
|
58
|
+
# Memory hygiene
|
|
59
|
+
|
|
60
|
+
- At the start, `slm_recall` prior runs of the same loop to resume context.
|
|
61
|
+
- On a substantial outcome, `slm_remember` a one-paragraph summary (what the
|
|
62
|
+
gate was, the final status, the run_id) so the next session can find it.
|
|
63
|
+
|
|
64
|
+
# Anti-rationalization
|
|
65
|
+
|
|
66
|
+
"Reading is not verification. Run the gate." Do not report DONE from your own
|
|
67
|
+
assessment. The gate is the authority.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
|
|
@@ -13,11 +13,11 @@ model: inherit
|
|
|
13
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
14
|
|
|
15
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.
|
|
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
17
|
|
|
18
18
|
# Tools you may use (real SLM MCP tools, core profile)
|
|
19
19
|
- `session_init(project_path, query, max_results, max_age_days)` — ONCE at session start; returns recent decisions + relevant memories.
|
|
20
|
-
- `recall(query, limit, session_id, fast, include_global, include_shared)` — multi-channel semantic retrieval (default limit 10). Leave `include_global`/`include_shared` unset — recall is private-by-default (v3.6.15).
|
|
20
|
+
- `recall(query, limit, session_id, fast, include_global, include_shared)` — multi-channel semantic + keyword + temporal + contextual retrieval (default limit 10). Leave `include_global`/`include_shared` unset — recall is private-by-default (v3.6.15).
|
|
21
21
|
- `search(query, limit, profile_id)` — exact keyword / FTS5 BM25.
|
|
22
22
|
- `remember(content, tags, project, importance, session_id, scope, shared_with)` — store atomic fact; importance 1-10. Leave `scope` unset (defaults to `personal`/private).
|
|
23
23
|
- `update_memory(fact_id, content)` — correct by exact id.
|
|
@@ -33,12 +33,17 @@ When the main agent: starts a session and hasn't loaded project context; is abou
|
|
|
33
33
|
5. recall vs search — recall for conceptual; search for literal keyword.
|
|
34
34
|
6. EMPTY/LOW results → broaden, try search, or list_recent; never fabricate.
|
|
35
35
|
7. SESSION END — close_session(session_id) when work meaningfully complete.
|
|
36
|
-
8. SCOPE IS OPT-IN (v3.6.15) — 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.
|
|
36
|
+
8. SCOPE IS OPT-IN (v3.6.15) — 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.
|
|
37
|
+
9. PROFILE CONTEXT (v3.8.0) — session_init and all memory ops use the active profile. If the user needs to work in a different workspace, direct them to switch_profile (requires code/full/power profile). See slm-profile.
|
|
38
|
+
10. 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.
|
|
37
39
|
|
|
38
40
|
# CLI fallback (MCP unavailable)
|
|
39
41
|
recall→`slm recall "<q>" --limit N` (add `--include-global`/`--include-shared` only on explicit user request) · search→`slm search "<q>"` · remember→`slm remember "<c>" --tags a,b` (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`. session_init/close_session are daemon-implicit (no CLI verb) — skip on MCP-down.
|
|
40
42
|
|
|
43
|
+
# Related skills
|
|
44
|
+
slm-recall · slm-remember · slm-session · slm-scope · slm-profile · slm-governance
|
|
45
|
+
|
|
41
46
|
# What NOT to do
|
|
42
|
-
Never session_init twice; never forget dry_run=False without reporting preview; never dump a whole file into remember; never invent a memory; never claim "saved" without success:true / clean CLI exit.
|
|
47
|
+
Never session_init twice; never forget dry_run=False without reporting preview; 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.
|
|
43
48
|
|
|
44
|
-
SuperLocalMemory v3.
|
|
49
|
+
SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
|
|
@@ -16,7 +16,7 @@ You are the SLM optimize advisor. You reduce context-window pressure using Surfa
|
|
|
16
16
|
# When to act
|
|
17
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
18
|
|
|
19
|
-
# Tools (real SLM MCP tools,
|
|
19
|
+
# Tools (real SLM MCP tools, core profile)
|
|
20
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
21
|
|
|
22
22
|
# Decision rules (the 8 — apply automatically)
|
|
@@ -29,10 +29,16 @@ slm_compress(content,mode,reversible,ttl_seconds)→compressed,lossy,ccr_id (mod
|
|
|
29
29
|
7. Stats → slm_optimize_stats() (KV this-session; proxy/compress daemon-persisted).
|
|
30
30
|
8. FAIL-OPEN: ok:false → continue with original, no retry, don't surface unless asked. Never block the task.
|
|
31
31
|
|
|
32
|
+
# Profile context (v3.8.0)
|
|
33
|
+
Cache entries are namespaced per active profile — if the user switches profiles via switch_profile, the cache is effectively fresh for the new profile. Do not carry ccr_id values across profile switches.
|
|
34
|
+
|
|
32
35
|
# CLI fallback
|
|
33
36
|
stats→`slm optimize status`/`savings` · compress→`slm compress` · cache→`slm cache ...`. If CLI also fails, drop optimization silently (rule 8).
|
|
34
37
|
|
|
38
|
+
# Related skills
|
|
39
|
+
slm-compress · slm-cache · slm-status · slm-profile
|
|
40
|
+
|
|
35
41
|
# What NOT to do
|
|
36
|
-
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
|
|
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 carry ccr_ids across profile switches.
|
|
37
43
|
|
|
38
|
-
SuperLocalMemory v3.
|
|
44
|
+
SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Every lap persists as queryable SLM memory (tag `loop:<name>`); inspect with
|
|
25
|
+
`slm loop history` and `slm loop show <run_id>`, so the run is auditable and
|
|
26
|
+
resumable. `slm loop demo` shows the control flow end to end.
|
|
27
|
+
4. **Report the exact terminal status** — `DONE` (gate passed + approved),
|
|
28
|
+
`HALT` (a bound tripped), `PAUSE` (approval pending), `KILLED` (kill switch),
|
|
29
|
+
or `ERROR` (runner/gate failed). Never describe a non-DONE outcome as
|
|
30
|
+
success; when halted, name the bound; when errored, quote the short detail
|
|
31
|
+
and the ledger `run_id`.
|
package/plugin/hooks/hooks.json
CHANGED
|
@@ -17,6 +17,85 @@
|
|
|
17
17
|
"command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/ensure-venv.sh\""
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"hooks": [
|
|
23
|
+
{
|
|
24
|
+
"type": "command",
|
|
25
|
+
"command": "slm hook start 2>/dev/null || true",
|
|
26
|
+
"timeout": 15000
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"PostToolUse": [
|
|
32
|
+
{
|
|
33
|
+
"matcher": "Write|Edit",
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"type": "command",
|
|
37
|
+
"command": "slm hook checkpoint 2>/dev/null || true",
|
|
38
|
+
"timeout": 5000
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"matcher": "Bash|Read|Write|Edit|Glob|Grep|Agent|WebFetch|WebSearch|NotebookEdit",
|
|
44
|
+
"hooks": [
|
|
45
|
+
{
|
|
46
|
+
"type": "command",
|
|
47
|
+
"command": "slm hook post_tool_outcome 2>/dev/null || true",
|
|
48
|
+
"timeout": 5000
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"UserPromptSubmit": [
|
|
54
|
+
{
|
|
55
|
+
"hooks": [
|
|
56
|
+
{
|
|
57
|
+
"type": "command",
|
|
58
|
+
"command": "slm hook user_prompt_rehash 2>/dev/null || true",
|
|
59
|
+
"timeout": 5000
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"hooks": [
|
|
65
|
+
{
|
|
66
|
+
"type": "command",
|
|
67
|
+
"command": "slm hook topic_shift 2>/dev/null || true",
|
|
68
|
+
"timeout": 3000
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"Stop": [
|
|
74
|
+
{
|
|
75
|
+
"hooks": [
|
|
76
|
+
{
|
|
77
|
+
"type": "command",
|
|
78
|
+
"command": "slm hook stop 2>/dev/null || true",
|
|
79
|
+
"timeout": 10000
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "command",
|
|
83
|
+
"command": "slm hook stop_outcome 2>/dev/null || true",
|
|
84
|
+
"timeout": 10000
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"PreToolUse": [
|
|
90
|
+
{
|
|
91
|
+
"matcher": "WebSearch|WebFetch",
|
|
92
|
+
"hooks": [
|
|
93
|
+
{
|
|
94
|
+
"type": "command",
|
|
95
|
+
"command": "slm hook before_web 2>/dev/null || true",
|
|
96
|
+
"timeout": 5000
|
|
97
|
+
}
|
|
98
|
+
]
|
|
20
99
|
}
|
|
21
100
|
]
|
|
22
101
|
}
|
package/plugin/requirements.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
superlocalmemory==3.
|
|
1
|
+
superlocalmemory==3.8.0
|
|
@@ -4,20 +4,59 @@
|
|
|
4
4
|
# Cross-platform counterpart: slm-launch.bat (Windows)
|
|
5
5
|
# Referenced by plugin/.mcp.json as the MCP server command.
|
|
6
6
|
#
|
|
7
|
-
# Resolves the correct
|
|
7
|
+
# Resolves the correct slm binary for POSIX and joins the namespace daemon
|
|
8
8
|
# before opening the MCP stdio transport. This preserves one writer for all
|
|
9
9
|
# parallel Claude sessions that share CLAUDE_PLUGIN_DATA.
|
|
10
10
|
#
|
|
11
11
|
# On Windows, Claude Code invokes slm-launch.bat instead (same-stem, .bat extension).
|
|
12
12
|
#
|
|
13
13
|
# Environment:
|
|
14
|
-
# CLAUDE_PLUGIN_DATA — persistent data dir where venv lives
|
|
14
|
+
# CLAUDE_PLUGIN_DATA — persistent data dir where the plugin venv lives
|
|
15
|
+
# SLM_DATA_DIR — optional; SLM data dir (default: ~/.superlocalmemory)
|
|
16
|
+
# SLM_LAUNCHER — optional; which slm binary to use:
|
|
17
|
+
# plugin (default) — the plugin venv binary
|
|
18
|
+
# system — the system `slm` on PATH
|
|
19
|
+
# <path> — an explicit slm binary (leading ~ expanded)
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
_SLM_DATA="${SLM_DATA_DIR:-$HOME/.superlocalmemory}"
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
# If a system daemon is already running (its pidfile points at a live process),
|
|
24
|
+
# there is no need to boot the plugin's own venv daemon — we can open an MCP
|
|
25
|
+
# writer against the daemon that is already up. This skips a redundant, slow
|
|
26
|
+
# venv bootstrap on every session start.
|
|
27
|
+
_daemon_running=0
|
|
28
|
+
if [ -f "${_SLM_DATA}/daemon.pid" ] \
|
|
29
|
+
&& kill -0 "$(cat "${_SLM_DATA}/daemon.pid" 2>/dev/null)" 2>/dev/null; then
|
|
30
|
+
_daemon_running=1
|
|
21
31
|
fi
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
case "${SLM_LAUNCHER:-plugin}" in
|
|
34
|
+
plugin)
|
|
35
|
+
SLM_BIN="${CLAUDE_PLUGIN_DATA}/venv/bin/slm"
|
|
36
|
+
# Only bootstrap the owned daemon when one is not already running.
|
|
37
|
+
if [ "${_daemon_running}" -eq 0 ]; then
|
|
38
|
+
if ! "${SLM_BIN}" serve start >&2; then
|
|
39
|
+
echo "SLM plugin: unable to start the owned daemon; refusing a direct MCP writer." >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
fi
|
|
43
|
+
exec "${SLM_BIN}" mcp
|
|
44
|
+
;;
|
|
45
|
+
system)
|
|
46
|
+
exec slm mcp
|
|
47
|
+
;;
|
|
48
|
+
*)
|
|
49
|
+
# Explicit binary path. Expand a leading ~ to $HOME WITHOUT eval — eval
|
|
50
|
+
# on an environment value is a command-injection foot-gun. Only tilde
|
|
51
|
+
# expansion is supported here; pass an already-expanded path for $VARs.
|
|
52
|
+
case "${SLM_LAUNCHER}" in
|
|
53
|
+
"~"*) _SLM_BIN="${HOME}${SLM_LAUNCHER#\~}" ;;
|
|
54
|
+
*) _SLM_BIN="${SLM_LAUNCHER}" ;;
|
|
55
|
+
esac
|
|
56
|
+
if [ ! -x "${_SLM_BIN}" ]; then
|
|
57
|
+
echo "SLM_LAUNCHER is not an executable slm binary: ${_SLM_BIN}" >&2
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
exec "${_SLM_BIN}" mcp
|
|
61
|
+
;;
|
|
62
|
+
esac
|
package/plugin/settings.json
CHANGED
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
"mcp__superlocalmemory__remember",
|
|
5
5
|
"mcp__superlocalmemory__recall",
|
|
6
6
|
"mcp__superlocalmemory__search",
|
|
7
|
+
"mcp__superlocalmemory__fetch",
|
|
8
|
+
"mcp__superlocalmemory__list_recent",
|
|
7
9
|
"mcp__superlocalmemory__session_init",
|
|
10
|
+
"mcp__superlocalmemory__close_session",
|
|
11
|
+
"mcp__superlocalmemory__build_code_graph",
|
|
12
|
+
"mcp__superlocalmemory__get_blast_radius",
|
|
13
|
+
"mcp__superlocalmemory__query_graph",
|
|
14
|
+
"mcp__superlocalmemory__semantic_search_code",
|
|
15
|
+
"mcp__superlocalmemory__get_review_context",
|
|
16
|
+
"mcp__superlocalmemory__detect_changes",
|
|
8
17
|
"mcp__superlocalmemory__slm_compress",
|
|
9
18
|
"mcp__superlocalmemory__slm_retrieve",
|
|
10
19
|
"mcp__superlocalmemory__slm_cache_get",
|
|
@@ -137,4 +137,12 @@ These subcommands control daemon-level cache settings. They do not read or write
|
|
|
137
137
|
|
|
138
138
|
---
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
## Related skills
|
|
141
|
+
|
|
142
|
+
- `slm-compress` — for large content reduction; cache and compress work together
|
|
143
|
+
- `slm-status` — view `cache_kv_hits`/`cache_kv_misses` counters from `slm_optimize_stats`
|
|
144
|
+
- `slm-profile` — cache entries are namespaced per profile; switching profiles gives a fresh cache namespace
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
|
|
@@ -140,4 +140,11 @@ Content over 1 MB (1 000 000 bytes UTF-8) is processed but `reversible` is force
|
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
|
143
|
-
|
|
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 v3.8.0 · Qualixar · AGPL-3.0-or-later
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-governance
|
|
3
|
+
description: Enterprise compliance and governed workspace behavior for SuperLocalMemory. Covers role-based access (admin/member/viewer), retention policies, audit trail, GDPR data export/erase, and how agents must behave when operating under workspace governance. Requires power MCP profile for audit/retention tools. Agents must never bypass governance controls.
|
|
4
|
+
when_to_use: |
|
|
5
|
+
- "What can I do in this workspace?" (role check)
|
|
6
|
+
- "Set a 90-day retention policy on this memory"
|
|
7
|
+
- "Show the audit trail for recent memory operations"
|
|
8
|
+
- "Export my data for GDPR compliance"
|
|
9
|
+
- "Delete all memories for user X (right to erasure)"
|
|
10
|
+
- "Configure 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, recall, search, remember, Bash
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# slm-governance — Enterprise Compliance and Governed Workspace Behavior
|
|
17
|
+
|
|
18
|
+
SuperLocalMemory supports enterprise deployments with role-based access control,
|
|
19
|
+
retention policies, audit logging, and GDPR compliance tooling. This skill
|
|
20
|
+
documents how agents must behave when operating in a governed workspace and how
|
|
21
|
+
to use the governance MCP tools (available in the `power` profile).
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Role model
|
|
26
|
+
|
|
27
|
+
Governed workspaces have three roles:
|
|
28
|
+
|
|
29
|
+
| Role | Read | Write personal | Write shared/global | Admin operations |
|
|
30
|
+
|------|------|---------------|---------------------|-----------------|
|
|
31
|
+
| `viewer` | Yes | No | No | No |
|
|
32
|
+
| `member` | Yes | Yes | Yes (within access list) | No |
|
|
33
|
+
| `admin` | Yes | Yes | Yes (unrestricted) | Yes |
|
|
34
|
+
|
|
35
|
+
**Agent behavior by role:**
|
|
36
|
+
|
|
37
|
+
- **Viewer**: Only call `recall`, `search`, `fetch`, `list_recent`. Never call
|
|
38
|
+
`remember`, `update_memory`, `forget`, or any write tool. If a write is
|
|
39
|
+
attempted, fail gracefully: "This workspace is read-only in viewer mode."
|
|
40
|
+
- **Member**: May write personal facts and shared facts with permitted profiles.
|
|
41
|
+
May NOT write `scope="global"` facts without explicit admin authorization.
|
|
42
|
+
May NOT call `set_retention_policy`, `audit_trail`, or `compact_memories`.
|
|
43
|
+
- **Admin**: Full access including governance tools in the `power` profile.
|
|
44
|
+
|
|
45
|
+
An agent operating in a governed workspace must check its role before any write
|
|
46
|
+
operation. Role information is visible in workspace configuration or via
|
|
47
|
+
`slm status --json` (the `role` field, if present).
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Retention policies
|
|
52
|
+
|
|
53
|
+
Retention policies control how long facts are stored before they become eligible
|
|
54
|
+
for decay. Available in the `power` MCP profile.
|
|
55
|
+
|
|
56
|
+
### Set a retention policy
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
set_retention_policy(
|
|
60
|
+
profile_id: str = "", # "" = active profile
|
|
61
|
+
days: int = 90, # facts older than this become decay-eligible
|
|
62
|
+
zone: str = "default", # retention zone name
|
|
63
|
+
)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Retention zones let you apply different policies to different fact categories:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
# Standard facts: 90-day retention
|
|
70
|
+
set_retention_policy(profile_id="", days=90, zone="default")
|
|
71
|
+
|
|
72
|
+
# Security findings: 365-day retention (compliance requirement)
|
|
73
|
+
set_retention_policy(profile_id="", days=365, zone="security")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Tag your facts with the zone name to route them to the right policy:
|
|
77
|
+
```
|
|
78
|
+
remember(content="Critical auth bypass in v2.1", tags="security,cve,finding", ...)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Check retention statistics
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
get_retention_stats()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Returns zone distribution, average fact age, and decay-eligible counts. Use this
|
|
88
|
+
to verify policies are working as expected.
|
|
89
|
+
|
|
90
|
+
### Check lifecycle status
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
get_lifecycle_status()
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Reports the state of the retention and decay subsystem — whether decay cycles are
|
|
97
|
+
running, when the next cycle runs, and any backlog.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Audit trail
|
|
102
|
+
|
|
103
|
+
`audit_trail` is available in the `power` profile. It returns a structured log of
|
|
104
|
+
recent memory operations (writes, reads, profile switches, policy changes).
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
audit_trail(
|
|
108
|
+
limit: int = 50, # number of entries to return
|
|
109
|
+
operation: str = "", # filter by operation type (e.g. "remember", "forget")
|
|
110
|
+
profile_id: str = "", # filter by profile; "" = active profile
|
|
111
|
+
)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Use this for:
|
|
115
|
+
- Compliance reviews ("what data was written in the last 30 days?")
|
|
116
|
+
- Investigating unexpected memory changes
|
|
117
|
+
- Generating audit reports for data controllers
|
|
118
|
+
|
|
119
|
+
The audit trail covers MCP and CLI operations. It does not record the content of
|
|
120
|
+
facts by default — only operation type, timestamp, agent ID, and fact ID.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## GDPR compliance
|
|
125
|
+
|
|
126
|
+
### Data export
|
|
127
|
+
|
|
128
|
+
SLM does not have a dedicated MCP export tool. For GDPR data subject access
|
|
129
|
+
requests, use the CLI:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Export all memories in a profile to JSON
|
|
133
|
+
slm status --json # confirm active profile
|
|
134
|
+
slm list --limit 9999 --json > export.json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For a complete export including entity graph data, run:
|
|
138
|
+
```bash
|
|
139
|
+
slm status --json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Contact your workspace admin to arrange a full database-level export if the CLI
|
|
143
|
+
output is insufficient for compliance purposes.
|
|
144
|
+
|
|
145
|
+
### Right to erasure
|
|
146
|
+
|
|
147
|
+
To erase all memories for a subject or project:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Step 1: preview what will be deleted (ALWAYS do this first)
|
|
151
|
+
slm forget "<subject or project name>" --dry-run --json
|
|
152
|
+
|
|
153
|
+
# Step 2: review the preview, then execute
|
|
154
|
+
slm forget "<subject or project name>" --yes --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For targeted deletion by fact ID:
|
|
158
|
+
```bash
|
|
159
|
+
slm delete <fact_id> --yes --json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
For data reconstruction prevention: after erasure, confirm the fact is gone by
|
|
163
|
+
running `slm recall "<content>"`. A successful erasure returns no results. Never
|
|
164
|
+
attempt to re-derive erased content from other stored facts.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## require-login
|
|
169
|
+
|
|
170
|
+
When `require_login` is enabled in workspace configuration, agents must
|
|
171
|
+
authenticate before any memory operation. SLM handles authentication at the
|
|
172
|
+
daemon level — agents do not need to pass credentials in tool calls. If an
|
|
173
|
+
agent receives an authentication error from any MCP tool, it must:
|
|
174
|
+
|
|
175
|
+
1. Stop the current operation immediately.
|
|
176
|
+
2. Report the authentication requirement to the user.
|
|
177
|
+
3. Never cache, retry, or work around the authentication block.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Scope enforcement in governed workspaces
|
|
182
|
+
|
|
183
|
+
In a governed workspace, scope restrictions are enforced server-side:
|
|
184
|
+
- **Viewers** cannot write any fact regardless of `scope` parameter.
|
|
185
|
+
- **Members** cannot write `scope="global"` unless their access list includes
|
|
186
|
+
the global scope — attempts return a permission error.
|
|
187
|
+
- **Admins** can write any scope.
|
|
188
|
+
|
|
189
|
+
Agents must not attempt to work around scope restrictions by splitting a global
|
|
190
|
+
fact into multiple shared facts to accumulate equivalent visibility.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Compact memories (admin-only)
|
|
195
|
+
|
|
196
|
+
`compact_memories` deduplicates and consolidates stored memories. This is an
|
|
197
|
+
admin operation — it can change fact IDs and remove content.
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
compact_memories(
|
|
201
|
+
profile_id: str = "", # "" = active profile
|
|
202
|
+
dry_run: bool = True, # ALWAYS true first — inspect before running
|
|
203
|
+
)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Always run with `dry_run=True` first and review the impact report. Never run
|
|
207
|
+
compaction without admin authorization.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Consistency check (admin-only)
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
consistency_check(profile_id: str = "")
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Verifies data integrity of the memory store — checks for orphaned entities,
|
|
218
|
+
broken references, and index-database mismatches. Use after migrations or
|
|
219
|
+
unexpected shutdowns. Returns a structured report.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Agent checklist for governed workspaces
|
|
224
|
+
|
|
225
|
+
Before each write operation:
|
|
226
|
+
- [ ] Confirm my role allows writes (viewer → skip; member/admin → proceed)
|
|
227
|
+
- [ ] Confirm scope is appropriate for my role (member → no global)
|
|
228
|
+
- [ ] Set correct tags including zone name if retention policy applies
|
|
229
|
+
- [ ] Pass `session_id` for full audit attribution
|
|
230
|
+
|
|
231
|
+
Before running any destructive operation (`forget`, `compact_memories`):
|
|
232
|
+
- [ ] Admin authorization confirmed
|
|
233
|
+
- [ ] Ran with `dry_run=True` and reviewed output
|
|
234
|
+
- [ ] GDPR: confirmed the subject or controller authorized the erasure
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Related skills
|
|
239
|
+
|
|
240
|
+
- `slm-scope` — scope model details (personal/shared/global)
|
|
241
|
+
- `slm-profile` — workspace isolation and profile switching
|
|
242
|
+
- `slm-remember` — fact storage reference (includes scope parameters)
|
|
243
|
+
- `slm-recall` — retrieval reference (includes scope read flags)
|
|
244
|
+
- `slm-mesh` — mesh tools (full/power profiles)
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
*SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later*
|
|
@@ -285,7 +285,8 @@ If `build_code_graph` returns `files_parsed: 0`, no supported source files were
|
|
|
285
285
|
|
|
286
286
|
## Profile Requirement
|
|
287
287
|
|
|
288
|
-
This skill uses graph tools that are only active under the `code` MCP profile
|
|
288
|
+
This skill uses graph tools that are only active under the `code` MCP profile
|
|
289
|
+
(or `full` / `power`). Your plugin `.mcp.json` must include:
|
|
289
290
|
|
|
290
291
|
```json
|
|
291
292
|
"env": {
|
|
@@ -293,8 +294,21 @@ This skill uses graph tools that are only active under the `code` MCP profile. Y
|
|
|
293
294
|
}
|
|
294
295
|
```
|
|
295
296
|
|
|
296
|
-
Without this, the six graph tools are not registered and will appear as unknown
|
|
297
|
+
Without this, the six graph tools are not registered and will appear as unknown
|
|
298
|
+
tools. Run `slm status` to confirm the active profile.
|
|
299
|
+
|
|
300
|
+
**Switching profiles at runtime (v3.8.0+):** Use `switch_profile("code")` via
|
|
301
|
+
MCP to activate the code profile in a session that started with a different
|
|
302
|
+
profile. See `slm-profile` for the full profile switching workflow.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Related skills
|
|
307
|
+
|
|
308
|
+
- `slm-profile` — workspace isolation and profile switching (required for code tools)
|
|
309
|
+
- `slm-recall` — retrieve architectural decisions before graph queries
|
|
310
|
+
- `slm-status` — confirm the active profile and graph index health
|
|
297
311
|
|
|
298
312
|
---
|
|
299
313
|
|
|
300
|
-
SuperLocalMemory v3.
|
|
314
|
+
SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
|