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.
Files changed (262) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/ATTRIBUTION.md +1 -3
  3. package/CHANGELOG.md +85 -0
  4. package/README.md +199 -29
  5. package/package.json +4 -2
  6. package/plugin/.claude-plugin/plugin.json +2 -2
  7. package/plugin/CLAUDE.md +8 -8
  8. package/plugin/agents/slm-governance-advisor.md +80 -0
  9. package/plugin/agents/slm-loop-runner.md +71 -0
  10. package/plugin/agents/slm-memory-advisor.md +10 -5
  11. package/plugin/agents/slm-optimize-advisor.md +9 -3
  12. package/plugin/commands/slm-loop.md +31 -0
  13. package/plugin/hooks/hooks.json +79 -0
  14. package/plugin/requirements.txt +1 -1
  15. package/plugin/scripts/slm-launch +46 -7
  16. package/plugin/settings.json +9 -0
  17. package/plugin/skills/slm-cache/SKILL.md +9 -1
  18. package/plugin/skills/slm-compress/SKILL.md +8 -1
  19. package/plugin/skills/slm-governance/SKILL.md +248 -0
  20. package/plugin/skills/slm-graph/SKILL.md +17 -3
  21. package/plugin/skills/slm-loop/SKILL.md +99 -0
  22. package/plugin/skills/slm-mesh/SKILL.md +282 -0
  23. package/plugin/skills/slm-profile/SKILL.md +148 -0
  24. package/plugin/skills/slm-recall/SKILL.md +46 -10
  25. package/plugin/skills/slm-remember/SKILL.md +48 -1
  26. package/plugin/skills/slm-scope/SKILL.md +176 -0
  27. package/plugin/skills/slm-session/SKILL.md +24 -1
  28. package/plugin/skills/slm-status/SKILL.md +18 -1
  29. package/plugin-src/agents/slm-governance-advisor.md +80 -0
  30. package/plugin-src/agents/slm-loop-runner.md +71 -0
  31. package/plugin-src/agents/slm-memory-advisor.md +10 -5
  32. package/plugin-src/agents/slm-optimize-advisor.md +9 -3
  33. package/plugin-src/commands/slm-loop.md +31 -0
  34. package/plugin-src/hooks/hooks.json +79 -0
  35. package/plugin-src/manifest.json +7 -2
  36. package/plugin-src/requirements.txt +1 -1
  37. package/plugin-src/rules/AGENTS.md +57 -18
  38. package/plugin-src/rules/CLAUDE.md.fragment +8 -8
  39. package/plugin-src/scripts/slm-launch +46 -7
  40. package/plugin-src/settings.json +9 -0
  41. package/plugin-src/skills/slm-cache/SKILL.md +9 -1
  42. package/plugin-src/skills/slm-compress/SKILL.md +8 -1
  43. package/plugin-src/skills/slm-governance/SKILL.md +248 -0
  44. package/plugin-src/skills/slm-graph/SKILL.md +17 -3
  45. package/plugin-src/skills/slm-loop/SKILL.md +99 -0
  46. package/plugin-src/skills/slm-mesh/SKILL.md +282 -0
  47. package/plugin-src/skills/slm-profile/SKILL.md +148 -0
  48. package/plugin-src/skills/slm-recall/SKILL.md +46 -10
  49. package/plugin-src/skills/slm-remember/SKILL.md +48 -1
  50. package/plugin-src/skills/slm-scope/SKILL.md +176 -0
  51. package/plugin-src/skills/slm-session/SKILL.md +24 -1
  52. package/plugin-src/skills/slm-status/SKILL.md +18 -1
  53. package/pyproject.toml +1 -2
  54. package/scripts/postinstall/validation.js +2 -0
  55. package/scripts/postinstall-interactive.js +74 -2
  56. package/src/superlocalmemory/__init__.py +1 -1
  57. package/src/superlocalmemory/access/__init__.py +3 -0
  58. package/src/superlocalmemory/access/rbac.py +477 -0
  59. package/src/superlocalmemory/cli/commands.py +96 -12
  60. package/src/superlocalmemory/cli/compress_cmd.py +17 -7
  61. package/src/superlocalmemory/cli/loop_cmd.py +192 -0
  62. package/src/superlocalmemory/cli/main.py +39 -4
  63. package/src/superlocalmemory/cli/mesh_cmd.py +38 -0
  64. package/src/superlocalmemory/cli/optimize_cmd.py +3 -0
  65. package/src/superlocalmemory/cli/pending_store.py +49 -13
  66. package/src/superlocalmemory/cli/proxy_cmd.py +4 -0
  67. package/src/superlocalmemory/cli/scale_engine_cmd.py +6 -0
  68. package/src/superlocalmemory/cli/setup_wizard.py +22 -13
  69. package/src/superlocalmemory/compliance/audit.py +6 -0
  70. package/src/superlocalmemory/compliance/gdpr.py +128 -138
  71. package/src/superlocalmemory/compliance/retention.py +176 -45
  72. package/src/superlocalmemory/core/backend_orchestrator.py +5 -43
  73. package/src/superlocalmemory/core/community_summary.py +267 -0
  74. package/src/superlocalmemory/core/config.py +216 -3
  75. package/src/superlocalmemory/core/consolidation_engine.py +95 -22
  76. package/src/superlocalmemory/core/context_cache.py +61 -18
  77. package/src/superlocalmemory/core/embedding_worker.py +17 -2
  78. package/src/superlocalmemory/core/embeddings.py +12 -1
  79. package/src/superlocalmemory/core/engine.py +17 -1
  80. package/src/superlocalmemory/core/engine_ingestion.py +29 -0
  81. package/src/superlocalmemory/core/engine_wiring.py +13 -0
  82. package/src/superlocalmemory/core/entity_community.py +178 -0
  83. package/src/superlocalmemory/core/graph_analyzer.py +39 -2
  84. package/src/superlocalmemory/core/graph_pruner.py +13 -8
  85. package/src/superlocalmemory/core/key_expander.py +138 -0
  86. package/src/superlocalmemory/core/maintenance.py +23 -0
  87. package/src/superlocalmemory/core/modes.py +1 -1
  88. package/src/superlocalmemory/core/mutations.py +2 -2
  89. package/src/superlocalmemory/core/pii.py +105 -0
  90. package/src/superlocalmemory/core/progressive_abstraction.py +208 -0
  91. package/src/superlocalmemory/core/recall_pipeline.py +2 -0
  92. package/src/superlocalmemory/core/recall_worker.py +20 -6
  93. package/src/superlocalmemory/core/scale_engine.py +60 -1
  94. package/src/superlocalmemory/core/security_primitives.py +40 -2
  95. package/src/superlocalmemory/core/store_pipeline.py +35 -11
  96. package/src/superlocalmemory/core/worker_pool.py +21 -6
  97. package/src/superlocalmemory/encoding/entity_reflexion.py +200 -0
  98. package/src/superlocalmemory/encoding/entity_resolver.py +34 -24
  99. package/src/superlocalmemory/encoding/fact_extractor.py +26 -1
  100. package/src/superlocalmemory/encoding/temporal_validator.py +64 -1
  101. package/src/superlocalmemory/evolution/evolution_store.py +122 -45
  102. package/src/superlocalmemory/evolution/llm_dispatch.py +12 -1
  103. package/src/superlocalmemory/evolution/model_selection.py +160 -0
  104. package/src/superlocalmemory/evolution/mutation_generator.py +16 -0
  105. package/src/superlocalmemory/evolution/skill_evolver.py +127 -42
  106. package/src/superlocalmemory/evolution/triggers.py +22 -13
  107. package/src/superlocalmemory/graph/cozo_backend.py +43 -20
  108. package/src/superlocalmemory/hooks/adapter_base.py +5 -1
  109. package/src/superlocalmemory/hooks/auto_recall.py +13 -1
  110. package/src/superlocalmemory/hooks/claude_code_hooks.py +11 -0
  111. package/src/superlocalmemory/hooks/codex_assets.py +64 -5
  112. package/src/superlocalmemory/hooks/hook_daemon.py +20 -3
  113. package/src/superlocalmemory/hooks/memory_protocol.py +54 -0
  114. package/src/superlocalmemory/hooks/portable_kit.py +114 -1
  115. package/src/superlocalmemory/infra/auth_middleware.py +28 -0
  116. package/src/superlocalmemory/infra/backup.py +12 -1
  117. package/src/superlocalmemory/infra/daemon_identity.py +40 -4
  118. package/src/superlocalmemory/infra/data_root.py +43 -4
  119. package/src/superlocalmemory/infra/event_bus.py +107 -24
  120. package/src/superlocalmemory/infra/rate_limiter.py +93 -0
  121. package/src/superlocalmemory/ingestion/adapter_manager.py +4 -1
  122. package/src/superlocalmemory/ingestion/credentials.py +1 -1
  123. package/src/superlocalmemory/learning/cross_project.py +28 -19
  124. package/src/superlocalmemory/learning/reward_proxy.py +42 -9
  125. package/src/superlocalmemory/loops/__init__.py +56 -0
  126. package/src/superlocalmemory/loops/budget.py +58 -0
  127. package/src/superlocalmemory/loops/engine.py +164 -0
  128. package/src/superlocalmemory/loops/ledger.py +243 -0
  129. package/src/superlocalmemory/loops/models.py +152 -0
  130. package/src/superlocalmemory/loops/rules.py +52 -0
  131. package/src/superlocalmemory/mcp/_daemon_proxy.py +3 -0
  132. package/src/superlocalmemory/mcp/_pool_adapter.py +2 -0
  133. package/src/superlocalmemory/mcp/profiles.py +103 -0
  134. package/src/superlocalmemory/mcp/server.py +21 -49
  135. package/src/superlocalmemory/mcp/tools_active.py +4 -7
  136. package/src/superlocalmemory/mcp/tools_code_graph.py +51 -5
  137. package/src/superlocalmemory/mcp/tools_core.py +50 -5
  138. package/src/superlocalmemory/mcp/tools_evolution.py +6 -3
  139. package/src/superlocalmemory/mcp/tools_loops.py +300 -0
  140. package/src/superlocalmemory/mcp/tools_mesh.py +140 -4
  141. package/src/superlocalmemory/mcp/tools_optimize.py +15 -8
  142. package/src/superlocalmemory/mesh/broker.py +237 -129
  143. package/src/superlocalmemory/mesh/remote_sync.py +50 -8
  144. package/src/superlocalmemory/optimize/NOTICE +1 -6
  145. package/src/superlocalmemory/optimize/adapters/anthropic_adapter.py +1 -4
  146. package/src/superlocalmemory/optimize/adapters/openai_adapter.py +1 -4
  147. package/src/superlocalmemory/optimize/cache/semantic.py +27 -19
  148. package/src/superlocalmemory/optimize/compress/align.py +32 -26
  149. package/src/superlocalmemory/optimize/compress/ccr.py +14 -71
  150. package/src/superlocalmemory/optimize/compress/router.py +105 -22
  151. package/src/superlocalmemory/optimize/config/defaults.py +1 -1
  152. package/src/superlocalmemory/optimize/config/schema.py +87 -4
  153. package/src/superlocalmemory/optimize/metrics/counters.py +13 -4
  154. package/src/superlocalmemory/optimize/metrics/estimator.py +0 -3
  155. package/src/superlocalmemory/optimize/proxy/_helpers.py +31 -4
  156. package/src/superlocalmemory/optimize/storage/db.py +38 -9
  157. package/src/superlocalmemory/optimize/storage/schema.py +10 -0
  158. package/src/superlocalmemory/parameterization/pattern_extractor.py +6 -3
  159. package/src/superlocalmemory/retrieval/agentic.py +1 -1
  160. package/src/superlocalmemory/retrieval/bm25_channel.py +68 -10
  161. package/src/superlocalmemory/retrieval/engine.py +168 -26
  162. package/src/superlocalmemory/retrieval/entity_channel.py +7 -5
  163. package/src/superlocalmemory/retrieval/hopfield_channel.py +9 -2
  164. package/src/superlocalmemory/retrieval/semantic_channel.py +114 -21
  165. package/src/superlocalmemory/retrieval/spreading_activation.py +11 -2
  166. package/src/superlocalmemory/retrieval/temporal_channel.py +48 -9
  167. package/src/superlocalmemory/retrieval/temporal_frame.py +102 -0
  168. package/src/superlocalmemory/retrieval/temporal_validity_filter.py +135 -0
  169. package/src/superlocalmemory/retrieval/time_window.py +181 -0
  170. package/src/superlocalmemory/server/api.py +21 -4
  171. package/src/superlocalmemory/server/profile_runtime.py +125 -8
  172. package/src/superlocalmemory/server/rbac_enforce.py +142 -0
  173. package/src/superlocalmemory/server/recall_health.py +24 -3
  174. package/src/superlocalmemory/server/recall_serializer.py +19 -1
  175. package/src/superlocalmemory/server/routes/abstraction.py +115 -0
  176. package/src/superlocalmemory/server/routes/agents.py +128 -38
  177. package/src/superlocalmemory/server/routes/backup.py +34 -10
  178. package/src/superlocalmemory/server/routes/behavioral.py +13 -12
  179. package/src/superlocalmemory/server/routes/brain.py +21 -5
  180. package/src/superlocalmemory/server/routes/chat.py +72 -16
  181. package/src/superlocalmemory/server/routes/compliance.py +171 -21
  182. package/src/superlocalmemory/server/routes/config_api.py +436 -0
  183. package/src/superlocalmemory/server/routes/data_io.py +30 -8
  184. package/src/superlocalmemory/server/routes/entity.py +9 -4
  185. package/src/superlocalmemory/server/routes/events.py +24 -8
  186. package/src/superlocalmemory/server/routes/evolution.py +135 -17
  187. package/src/superlocalmemory/server/routes/helpers.py +16 -1
  188. package/src/superlocalmemory/server/routes/ingest.py +7 -4
  189. package/src/superlocalmemory/server/routes/insights.py +3 -3
  190. package/src/superlocalmemory/server/routes/learning.py +14 -14
  191. package/src/superlocalmemory/server/routes/lifecycle.py +59 -8
  192. package/src/superlocalmemory/server/routes/memories.py +221 -49
  193. package/src/superlocalmemory/server/routes/mesh.py +95 -15
  194. package/src/superlocalmemory/server/routes/optimize.py +33 -1
  195. package/src/superlocalmemory/server/routes/prewarm.py +2 -0
  196. package/src/superlocalmemory/server/routes/profiles.py +63 -17
  197. package/src/superlocalmemory/server/routes/ratelimit.py +124 -0
  198. package/src/superlocalmemory/server/routes/rbac.py +367 -0
  199. package/src/superlocalmemory/server/routes/stats.py +13 -6
  200. package/src/superlocalmemory/server/routes/tiers.py +11 -9
  201. package/src/superlocalmemory/server/routes/v3_api.py +194 -81
  202. package/src/superlocalmemory/server/routes/ws.py +5 -2
  203. package/src/superlocalmemory/server/security_middleware.py +12 -5
  204. package/src/superlocalmemory/server/ui.py +30 -5
  205. package/src/superlocalmemory/server/unified_daemon.py +431 -75
  206. package/src/superlocalmemory/server/write_identity.py +38 -8
  207. package/src/superlocalmemory/storage/database.py +265 -53
  208. package/src/superlocalmemory/storage/migration_runner.py +53 -0
  209. package/src/superlocalmemory/storage/migrations/M021_ingestion_log_profile.py +108 -0
  210. package/src/superlocalmemory/storage/migrations/M022_entity_aliases_profile.py +86 -0
  211. package/src/superlocalmemory/storage/migrations/M023_mesh_profile_isolation.py +194 -0
  212. package/src/superlocalmemory/storage/migrations/M024_rbac_users_roles.py +87 -0
  213. package/src/superlocalmemory/storage/migrations/M025_perf_indexes.py +90 -0
  214. package/src/superlocalmemory/storage/migrations/M026_rbac_memberships_fk.py +136 -0
  215. package/src/superlocalmemory/storage/migrations/M027_transferable_patterns_profile.py +163 -0
  216. package/src/superlocalmemory/storage/models.py +4 -0
  217. package/src/superlocalmemory/storage/schema.py +87 -0
  218. package/src/superlocalmemory/storage/schema_v32.py +0 -9
  219. package/src/superlocalmemory/storage/schema_v343.py +24 -12
  220. package/src/superlocalmemory/trust/gate.py +49 -8
  221. package/src/superlocalmemory/ui/assets/slm-icon-white.svg +64 -0
  222. package/src/superlocalmemory/ui/assets/slm-icon.svg +36 -0
  223. package/src/superlocalmemory/ui/css/design-system.css +621 -0
  224. package/src/superlocalmemory/ui/css/neural-glass.css +6 -0
  225. package/src/superlocalmemory/ui/css/od-bridge.css +158 -0
  226. package/src/superlocalmemory/ui/favicon.svg +35 -4
  227. package/src/superlocalmemory/ui/index.html +306 -173
  228. package/src/superlocalmemory/ui/js/brain.js +5 -20
  229. package/src/superlocalmemory/ui/js/core.js +47 -31
  230. package/src/superlocalmemory/ui/js/dashboard.js +314 -63
  231. package/src/superlocalmemory/ui/js/event-delegation.js +102 -0
  232. package/src/superlocalmemory/ui/js/knowledge-graph.js +11 -11
  233. package/src/superlocalmemory/ui/js/math-health.js +1 -1
  234. package/src/superlocalmemory/ui/js/memories.js +15 -4
  235. package/src/superlocalmemory/ui/js/memory-chat.js +7 -7
  236. package/src/superlocalmemory/ui/js/ng-entities.js +6 -8
  237. package/src/superlocalmemory/ui/js/ng-ingestion.js +4 -4
  238. package/src/superlocalmemory/ui/js/ng-mesh.js +4 -9
  239. package/src/superlocalmemory/ui/js/ng-shell.js +8 -8
  240. package/src/superlocalmemory/ui/js/ng-skills.js +54 -2
  241. package/src/superlocalmemory/ui/js/od-agents.js +544 -0
  242. package/src/superlocalmemory/ui/js/od-auth-gate.js +257 -0
  243. package/src/superlocalmemory/ui/js/od-backup.js +780 -0
  244. package/src/superlocalmemory/ui/js/od-brain.js +779 -0
  245. package/src/superlocalmemory/ui/js/od-entities.js +579 -0
  246. package/src/superlocalmemory/ui/js/od-graph.js +593 -0
  247. package/src/superlocalmemory/ui/js/od-health.js +539 -0
  248. package/src/superlocalmemory/ui/js/od-mcp.js +508 -0
  249. package/src/superlocalmemory/ui/js/od-memories.js +887 -0
  250. package/src/superlocalmemory/ui/js/od-mesh.js +539 -0
  251. package/src/superlocalmemory/ui/js/od-operations.js +1250 -0
  252. package/src/superlocalmemory/ui/js/od-optimize.js +787 -0
  253. package/src/superlocalmemory/ui/js/od-settings.js +1053 -0
  254. package/src/superlocalmemory/ui/js/od-shell.js +593 -0
  255. package/src/superlocalmemory/ui/js/od-skills.js +573 -0
  256. package/src/superlocalmemory/ui/js/od-team.js +258 -0
  257. package/src/superlocalmemory/ui/js/profiles.js +159 -46
  258. package/src/superlocalmemory/ui/js/settings.js +2 -2
  259. package/src/superlocalmemory/ui/js/timeline.js +34 -5
  260. package/src/superlocalmemory/ui/js/trust-dashboard.js +2 -2
  261. package/src/superlocalmemory/vector/lancedb_backend.py +8 -6
  262. package/src/superlocalmemory/learning/behavioral_listener.py +0 -94
@@ -0,0 +1,282 @@
1
+ ---
2
+ name: slm-mesh
3
+ description: Cross-session peer coordination via the SLM mesh network. Lets multiple AI agent sessions on the same machine discover each other, send messages, share lightweight state, and lock files to avoid conflicts. Requires full, power, or mesh MCP profile. All 8 tools are MCP-only — there is no CLI fallback.
4
+ when_to_use: |
5
+ - Multiple agent sessions running simultaneously on the same machine
6
+ - "Announce what I'm working on to other sessions"
7
+ - "Check if another agent has locked a file before I edit it"
8
+ - "Send a message to the other Claude session"
9
+ - "Is anyone else working on this project?"
10
+ - Parallel agent workflows needing coordination
11
+ - Cross-session state sharing without persisting to the memory store
12
+ allowed-tools: mesh_summary, mesh_peers, mesh_send, mesh_inbox, mesh_state, mesh_lock, mesh_events, mesh_status, Bash
13
+ ---
14
+
15
+ # slm-mesh — Cross-Session Peer Coordination
16
+
17
+ The mesh network lets multiple AI agent sessions on the same machine discover
18
+ each other and coordinate in real time — without writing to the persistent
19
+ memory store. Mesh messages are transient (48-hour TTL); they complement memory
20
+ (which is durable) rather than replacing it.
21
+
22
+ Mesh is local-only: it uses the SLM daemon as a local broker. No data leaves
23
+ the machine.
24
+
25
+ ---
26
+
27
+ ## Profile requirement
28
+
29
+ Mesh tools are available in the `full`, `power`, and `mesh` MCP profiles.
30
+ Confirm the active profile with `slm status` before calling mesh tools. If the
31
+ tools are not available, switch to `full` profile with `switch_profile("full")`
32
+ (requires `code` or higher active profile). See `slm-profile`.
33
+
34
+ ---
35
+
36
+ ## Tool reference
37
+
38
+ ### 1. `mesh_summary` — announce what this session is doing
39
+
40
+ ```
41
+ mesh_summary(summary: str = "") -> dict
42
+ ```
43
+
44
+ Call at session start to register on the mesh and announce your purpose. Other
45
+ sessions can see your summary via `mesh_peers`. The session stays alive via
46
+ automatic heartbeat.
47
+
48
+ ```
49
+ mesh_summary(summary="Refactoring auth module in api/src/auth/")
50
+ ```
51
+
52
+ Response: `{peer_id, summary, project_path, registered, heartbeat_active, broker_response}`
53
+
54
+ Call this once at the start of any session that will participate in the mesh.
55
+ The peer registration happens automatically at MCP startup, but calling
56
+ `mesh_summary` sets the human-readable description that other agents see.
57
+
58
+ ---
59
+
60
+ ### 2. `mesh_peers` — list active sessions
61
+
62
+ ```
63
+ mesh_peers() -> dict
64
+ ```
65
+
66
+ Returns all active peer sessions on this machine.
67
+
68
+ ```
69
+ mesh_peers()
70
+ ```
71
+
72
+ Response: `{peers: [{peer_id, summary, project_path, last_seen}], count, my_peer_id}`
73
+
74
+ Use this to discover other sessions before sending a message or checking for
75
+ conflicts.
76
+
77
+ ---
78
+
79
+ ### 3. `mesh_send` — send a message to another session
80
+
81
+ ```
82
+ mesh_send(
83
+ to: str, # peer_id | "broadcast" | "project:/path/to/dir"
84
+ message: str, # max 4 KB — use file paths for large data
85
+ ) -> dict
86
+ ```
87
+
88
+ Send a targeted, broadcast, or project-wide message.
89
+
90
+ ```
91
+ # Direct message to a specific peer
92
+ peers = await mesh_peers()
93
+ target_id = peers["peers"][0]["peer_id"]
94
+ mesh_send(to=target_id, message="I'm starting work on auth/handler.py — please hold off")
95
+
96
+ # Broadcast to all sessions
97
+ mesh_send(to="broadcast", message="Deploying to staging in 5 minutes")
98
+
99
+ # Message all sessions working in the same project
100
+ mesh_send(to="project:/Users/me/myproject", message="Tests are green on main")
101
+ ```
102
+
103
+ **4 KB message cap.** For large payloads (diffs, file contents), write to a file
104
+ and send the path instead. The circuit breaker opens automatically if the daemon
105
+ is repeatedly unreachable — `mesh_send` returns `ok: false` in that case.
106
+
107
+ ---
108
+
109
+ ### 4. `mesh_inbox` — read messages sent to this session
110
+
111
+ ```
112
+ mesh_inbox() -> dict
113
+ ```
114
+
115
+ Returns unread messages (direct, broadcast, and project-targeted). Messages are
116
+ automatically marked as read after retrieval.
117
+
118
+ ```
119
+ inbox = await mesh_inbox()
120
+ for msg in inbox["messages"]:
121
+ print(msg["from"], msg["content"])
122
+ ```
123
+
124
+ Response: `{messages: [{id, from, content, sent_at, read}], count, unread}`
125
+
126
+ Messages auto-expire after 48 hours.
127
+
128
+ ---
129
+
130
+ ### 5. `mesh_state` — get or set shared coordination state
131
+
132
+ ```
133
+ mesh_state(
134
+ key: str = "",
135
+ value: str = "",
136
+ action: str = "get", # "get" | "set"
137
+ ) -> dict
138
+ ```
139
+
140
+ Shared state is visible to all authenticated peers. Use it for non-secret
141
+ coordination metadata: feature flags, task assignments, progress markers.
142
+
143
+ ```
144
+ # Set state
145
+ mesh_state(key="deploy_in_progress", value="true", action="set")
146
+ mesh_state(key="current_reviewer", value=my_peer_id, action="set")
147
+
148
+ # Read one key
149
+ mesh_state(key="deploy_in_progress", action="get")
150
+
151
+ # Read all state
152
+ mesh_state(action="get")
153
+ ```
154
+
155
+ **Security constraint:** Credentials, tokens, passwords, and API keys are
156
+ rejected by the broker. Never store secrets in shared state.
157
+
158
+ ---
159
+
160
+ ### 6. `mesh_lock` — file lock coordination
161
+
162
+ ```
163
+ mesh_lock(
164
+ file_path: str, # must be an absolute path
165
+ action: str = "query", # "query" | "acquire" | "release"
166
+ ) -> dict
167
+ ```
168
+
169
+ Check, acquire, or release a file lock before editing a shared file.
170
+
171
+ ```
172
+ # Step 1: check if the file is already locked
173
+ lock = await mesh_lock(file_path="/abs/path/to/auth/handler.py", action="query")
174
+
175
+ if lock.get("locked"):
176
+ print(f"File is locked by {lock['locked_by']} — wait")
177
+ else:
178
+ # Step 2: acquire the lock
179
+ mesh_lock(file_path="/abs/path/to/auth/handler.py", action="acquire")
180
+
181
+ # ... edit the file ...
182
+
183
+ # Step 3: release the lock when done
184
+ mesh_lock(file_path="/abs/path/to/auth/handler.py", action="release")
185
+ ```
186
+
187
+ `file_path` must be an absolute path (starts with `/` on Unix, drive letter on
188
+ Windows). Relative paths are rejected.
189
+
190
+ ---
191
+
192
+ ### 7. `mesh_events` — recent mesh activity log
193
+
194
+ ```
195
+ mesh_events() -> dict
196
+ ```
197
+
198
+ Returns the activity log for the mesh network: peer joins, leaves, messages sent,
199
+ and state changes. Use to understand what other sessions have been doing.
200
+
201
+ ---
202
+
203
+ ### 8. `mesh_status` — mesh broker health
204
+
205
+ ```
206
+ mesh_status() -> dict
207
+ ```
208
+
209
+ Returns broker uptime, peer count, and connection health. Use at session start
210
+ to confirm the mesh is available before relying on coordination.
211
+
212
+ Response includes: `broker_up`, `peer_count`, `uptime_seconds`, `my_peer_id`,
213
+ `heartbeat_active`.
214
+
215
+ ---
216
+
217
+ ## Common workflow: parallel agents coordinating on a shared repo
218
+
219
+ ```
220
+ # Both agents call at session start:
221
+ await mesh_summary(summary="Working on feature/auth-refactor")
222
+
223
+ # Agent A: check who else is active
224
+ peers = await mesh_peers()
225
+ # → sees Agent B working on the same project
226
+
227
+ # Agent A: before editing a shared file
228
+ lock = await mesh_lock("/repo/src/auth/handler.py", action="query")
229
+ if not lock.get("locked"):
230
+ await mesh_lock("/repo/src/auth/handler.py", action="acquire")
231
+ # ... edit handler.py ...
232
+ await mesh_lock("/repo/src/auth/handler.py", action="release")
233
+
234
+ # Agent A: after finishing a phase
235
+ await mesh_send(to="project:/repo", message="Auth refactor complete — handler.py ready for review")
236
+
237
+ # Agent B: check inbox
238
+ inbox = await mesh_inbox()
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Mesh vs memory: when to use which
244
+
245
+ | Need | Use |
246
+ |------|-----|
247
+ | Ephemeral coordination signal (< 48h) | `mesh_send` / `mesh_state` |
248
+ | Durable fact across sessions/days | `remember` |
249
+ | File conflict prevention | `mesh_lock` |
250
+ | Cross-profile fact sharing | `scope="shared"/"global"` on `remember` |
251
+ | Session announcement | `mesh_summary` |
252
+ | Finding parallel agents | `mesh_peers` |
253
+
254
+ ---
255
+
256
+ ## Error handling
257
+
258
+ All 8 mesh tools return structured errors — they never raise exceptions.
259
+
260
+ | Error | Cause | Action |
261
+ |-------|-------|--------|
262
+ | `broker_up: false` from `mesh_status` | Daemon not running or mesh not configured | Run `slm status` to check daemon health |
263
+ | `ok: false` from `mesh_send` with circuit-breaker message | Repeated daemon unreachability | Daemon unreachable; stop sending until broker is up |
264
+ | `ok: false` from `mesh_lock` | Lock operation failed | Check `file_path` is absolute; retry once |
265
+ | Empty `peers` from `mesh_peers` | No other sessions registered | You're the only active session |
266
+
267
+ Mesh failures are non-fatal for the primary task. If `mesh_status` shows
268
+ `broker_up: false`, proceed without mesh coordination — do not block work on
269
+ mesh availability.
270
+
271
+ ---
272
+
273
+ ## Related skills
274
+
275
+ - `slm-profile` — activate full/power/mesh profile to access mesh tools
276
+ - `slm-scope` — for durable cross-profile sharing (complement to transient mesh state)
277
+ - `slm-remember` — persist coordination decisions that should survive session end
278
+ - `slm-governance` — enterprise governance of mesh (who can send/receive)
279
+
280
+ ---
281
+
282
+ *SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later*
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: slm-profile
3
+ description: Workspace isolation and runtime profile switching for SuperLocalMemory. Each profile is a fully independent memory namespace — separate facts, code graphs, and tool sets. Use switch_profile (MCP, requires code/full/power profile) to change the active workspace without restarting. Check the active profile with slm status. Required when working across multiple projects, clients, or tenants.
4
+ when_to_use: |
5
+ - "Switch to my work profile"
6
+ - "Use the code profile for this session"
7
+ - "What profile am I currently in?"
8
+ - "I need mesh tools — switch to full profile"
9
+ - "Load the devops workspace"
10
+ - Multi-project workflows needing memory isolation
11
+ - Switching between personal and team workspaces
12
+ - Enabling additional MCP tools by activating a richer profile
13
+ allowed-tools: switch_profile, Bash
14
+ ---
15
+
16
+ # slm-profile — Workspace Isolation and Profile Switching
17
+
18
+ A profile is a fully isolated memory workspace. Each profile has its own:
19
+ - Memory facts (nothing bleeds across profiles by default)
20
+ - Code graph index (separate per repo/project)
21
+ - Active MCP tool set (determined by profile tier)
22
+ - Retention policy and decay settings
23
+
24
+ Profiles are the right tool when you have genuinely separate contexts: a personal
25
+ project, a client engagement, a production vs staging environment.
26
+
27
+ ---
28
+
29
+ ## Available profiles and their tool sets
30
+
31
+ | Profile | Tools | When to use |
32
+ |---------|-------|-------------|
33
+ | `core` | 14 tools — remember, recall, search, session, optimize | Minimal footprint, no code tools |
34
+ | `code` | 24 tools — core + 6 code-graph tools + switch_profile + 3 bounded-loop tools | Default for IDE/coding agents |
35
+ | `full` | 42 tools — code + all memory ops + mesh + bounded loops | Multi-session, team workflows |
36
+ | `power` | 54 tools — full + governance + behavioral tools | Enterprise, admin, audit use cases |
37
+ | `mesh` | 8 tools — mesh coordination only | Lightweight cross-session signalling |
38
+
39
+ The profile is set at MCP server startup via `SLM_MCP_PROFILE` in the MCP config.
40
+ `switch_profile` lets you change it at runtime without a restart.
41
+
42
+ ---
43
+
44
+ ## Checking the active profile
45
+
46
+ ```bash
47
+ slm status --json
48
+ ```
49
+
50
+ The `profile` field in the output is the currently active profile name.
51
+
52
+ Or via MCP (works in any profile):
53
+
54
+ ```bash
55
+ slm status
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Switching profiles at runtime (v3.8.0+)
61
+
62
+ `switch_profile` is available in `code`, `full`, and `power` profiles.
63
+
64
+ ```
65
+ switch_profile(
66
+ profile: str, # one of: "core", "code", "full", "power", "mesh"
67
+ )
68
+ ```
69
+
70
+ ### Example: activate full profile to access mesh tools
71
+
72
+ ```
73
+ # You started in code profile but need mesh coordination
74
+ switch_profile(profile="full")
75
+
76
+ # Now mesh_peers, mesh_send, mesh_inbox, etc. are available
77
+ mesh_peers()
78
+ ```
79
+
80
+ ### Example: switch workspaces
81
+
82
+ ```
83
+ # Switch from personal to work workspace
84
+ switch_profile(profile="work-project")
85
+ ```
86
+
87
+ Wait — profile names and workspace names are distinct concepts:
88
+ - **Profile tier** (`core`, `code`, `full`, `power`, `mesh`) controls which MCP
89
+ tools are registered.
90
+ - **Workspace / data directory** (`SLM_DATA_DIR`) controls which memory database
91
+ is used.
92
+
93
+ `switch_profile` changes the **tool tier** within the current workspace. To
94
+ switch to a completely different memory database (workspace), you need to change
95
+ `SLM_DATA_DIR` — this requires restarting the MCP server or using a separately
96
+ configured MCP server instance.
97
+
98
+ ---
99
+
100
+ ## Configuring the initial profile
101
+
102
+ In your `.mcp.json` (Claude Code) or `.codex/config.toml` (Codex):
103
+
104
+ ```json
105
+ "env": {
106
+ "SLM_MCP_PROFILE": "code",
107
+ "SLM_DATA_DIR": "~/.superlocalmemory"
108
+ }
109
+ ```
110
+
111
+ Profile aliases from older versions still resolve: `code20` → `code`,
112
+ `full38` → `full`, `power50` → `power`. Stale configs get a startup warning
113
+ but continue to work.
114
+
115
+ ---
116
+
117
+ ## Profile isolation guarantees
118
+
119
+ - `recall` returns only memories in the active profile (plus opt-in shared/global
120
+ facts — see `slm-scope`).
121
+ - `remember` writes to the active profile only unless `scope="shared"/"global"`.
122
+ - Code graph tools (`build_code_graph`, `get_blast_radius`, etc.) index into the
123
+ active profile's graph store.
124
+ - KV cache entries are namespaced per profile — switching profiles gives you a
125
+ clean cache.
126
+
127
+ ---
128
+
129
+ ## Multiple concurrent profiles
130
+
131
+ You can run multiple SLM MCP server instances simultaneously, each pointed at a
132
+ different `SLM_DATA_DIR`, to serve different workspaces in the same IDE session.
133
+ Name them differently in your MCP config (e.g. `superlocalmemory-personal` and
134
+ `superlocalmemory-work`) and route tool calls to the appropriate server.
135
+
136
+ ---
137
+
138
+ ## Related skills
139
+
140
+ - `slm-scope` — opt-in fact sharing across profiles (personal/shared/global)
141
+ - `slm-graph` — code-graph tools available in code/full/power profiles
142
+ - `slm-mesh` — mesh tools available in full/power/mesh profiles
143
+ - `slm-status` — check active profile name and tool inventory
144
+ - `slm-governance` — enterprise role-based access to profiles
145
+
146
+ ---
147
+
148
+ *SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later*
@@ -50,7 +50,7 @@ recall(
50
50
  query="authentication strategy decision",
51
51
  limit=20, # default 20; reduce to 5 for quick pre-task checks
52
52
  session_id="<sid>", # pass the session_id returned by session_init
53
- fast=False, # default False; True skips SpreadingActivation channel
53
+ fast=False, # default False; True enables faster, reduced-channel retrieval
54
54
  )
55
55
  ```
56
56
 
@@ -101,8 +101,8 @@ correctly, but feedback is not attributed to the session.
101
101
  ### 3. Fast mode
102
102
 
103
103
  Use `fast=True` for pre-tool-call checks where sub-second response matters.
104
- This skips the SpreadingActivation channel. The remaining channels semantic,
105
- lexical, temporal, and structural still run.
104
+ This enables a faster, reduced-channel mode. Core semantic and keyword channels
105
+ always run; additional graph and contextual channels are skipped.
106
106
 
107
107
  ```
108
108
  recall(query="rate limiting approach", limit=5, session_id="<sid>", fast=True)
@@ -142,12 +142,12 @@ once you have the `fact_id` for full content.
142
142
 
143
143
  ## How multi-channel retrieval works
144
144
 
145
- `recall` runs five candidate producers in parallel — semantic vector similarity,
146
- lexical BM25, temporal recency, spreading activation, and Hopfield — then fuses
147
- them with Reciprocal Rank Fusion (RRF), applies a reranker, and layers an
148
- optional entity-graph post-fusion score enhancement. The `channel_weights` field in the
149
- response shows how each channel contributed for that query. Weights adapt over
150
- time based on engagement signals attributed via `session_id`.
145
+ `recall` runs multiple candidate producers in parallel — semantic vector similarity,
146
+ keyword matching, temporal recency weighting, and contextual graph channels — then
147
+ fuses and reranks the combined results, with an optional entity-graph score
148
+ enhancement. The `channel_weights` field in the response shows how each channel
149
+ contributed for that query. Weights adapt over time based on engagement signals
150
+ attributed via `session_id`.
151
151
 
152
152
  To inspect per-channel scores for a real query against your own data:
153
153
 
@@ -202,4 +202,40 @@ trusts that what you surface came from the store.
202
202
 
203
203
  ---
204
204
 
205
- *SuperLocalMemory v3.6.18 · Qualixar · AGPL-3.0-or-later*
205
+ ## Multi-scope retrieval (v3.6.15+, opt-in)
206
+
207
+ By default `recall` returns only memories in the active profile (personal scope).
208
+ To also surface memories shared from other profiles, pass the scope flags:
209
+
210
+ ```
211
+ recall(
212
+ query="...",
213
+ include_global=True, # include global-scope memories (visible to all profiles)
214
+ include_shared=True, # include shared-scope memories (shared with this profile)
215
+ session_id="<sid>",
216
+ )
217
+ ```
218
+
219
+ Scope flags are **off by default**. Only enable them when the user explicitly asks
220
+ to see shared or global facts. See `slm-scope` for the full sharing model.
221
+
222
+ ---
223
+
224
+ ## Profile-aware retrieval (v3.8.0+)
225
+
226
+ `recall` always queries the currently active profile. To query a different
227
+ workspace, use `switch_profile` (requires `code`, `full`, or `power` MCP profile)
228
+ before recalling, then switch back. See `slm-profile` for workspace switching.
229
+
230
+ ---
231
+
232
+ ## Related skills
233
+
234
+ - `slm-remember` — store the decisions and facts that recall surfaces later
235
+ - `slm-session` — session lifecycle (must call before first recall)
236
+ - `slm-scope` — multi-scope sharing model (personal / shared / global)
237
+ - `slm-profile` — workspace isolation and profile switching
238
+
239
+ ---
240
+
241
+ *SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later*
@@ -191,4 +191,51 @@ slm remember "<content>" --scope shared --shared-with alice,bob
191
191
 
192
192
  ---
193
193
 
194
- *SuperLocalMemory v3.6.18 · Qualixar · AGPL-3.0-or-later*
194
+ ## Multi-scope sharing (v3.6.15+, opt-in)
195
+
196
+ Every `remember` call defaults to `personal` scope — private to the active profile.
197
+ To share a fact with other profiles on the same machine, set the `scope` parameter:
198
+
199
+ ```
200
+ # Share with every profile on this machine
201
+ remember(
202
+ content="API rate limit is 100 req/min per tenant",
203
+ tags="api,limits,shared",
204
+ project="platform",
205
+ scope="global", # visible to all profiles
206
+ session_id="<sid>",
207
+ )
208
+
209
+ # Share with specific profiles only
210
+ remember(
211
+ content="Staging DB migration runs Fridays 22:00 UTC",
212
+ tags="db,ops",
213
+ scope="shared",
214
+ shared_with="work-profile,devops-profile",
215
+ session_id="<sid>",
216
+ )
217
+ ```
218
+
219
+ **Only set scope when the user explicitly asks to share.** The default
220
+ `personal` scope is identical to single-profile SLM. See `slm-scope` for the
221
+ complete sharing model and when to use each scope.
222
+
223
+ ---
224
+
225
+ ## Profile-aware storage (v3.8.0+)
226
+
227
+ `remember` always stores in the active profile's namespace. To write to a
228
+ different workspace, use `switch_profile` first. See `slm-profile`.
229
+
230
+ ---
231
+
232
+ ## Related skills
233
+
234
+ - `slm-recall` — retrieve what was remembered
235
+ - `slm-session` — session lifecycle; session_id is required for attribution
236
+ - `slm-scope` — complete guide to personal / shared / global scopes
237
+ - `slm-profile` — workspace isolation and profile switching
238
+
239
+ ---
240
+
241
+ *SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later*