superlocalmemory 3.6.13 → 3.6.15

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 (147) hide show
  1. package/.claude-plugin/marketplace.json +17 -0
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +189 -740
  4. package/package.json +12 -5
  5. package/plugin/.claude-plugin/plugin.json +20 -0
  6. package/plugin/.mcp.json +12 -0
  7. package/plugin/CLAUDE.md +44 -0
  8. package/plugin/_GENERATED.md +6 -0
  9. package/plugin/agents/slm-memory-advisor.md +44 -0
  10. package/plugin/agents/slm-optimize-advisor.md +38 -0
  11. package/plugin/hooks/hooks.json +14 -0
  12. package/plugin/requirements.txt +1 -0
  13. package/plugin/scripts/ensure-venv.bat +122 -0
  14. package/plugin/scripts/ensure-venv.sh +105 -0
  15. package/plugin/scripts/slm-launch +15 -0
  16. package/plugin/scripts/slm-launch.bat +17 -0
  17. package/plugin/settings.json +16 -0
  18. package/plugin/skills/slm-cache/SKILL.md +140 -0
  19. package/plugin/skills/slm-compress/SKILL.md +143 -0
  20. package/plugin/skills/slm-graph/SKILL.md +300 -0
  21. package/plugin/skills/slm-recall/SKILL.md +204 -0
  22. package/plugin/skills/slm-remember/SKILL.md +194 -0
  23. package/plugin/skills/slm-session/SKILL.md +207 -0
  24. package/plugin/skills/slm-status/SKILL.md +149 -0
  25. package/plugin-src/.mcp.json +12 -0
  26. package/plugin-src/agents/slm-memory-advisor.md +44 -0
  27. package/plugin-src/agents/slm-optimize-advisor.md +38 -0
  28. package/plugin-src/commands/slm-optimize.md +22 -0
  29. package/plugin-src/commands/slm-recall.md +16 -0
  30. package/plugin-src/commands/slm-remember.md +16 -0
  31. package/plugin-src/commands/slm-status.md +15 -0
  32. package/plugin-src/hooks/.gitkeep +0 -0
  33. package/plugin-src/hooks/hooks.json +14 -0
  34. package/plugin-src/manifest.json +25 -0
  35. package/plugin-src/requirements.txt +1 -0
  36. package/plugin-src/rules/AGENTS.md +91 -0
  37. package/plugin-src/rules/CLAUDE.md.fragment +44 -0
  38. package/plugin-src/scripts/ensure-venv.bat +122 -0
  39. package/plugin-src/scripts/ensure-venv.sh +105 -0
  40. package/plugin-src/scripts/slm-launch +15 -0
  41. package/plugin-src/scripts/slm-launch.bat +17 -0
  42. package/plugin-src/settings.json +16 -0
  43. package/plugin-src/skills/slm-cache/SKILL.md +140 -0
  44. package/plugin-src/skills/slm-compress/SKILL.md +143 -0
  45. package/plugin-src/skills/slm-graph/SKILL.md +300 -0
  46. package/plugin-src/skills/slm-recall/SKILL.md +204 -0
  47. package/plugin-src/skills/slm-remember/SKILL.md +194 -0
  48. package/plugin-src/skills/slm-session/SKILL.md +207 -0
  49. package/plugin-src/skills/slm-status/SKILL.md +149 -0
  50. package/pyproject.toml +6 -2
  51. package/scripts/__tests__/build-plugin.test.mjs +613 -0
  52. package/scripts/_savings_math.py +270 -0
  53. package/scripts/build-plugin.js +742 -0
  54. package/scripts/dogfood_savings.py +490 -0
  55. package/scripts/install-skills.ps1 +4 -334
  56. package/scripts/install-skills.sh +4 -435
  57. package/scripts/postinstall-interactive.js +0 -27
  58. package/scripts/postinstall.js +21 -2
  59. package/src/superlocalmemory/__init__.py +1 -1
  60. package/src/superlocalmemory/cli/_lazy_init.py +115 -0
  61. package/src/superlocalmemory/cli/commands.py +439 -41
  62. package/src/superlocalmemory/cli/main.py +92 -4
  63. package/src/superlocalmemory/cli/setup_wizard.py +47 -6
  64. package/src/superlocalmemory/core/backend_orchestrator.py +12 -8
  65. package/src/superlocalmemory/core/config.py +194 -9
  66. package/src/superlocalmemory/core/embeddings.py +10 -5
  67. package/src/superlocalmemory/core/engine.py +76 -5
  68. package/src/superlocalmemory/core/fact_consolidator.py +20 -3
  69. package/src/superlocalmemory/core/platform_utils.py +8 -0
  70. package/src/superlocalmemory/core/recall_pipeline.py +7 -0
  71. package/src/superlocalmemory/core/recall_worker.py +7 -0
  72. package/src/superlocalmemory/core/store_pipeline.py +23 -1
  73. package/src/superlocalmemory/core/worker_pool.py +14 -2
  74. package/src/superlocalmemory/hooks/claude_code_hooks.py +27 -3
  75. package/src/superlocalmemory/hooks/portable_kit.py +506 -0
  76. package/src/superlocalmemory/hooks/session_registry.py +8 -4
  77. package/src/superlocalmemory/infra/cloud_backup.py +99 -23
  78. package/src/superlocalmemory/mcp/_daemon_proxy.py +12 -2
  79. package/src/superlocalmemory/mcp/_pool_adapter.py +15 -6
  80. package/src/superlocalmemory/mcp/cli_fallback.py +602 -0
  81. package/src/superlocalmemory/mcp/server.py +75 -4
  82. package/src/superlocalmemory/mcp/tools_code_graph.py +3 -3
  83. package/src/superlocalmemory/mcp/tools_core.py +37 -4
  84. package/src/superlocalmemory/mcp/tools_v3.py +6 -1
  85. package/src/superlocalmemory/mcp/tools_v33.py +8 -4
  86. package/src/superlocalmemory/optimize/cache/boundary_store.py +25 -6
  87. package/src/superlocalmemory/optimize/cache/centroid_store.py +27 -4
  88. package/src/superlocalmemory/optimize/cache/manager.py +92 -6
  89. package/src/superlocalmemory/optimize/cache/semantic.py +20 -1
  90. package/src/superlocalmemory/optimize/compress/ccr.py +12 -0
  91. package/src/superlocalmemory/optimize/compress/router.py +46 -13
  92. package/src/superlocalmemory/optimize/config/schema.py +6 -0
  93. package/src/superlocalmemory/optimize/proxy/_helpers.py +111 -8
  94. package/src/superlocalmemory/optimize/proxy/anthropic_surface.py +14 -4
  95. package/src/superlocalmemory/optimize/proxy/gemini_surface.py +23 -6
  96. package/src/superlocalmemory/optimize/proxy/openai_surface.py +10 -4
  97. package/src/superlocalmemory/optimize/proxy/server.py +11 -0
  98. package/src/superlocalmemory/optimize/proxy/vertex_surface.py +246 -0
  99. package/src/superlocalmemory/optimize/storage/db.py +30 -0
  100. package/src/superlocalmemory/retrieval/bm25_channel.py +12 -2
  101. package/src/superlocalmemory/retrieval/engine.py +36 -3
  102. package/src/superlocalmemory/retrieval/entity_channel.py +5 -5
  103. package/src/superlocalmemory/retrieval/hopfield_channel.py +10 -2
  104. package/src/superlocalmemory/retrieval/semantic_channel.py +10 -2
  105. package/src/superlocalmemory/server/recall_serializer.py +3 -1
  106. package/src/superlocalmemory/server/unified_daemon.py +156 -16
  107. package/src/superlocalmemory/storage/database.py +215 -43
  108. package/src/superlocalmemory/storage/migration_runner.py +17 -1
  109. package/src/superlocalmemory/storage/migrations/M016_add_scope_support.py +120 -0
  110. package/src/superlocalmemory/storage/models.py +10 -0
  111. package/src/superlocalmemory/storage/schema.py +15 -10
  112. package/src/superlocalmemory/ui/css/legacy-dashboard.css +18 -0
  113. package/src/superlocalmemory/ui/css/neural-glass.css +5 -0
  114. package/src/superlocalmemory/ui/index.html +2 -2
  115. package/src/superlocalmemory/ui/js/core.js +98 -0
  116. package/src/superlocalmemory/ui/js/dashboard.js +8 -1
  117. package/src/superlocalmemory/ui/js/ide-status.js +16 -3
  118. package/src/superlocalmemory/ui/js/math-health.js +15 -3
  119. package/src/superlocalmemory/ui/js/optimize.js +18 -2
  120. package/src/superlocalmemory/ui/js/trust-dashboard.js +10 -1
  121. package/src/superlocalmemory.egg-info/PKG-INFO +191 -741
  122. package/src/superlocalmemory.egg-info/SOURCES.txt +7 -9
  123. package/src/superlocalmemory.egg-info/requires.txt +1 -0
  124. package/ide/skills/slm-build-graph/SKILL.md +0 -423
  125. package/ide/skills/slm-list-recent/SKILL.md +0 -348
  126. package/ide/skills/slm-recall/SKILL.md +0 -326
  127. package/ide/skills/slm-remember/SKILL.md +0 -194
  128. package/ide/skills/slm-show-patterns/SKILL.md +0 -224
  129. package/ide/skills/slm-status/SKILL.md +0 -363
  130. package/ide/skills/slm-switch-profile/SKILL.md +0 -442
  131. package/skills/slm-build-graph/SKILL.md +0 -423
  132. package/skills/slm-list-recent/SKILL.md +0 -348
  133. package/skills/slm-optimize/README.md +0 -55
  134. package/skills/slm-optimize/SKILL.md +0 -139
  135. package/skills/slm-recall/SKILL.md +0 -343
  136. package/skills/slm-remember/SKILL.md +0 -194
  137. package/skills/slm-show-patterns/SKILL.md +0 -224
  138. package/skills/slm-status/SKILL.md +0 -363
  139. package/skills/slm-switch-profile/SKILL.md +0 -442
  140. package/src/superlocalmemory/cli/doctor_cmd.py +0 -152
  141. package/src/superlocalmemory/skills/slm-build-graph/SKILL.md +0 -423
  142. package/src/superlocalmemory/skills/slm-list-recent/SKILL.md +0 -348
  143. package/src/superlocalmemory/skills/slm-recall/SKILL.md +0 -343
  144. package/src/superlocalmemory/skills/slm-remember/SKILL.md +0 -194
  145. package/src/superlocalmemory/skills/slm-show-patterns/SKILL.md +0 -224
  146. package/src/superlocalmemory/skills/slm-status/SKILL.md +0 -363
  147. package/src/superlocalmemory/skills/slm-switch-profile/SKILL.md +0 -442
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superlocalmemory
3
- Version: 3.6.13
3
+ Version: 3.6.15
4
4
  Summary: Information-geometric agent memory with mathematical guarantees
5
5
  Author-email: Varun Pratap Bhardwaj <admin@superlocalmemory.com>
6
6
  License: AGPL-3.0-or-later
@@ -42,6 +42,7 @@ Requires-Dist: websockets==16.0
42
42
  Requires-Dist: zeroconf>=0.140
43
43
  Requires-Dist: lightgbm==4.6.0
44
44
  Requires-Dist: orjson==3.11.9
45
+ Requires-Dist: tomli-w==1.2.0
45
46
  Requires-Dist: tree-sitter==0.25.2
46
47
  Requires-Dist: tree-sitter-language-pack==0.13.0
47
48
  Requires-Dist: rustworkx==0.17.1
@@ -95,14 +96,12 @@ Dynamic: license-file
95
96
  <img src="https://superlocalmemory.com/assets/logo-mark.png" alt="SuperLocalMemory" width="200"/>
96
97
  </p>
97
98
 
98
- <h1 align="center">SuperLocalMemory V3.6.11</h1>
99
- <p align="center"><strong>Cache. Compress. Remember. Three surfaces — proxy, MCP tools, or skill. Every setup covered.</strong><br/><em>The only local-first layer that pairs persistent memory with compression + caching across every Claude plan. Full 1M window preserved in MCP and skill mode.</em></p>
100
- <p align="center"><code>v3.6.11 "Optimize Everywhere"</code> <strong>Compress + cache on any plan, three ways in.</strong><br/>Proxy (full-turn cache): <code>slm wrap claude</code> &nbsp;·&nbsp; MCP (proxy-free): add <code>slm_compress</code> to your MCP config &nbsp;·&nbsp; Skill (zero-config): <code>~/.claude/skills/slm-optimize/</code></p>
101
- <p align="center"><strong>Backed by 3 published research papers</strong> (arXiv preprints + Zenodo-archived) · <a href="https://arxiv.org/abs/2603.02240">arXiv:2603.02240</a> · <a href="https://arxiv.org/abs/2603.14588">arXiv:2603.14588</a> · <a href="https://arxiv.org/abs/2604.04514">arXiv:2604.04514</a></p>
102
-
103
- <p align="center">
104
- <code>Proxy · MCP tools · Skill — three surfaces</code> &nbsp;·&nbsp; <code>+10.6pp vs Mem0 zero-LLM</code> &nbsp;·&nbsp; <code>85% Open-Domain (best zero-LLM score)</code> &nbsp;·&nbsp; <code>EU AI Act Ready</code>
105
- </p>
99
+ <h1 align="center">SuperLocalMemory V3.6.15</h1>
100
+ <p align="center"><strong>Cache. Compress. Remember. Three surfaces — proxy, MCP tools, or skill. Every setup covered.</strong><br/>
101
+ <em>To the best of our knowledge, the only zero-cloud agent memory that beats Mem0's zero-LLM score on LoCoMo. Mode A: 74.8% vs Mem0 64.2% no GPU, no API key, on CPU.</em></p>
102
+ <p align="center"><code>v3.6.15</code> <strong>Plugin-native. Profile-aware. Distributed-ready.</strong><br/>
103
+ Proxy: <code>slm wrap claude</code> &nbsp;·&nbsp; MCP: add <code>slm_compress</code> to your config &nbsp;·&nbsp; Skill: zero-config</p>
104
+ <p align="center"><strong>3 published research papers</strong> (arXiv preprints + Zenodo-archived) · <a href="https://arxiv.org/abs/2603.02240">arXiv:2603.02240</a> · <a href="https://arxiv.org/abs/2603.14588">arXiv:2603.14588</a> · <a href="https://arxiv.org/abs/2604.04514">arXiv:2604.04514</a></p>
106
105
 
107
106
  <p align="center">
108
107
  <a href="https://arxiv.org/abs/2603.14588"><img src="https://img.shields.io/badge/arXiv-2603.14588-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv Paper"/></a>
@@ -117,489 +116,220 @@ Dynamic: license-file
117
116
  <a href="#multilingual-embedding-support"><img src="https://img.shields.io/badge/Multilingual-30%2B_Languages-ff69b4?style=for-the-badge" alt="Multilingual 30+ Languages"/></a>
118
117
  </p>
119
118
 
120
- <p align="center">
121
- <video src="https://github.com/user-attachments/assets/c3b54a1d-f62a-4ea7-bba7-900435e7b3ab" width="800" autoplay loop muted playsinline></video>
122
- </p>
123
-
124
119
  ---
125
120
 
126
- <details>
127
- <summary><strong>What's New in V3.6 — Optimize: SKIP, SHRINK, DISCOUNT, REMEMBER</strong> (click to expand)</summary>
121
+ ## Why SuperLocalMemory?
128
122
 
129
- > V3.6 is the only local-first layer that SKIPS repeat LLM calls (cache: 100% on a hit), SHRINKS tool outputs and injected context (compress: lossless-by-default, opt-in LLMLingua-2), and DISCOUNTS prefix costs (align: native KV-cache) and remembers everything in one install.
130
- >
131
- > **v3.6.12 "Distributed-ready":** Run SLM on a server and reach it across your LAN. `SLM_REMOTE=1` (default off) lets the dashboard load from a remote browser, lets MCP gateways/hubs forward tool calls, and makes custom local LLM endpoints (llama.cpp / LM Studio / Azure) configurable right from the dashboard — plus a batch of stability and security fixes. See [`docs/distributed-deployment.md`](docs/distributed-deployment.md).
132
- >
133
- > **v3.6.11 "Optimize Everywhere":** Three surfaces. **Proxy** (Surface A) — full-turn cache + compress on transport; needs `ANTHROPIC_BASE_URL`, shrinks the context window. **MCP tools** (Surface B) — `slm_compress`, `slm_retrieve`, `slm_cache_set`, `slm_cache_get`, `slm_optimize_stats`; no proxy, no window shrink, works on any Claude subscription. **Skill** (Surface C) — `slm-optimize` installs in `~/.claude/skills/`; zero-config auto-compress for large tool outputs and CLAUDE.md. No proxy, full 1M window. [See Three Surfaces →](#three-surfaces-proxy--mcp-tools--skill)
134
- >
135
- > **v3.6.10:** cache and compression are now **independent runtime switches** (cache-only, compress-only, both, or neither — toggle live from the dashboard, no restart). Compression was rebuilt to be **lossless by default** (the old string/array/code truncation is gone); aggressive mode adds LLMLingua-2 for **prose only** — never code, numbers, structured data, or the current turn.
123
+ Every hosted AI memory platform Mem0 Cloud, Zep Cloud, Letta Cloud, EverMemOS Cloud sends your data to cloud LLMs by default. Self-hosted variants exist but require Docker, a separate graph DB, or Ollama config, and most default to OpenAI until you flip env vars. After **August 2, 2026**, any of those cloud paths becomes a compliance question under the EU AI Act.
136
124
 
137
- ### The Three Levers
125
+ SuperLocalMemory V3 uses **mathematics instead of cloud compute** — differential geometry, algebraic topology, and stochastic analysis replace the work other systems need LLMs to do. Local-first out of the box. No Docker. No graph DB. No API keys. CPU-only.
138
126
 
139
- | Lever | Mechanism | Saving | Off by default? |
140
- |-------|-----------|:------:|:---------------:|
141
- | **Cache** | Skip repeat calls — exact-match SQLite lookup (zero false hits), vCache-gated semantic (opt-in) | **100% on a hit** (input + output) | Cache ON, Semantic OFF |
142
- | **Compress** | Shrink prompts — **safe = lossless** normalization; **aggressive = LLMLingua-2 prose only** (opt-in) | Safe: small + lossless · Aggressive: large on prose | Safe mode, Aggressive OFF |
143
- | **Align** | Stabilize prefix — maximize provider prefix-cache discounts | **Lossless extra** | ON when compression is ON |
127
+ **Benchmark results** (evaluated on [LoCoMo](https://arxiv.org/abs/2402.09714), the standard long-conversation memory benchmark, published April 2026):
144
128
 
145
- **Memory** (v3.5's existing engine) runs in parallel it shapes *what is in* the prompt (relevant facts); Optimize decides *whether and how* it is sent.
129
+ | System | Score | Config | Cloud LLM required? | Open Source | Source |
130
+ |:-------|:-----:|:-------|:-------------------:|:-----------:|:-------|
131
+ | EverMemOS | 93.05% | Cloud (proprietary) | Yes | Core only | [evermind.ai](https://evermind.ai/) (Feb 2026) |
132
+ | Hindsight (LoComo10) | 92.0% | Cloud | Yes | No | [benchmarks.hindsight.vectorize.io](https://benchmarks.hindsight.vectorize.io) (Apr 2026) |
133
+ | Mem0 (token-efficient) | 91.6% | Hybrid (Cohere/OpenAI) | Yes | Partial | [mem0.ai blog](https://mem0.ai/blog/mem0-the-token-efficient-memory-algorithm) (Apr 16 2026) |
134
+ | **SLM V3 Mode C** | **87.7%** | Local + optional LLM | Optional (Ollama OK) | **Yes (AGPL-3.0)** | In-house, [arXiv:2603.14588](https://arxiv.org/abs/2603.14588) |
135
+ | Zep v3 Cloud | 85.2% | Cloud | Yes | Community deprecated | [getzep.com](https://www.getzep.com/) |
136
+ | **SLM V3 Mode A** | **74.8%** | **Local, CPU-only, zero-LLM** | **No** | **Yes (AGPL-3.0)** | In-house, [arXiv:2603.14588](https://arxiv.org/abs/2603.14588) |
137
+ | Mem0 (zero-retrieval-LLM) | 64.2% | Local baseline | No | Partial | Mem0 paper, zero-LLM row |
146
138
 
147
- > **Independent at runtime:** enable caching only, compression only, both, or neither from the dashboard Optimize tab, applied live (no restart). Each AI client can also get its own memory identity over HTTP MCP via `http://127.0.0.1:8765/mcp/{agent_id}`.
139
+ > **How to read this table.** Scores from different papers use different LoCoMo splits, judge models, and prompt variants. We do NOT claim these numbers are apples-to-apples across rows. Rows marked "In-house" were run by us; cited rows link to the vendor's public source and date. The only apples-to-apples comparison is **Mode A 74.8% vs Mem0 zero-retrieval-LLM 64.2%** (+10.6pp) — both are zero-LLM configurations. Mem0's 91.6% and EverMemOS's 93.05% use cloud LLMs; Mode C uses a local LLM (Ollama).
148
140
 
149
- ### Quick Start
141
+ **What Mode A is:** CPU-only, SQLite-only, zero-LLM retrieval on published LoCoMo questions. To the best of our knowledge it is the only publicly-released local-first memory that clears Mem0's zero-LLM baseline on this benchmark. If another fully-local system hits similar numbers, please open an issue so we can update this table.
150
142
 
151
- ```bash
152
- # One command to start saving
153
- slm wrap claude
154
- # Your first repeat prompt → CACHE HIT → $0.00
155
- # Your first long prompt → COMPRESSED 70% → $0.00 per token saved
156
- ```
157
-
158
- ### New CLI Commands (6 total)
143
+ Mathematical layers contribute **+12.7 percentage points** average across 6 conversations (n=832 questions), with up to **+19.9pp on the most challenging dialogues**.
159
144
 
160
- | Command | What It Does |
161
- |:--------|:-------------|
162
- | `slm optimize status\|on\|off\|savings` | Master Optimize control + savings report (USD/INR/tokens) |
163
- | `slm cache status\|clear\|invalidate\|ttl\|semantic` | Cache sub-control — exact + semantic tiers |
164
- | `slm compress status\|mode\|prose` | Compression control — safe (lossless) / aggressive (LLMLingua-2 prose) |
165
- | `slm proxy [--port] [--provider]` | Start the interception proxy (port 8765) |
166
- | `slm wrap <agent>` | Proxy-activate an agent — one command to start saving |
167
- | `slm help-optimize [topic]` | Full developer reference + per-agent setup recipes |
168
-
169
- ### Savings Dashboard
145
+ ---
170
146
 
171
- All metrics tracked and displayed live — from the dashboard (Optimize tab) or CLI:
147
+ ## Quick Start
172
148
 
173
149
  ```bash
174
- slm optimize savings --since 7
175
- # Savings (last 7 days):
176
- # Exact cache hits: 43 (127,580 input tokens saved)
177
- # Tokens saved (total): 153,096
178
- # Estimated savings: ~$2.30 (at $3.00/M tokens — Anthropic rates)
150
+ # npm (recommended)
151
+ npm install -g superlocalmemory
152
+ slm setup # Choose mode (A/B/C)
153
+ slm doctor # Verify everything is working
179
154
  ```
180
155
 
181
- ### Enable / Disable
182
-
183
156
  ```bash
184
- slm optimize on # Enable cache + compress
185
- slm optimize off # Disable (proxy passes through)
186
- slm cache semantic on # Enable semantic cache (needs embedding model)
187
- slm compress mode aggressive # Enable prose compression (with safety warning)
188
- ```
189
-
190
- **Safety defaults:** Optimize ON. Safe mode ON (extractive only — lossless, production-safe). Semantic OFF. Aggressive OFF. No behavior change until you explicitly enable features.
191
-
192
- ### How It Works
193
-
194
- ```
195
- Your App → Proxy/SDK/Wrap → Cache Check → HIT → Return Cached (0 tokens)
196
- |
197
- MISS
198
- |
199
- Compress → Provider → Store in Cache
200
- 60-95% + Align
157
+ # pip
158
+ pip install superlocalmemory
159
+ slm setup
160
+ slm doctor
201
161
  ```
202
162
 
203
- - **Fail-open** — any error passes through. Your calls never break.
204
- - **Separate database** — `llmcache.db` never touches `memory.db`. AES-256-GCM at rest.
205
- - **Hot-reload config** UI/CLI writes `~/.superlocalmemory/optimize.json`, daemon reloads in 2s.
206
-
207
- ### Links
208
-
209
- Full docs:
210
- - [Optimize Product Overview](docs/optimize-overview.md)
211
- - [Optimize CLI Reference](docs/optimize-cli.md)
212
- - [Optimize Config Reference](docs/optimize-config.md)
213
- - [Wiki: V3.6 Overview](https://github.com/qualixar/superlocalmemory/wiki/V3.6-Overview)
214
- - [Website: v3.6 Optimize](https://superlocalmemory.com/optimize)
215
-
216
- </details>
217
-
218
- ---
219
-
220
- ## Three Surfaces: Proxy · MCP Tools · Skill
221
-
222
- v3.6.11 delivers one engine across **three ways in** — choose the surface that fits your setup:
223
-
224
- | Surface | How you use it | Requires proxy? | Window effect | Cache scope |
225
- |---------|---------------|:---------------:|:-------------:|-------------|
226
- | **A — Proxy** | `slm wrap claude` or `ANTHROPIC_BASE_URL=http://127.0.0.1:8765` | **Yes** | Shrinks (proxy intercepts full context) | Full-turn cache — every Claude call |
227
- | **B — MCP tools** | Add 5 tools to MCP config; call `slm_compress`, `slm_cache_set/get` | **No** | **Preserved** (full 1M) | Results you explicitly route through SLM |
228
- | **C — Skill** | Copy `skills/slm-optimize/SKILL.md` → `~/.claude/skills/` | **No** | **Preserved** (full 1M) | Auto-applied by the agent per skill rules |
229
-
230
- **How to choose:**
231
- - On a **metered API** (pay-per-token) and want to cache every call → **Proxy (A)**
232
- - On a **Pro/Max/Team subscription** or any plan where you can't or won't run a proxy → **MCP tools (B)** or **Skill (C)**
233
- - Want zero configuration → **Skill (C)**: install once, auto-compresses CLAUDE.md and large outputs
234
- - Want agent-controlled caching of repeated file reads and tool outputs → **MCP tools (B)**
235
-
236
- **The hard constraint:** The primary Claude conversation turn cannot be cached without a proxy — the MCP/skill path caches results you explicitly route through SLM (tool outputs, file reads, sub-model calls).
237
-
238
- ### MCP Tools Setup (Surface B)
239
-
240
- Add to your `claude_desktop_config.json` or IDE MCP config alongside your existing SLM entry:
241
-
242
- ```json
243
- {
244
- "mcpServers": {
245
- "superlocalmemory": {
246
- "command": "slm",
247
- "args": ["mcp"]
248
- }
249
- }
250
- }
163
+ ```bash
164
+ # First use
165
+ slm remember "Alice works at Google as a Staff Engineer"
166
+ slm recall "What does Alice do?"
167
+ slm status
251
168
  ```
252
169
 
253
- The 5 optimize tools (`slm_compress`, `slm_retrieve`, `slm_cache_set`, `slm_cache_get`, `slm_optimize_stats`) are included automatically from v3.6.11+. Verify with `slm_optimize_stats()`.
254
-
255
- ### Skill Setup (Surface C)
256
-
257
170
  ```bash
258
- mkdir -p ~/.claude/skills/slm-optimize
259
- cp $(pip show superlocalmemory | grep Location | awk '{print $2}')/superlocalmemory/skills/slm-optimize/SKILL.md \
260
- ~/.claude/skills/slm-optimize/SKILL.md
171
+ # Wrap your agent — starts proxy + sets environment + launches agent
172
+ slm wrap claude
173
+ # Your first repeat prompt → CACHE HIT → $0.00
174
+ # See savings: slm optimize savings --since 1
261
175
  ```
262
176
 
263
- Then reference in your `CLAUDE.md`:
264
- ```markdown
265
- ## Context Management
266
- Use the `slm-optimize` skill to compress large outputs and cache repeated reads.
267
- ```
177
+ **Upgrading:** `pip install -U superlocalmemory && slm restart && slm doctor` — migration is automatic, no data loss.
268
178
 
269
179
  ---
270
180
 
271
- <details>
272
- <summary><strong>What's New in V3.3 — The Living Brain Evolves</strong> (click to expand)</summary>
181
+ ## Three Pillars
273
182
 
274
- > V3.3 gives your memory a lifecycle. Memories strengthen when used, fade when neglected, compress when idle, and consolidate into reusable patterns — all automatically, all locally. Your agent gets smarter the longer it runs.
183
+ ### Memory
275
184
 
276
- ### Features at a Glance
185
+ <a id="dual-interface-mcp--cli"></a>
277
186
 
278
- - **Adaptive Memory Lifecycle** memories naturally strengthen with use and fade when neglected. No manual cleanup, no hardcoded TTLs.
279
- - **Smart Compression** — embedding precision adapts to memory importance. Low-priority memories compress up to 32x. High-value memories stay full-resolution.
280
- - **Cognitive Consolidation** — the system automatically extracts patterns from clusters of related memories. One decision referenced 50 times becomes one reusable insight.
281
- - **Pattern Learning** — auto-learned soft prompts injected into your agent's context at session start. The system teaches itself what matters to you.
282
- - **Hopfield Retrieval (6th Channel)** — vague or partial queries now complete themselves. Ask half a question, get the whole answer.
283
- - **Process Health** — orphaned SLM processes detected and cleaned automatically. No more zombie workers eating RAM.
187
+ Five-channel hybrid retrieval: Semantic (Fisher-Rao geodesic distance) + BM25 + Entity Graph + Temporal + Hopfield (associative/partial-query completion). RRF fusion, cross-encoder reranking, adaptive LightGBM ranking. All data stays local — SQLite + optional LanceDB/CozoDB.
284
188
 
285
- ### New CLI Commands
286
-
287
- ```bash
288
- # Run a memory lifecycle review — strengthens active memories, archives neglected ones
289
- slm decay
189
+ Three mathematical contributions replace cloud LLM dependency:
290
190
 
291
- # Run smart compressionadapts embedding precision to memory importance
292
- slm quantize
191
+ 1. **Fisher-Rao Retrieval Metric**similarity scoring from the Fisher information structure of diagonal Gaussian families. To the best of our knowledge, the first public application of information geometry to agent memory retrieval.
192
+ 2. **Sheaf Cohomology for Consistency** — algebraic topology detects contradictions via coboundary norms on the knowledge graph.
193
+ 3. **Riemannian Langevin Lifecycle** — memory positions evolve on the Poincare ball; neglected memories self-archive, no hardcoded thresholds.
293
194
 
294
- # Extract reusable patterns from memory clusters
295
- slm consolidate --cognitive
195
+ Auto-capture hooks (`slm hooks install`) fire only on real signals — topic pivot, web call, file edit — never on a timer. Fail-open, <10ms p99 hot path.
296
196
 
297
- # View auto-learned patterns that get injected into agent context
298
- slm soft-prompts
197
+ **Multi-scope memory (v3.6.15, opt-in):** keep memories `personal` (default), `shared` with named profiles, or `global` across the machine. Off by default — recall only ever returns your own facts until you turn sharing on, per call or in config. See **[docs/shared-memory.md](docs/shared-memory.md)**.
299
198
 
300
- # Clean up orphaned SLM processes
301
- slm reap
302
- ```
199
+ <a id="multilingual-embedding-support"></a>
303
200
 
304
- ### New MCP Tools
201
+ **Multilingual:** plug in any OpenAI-compatible embedding endpoint — Ollama, vLLM, LiteLLM, `bge-m3`, `multilingual-e5`, `Qwen3-Embedding`. The math layer is language-agnostic; 30+ languages work at full retrieval quality. No cloud dependency, no code changes.
305
202
 
306
- | Tool | Description |
307
- |:-----|:------------|
308
- | `forget` | Programmatic memory archival via lifecycle rules |
309
- | `quantize` | Trigger smart compression on demand |
310
- | `consolidate_cognitive` | Extract and store patterns from memory clusters |
311
- | `get_soft_prompts` | Retrieve auto-learned patterns for context injection |
312
- | `reap_processes` | Clean orphaned SLM processes |
313
- | `get_retention_stats` | Memory lifecycle analytics |
203
+ ### Cache + Compress
314
204
 
315
- ### Mode A/B Memory Improvements
205
+ <a id="three-surfaces-proxy--mcp-tools--skill"></a>
316
206
 
317
- | Metric | V3.2 | V3.3 | Change |
318
- |:-------|:----:|:----:|:------:|
319
- | RAM usage (Mode A/B) | ~4GB | ~40MB | **100x reduction** |
320
- | Retrieval channels | 5 | 6 | +Hopfield completion |
321
- | MCP tools (default) | 29 | 33 | +4 new (mesh set) |
322
- | CLI commands | 21 | 26 | +5 new |
323
- | Dashboard tabs | 17 | 17 | (H-22: Reward / Shadow / EvolutionCost tiles deferred to next cycle — data exposed via API today, see [DASHBOARD-COVERAGE.md](docs/DASHBOARD-COVERAGE.md)) |
324
- | API endpoints | 9 | 16 | +7 new |
207
+ One engine, three ways in choose the surface that fits your setup:
325
208
 
326
- Embedding migration happens automatically when you switch modes no manual steps needed.
209
+ | Surface | How you use it | Requires proxy? | Window effect | Cache scope |
210
+ |---------|---------------|:---------------:|:-------------:|-------------|
211
+ | **A — Proxy** | `slm wrap claude` or `ANTHROPIC_BASE_URL=http://127.0.0.1:8765` | **Yes** | Shrinks | Full-turn cache — every call |
212
+ | **B — MCP tools** | Add 5 tools to MCP config; call `slm_compress`, `slm_cache_set/get` | **No** | **Preserved (1M)** | Results you explicitly route through SLM |
213
+ | **C — Skill** | Copy `skills/slm-optimize/SKILL.md` → `~/.claude/skills/` | **No** | **Preserved (1M)** | Auto-applied by the agent per skill rules |
327
214
 
328
- ### Dashboard
215
+ **The hard constraint:** The primary Claude conversation turn cannot be cached without a proxy. The MCP/skill path caches results you explicitly route through SLM (tool outputs, file reads, sub-model calls) — without a proxy the main conversation turn is not intercepted.
329
216
 
330
- Three new tabs: **Memory Lifecycle** (retention curves, decay stats), **Compression** (storage savings, precision distribution), and **Patterns** (auto-learned soft prompts, consolidation history). Seven new API endpoints power the new views.
217
+ **How to choose:**
218
+ - Metered API (pay-per-token), want every call cached → **Proxy (A)**
219
+ - Pro/Max/Team subscription or any plan where you won't run a proxy → **MCP tools (B)** or **Skill (C)**
220
+ - Zero configuration → **Skill (C)**: install once, auto-compresses CLAUDE.md and large outputs
221
+ - Agent-controlled caching of repeated file reads → **MCP tools (B)**
331
222
 
332
- ### Enable V3.3 Features
223
+ **Cache:** exact-match SQLite lookup (SHA-256, zero false hits) + vCache-gated semantic (opt-in). **100% cost saved on a hit** (input + output tokens).
333
224
 
334
- All new features default OFF. Zero breaking changes. Opt in when ready:
225
+ **Compress:** safe mode = lossless normalization (JSON/code/tool outputs, 60-95% fewer tokens); aggressive mode = LLMLingua-2 prose only (opt-in). CCR stores originals for byte-exact reversal. Anthropic 90% / OpenAI 50% prefix-cache discount alignment included. [CITATION-NEEDED-ONLINE: live provider prefix-cache discount rates]
335
226
 
336
- ```bash
337
- # Turn on adaptive memory lifecycle
338
- slm config set lifecycle.enabled true
227
+ **Savings dashboard:** `slm optimize savings --since 7` — live USD/INR/tokens saved. Hot-reload config, fail-open.
339
228
 
340
- # Turn on smart compression
341
- slm config set quantization.enabled true
229
+ ### Mesh
342
230
 
343
- # Turn on cognitive consolidation
344
- slm config set consolidation.cognitive.enabled true
231
+ <a id="multi-machine-mesh-coordination"></a>
345
232
 
346
- # Turn on pattern learning (soft prompts)
347
- slm config set soft_prompts.enabled true
233
+ Run SLM on multiple machines and have agents coordinate as one team — no external broker, no Docker. HTTP-based sync every 30s, mDNS discovery (`SLM_MESH_DISCOVERY=on`), graceful offline queue.
348
234
 
349
- # Turn on Hopfield retrieval (6th channel)
350
- slm config set retrieval.hopfield.enabled true
235
+ ```bash
236
+ # Machine A (broker)
237
+ export SLM_MESH_HOST=192.168.1.100
238
+ export SLM_MESH_SHARED_SECRET=my-secret-key
239
+ slm init
351
240
 
352
- # Or enable everything at once
353
- slm config set v33_features.all true
241
+ # Machine B (client)
242
+ export SLM_MESH_PEER_URL=http://192.168.1.100:8765
243
+ export SLM_MESH_SHARED_SECRET=my-secret-key
244
+ slm init
354
245
  ```
355
246
 
356
- **Fully backward compatible.** All existing MCP tools, CLI commands, and configs work unchanged. New tables are created automatically on first run. No migration needed.
247
+ 8 mesh MCP tools: `mesh_peers`, `mesh_send`, `mesh_broadcast`, `mesh_project`, `mesh_inbox`, `mesh_pending`, `mesh_state`, `mesh_lock`.
357
248
 
358
- </details>
249
+ Full docs: [docs/multi-machine.md](docs/multi-machine.md) · [docs/distributed-deployment.md](docs/distributed-deployment.md)
359
250
 
360
251
  ---
361
252
 
362
- ## Why SuperLocalMemory?
363
-
364
- Every **hosted** AI memory platform — Mem0 Cloud, Zep Cloud, Letta Cloud, EverMemOS Cloud — sends your data to cloud LLMs by default. Their self-hosted variants exist (Mem0 OpenMemory, Letta self-hosted, Graphiti) but require Docker + a separate graph DB or Ollama config, and most still default to OpenAI until you flip env vars. After **August 2, 2026**, any of those cloud paths becomes a compliance problem under the EU AI Act.
365
-
366
- SuperLocalMemory V3 takes a different approach: **mathematics instead of cloud compute.** Three techniques from differential geometry, algebraic topology, and stochastic analysis replace the work that other systems need LLMs to do — similarity scoring, contradiction detection, and lifecycle management. The result is an agent memory that ships local-first out of the box — no Docker, no graph DB, no API keys — on CPU.
253
+ ## Install Paths
367
254
 
368
- **The numbers** (evaluated on [LoCoMo](https://arxiv.org/abs/2402.09714), the standard long-conversation memory benchmark). Published numbers as of April 2026:
369
-
370
- | System | Score | Config | Cloud LLM required? | Open Source | Source |
371
- |:-------|:-----:|:-------|:-------------------:|:-----------:|:-------|
372
- | EverMemOS | 93.05% | Cloud (proprietary) | Yes | Core only | [evermind.ai](https://evermind.ai/) (Feb 2026) |
373
- | Hindsight (LoComo10) | 92.0% | Cloud | Yes | No | [benchmarks.hindsight.vectorize.io](https://benchmarks.hindsight.vectorize.io) (Apr 2026) |
374
- | Mem0 (token-efficient) | 91.6% | Hybrid (Cohere/OpenAI) | Yes | Partial | [mem0.ai blog](https://mem0.ai/blog/mem0-the-token-efficient-memory-algorithm) (Apr 16 2026) |
375
- | **SLM V3 Mode C** | **87.7%** | Local + optional LLM | Optional (Ollama OK) | **Yes (AGPL-3.0)** | In-house, repro script in `docs/benchmarks/` |
376
- | Zep v3 Cloud | 85.2% | Cloud | Yes | Community deprecated | [getzep.com](https://www.getzep.com/) |
377
- | **SLM V3 Mode A** | **74.8%** | **Local, CPU-only, zero-LLM** | **No** | **Yes (AGPL-3.0)** | In-house, repro script in `docs/benchmarks/` |
378
- | Mem0 (zero-retrieval-LLM) | 64.2% | Local baseline | No | Partial | Mem0 paper, zero-LLM row |
255
+ | Path | Command | When |
256
+ |:-----|:--------|:-----|
257
+ | **npm** (recommended) | `npm install -g superlocalmemory` | Node 14+, installs Python deps automatically |
258
+ | **pip** | `pip install superlocalmemory` | Python 3.11+, direct install |
259
+ | **Claude Code Plugin** (WP-06) | `/plugin install superlocalmemory@qualixar` | Self-bootstraps venv, isolated SLM_DATA_DIR, additive 14-tool core |
260
+ | **Portable / IDE connect** (WP-08) | `slm connect <ide> [--here]` | Wire any IDE without reinstalling; `slm connect claude-code` → plugin pointer |
379
261
 
380
- > **How to read this table.** Scores from different papers use different LoCoMo splits, judge models, and prompt variants. We do NOT claim these numbers are apples-to-apples across rows. The rows we re-ran in-house are marked "In-house"; cited rows link to the vendor's public source and date. Mode A is the only zero-LLM configuration in the list, so the comparison that is apples-to-apples is **Mode A 74.8% vs Mem0 zero-retrieval-LLM 64.2%** (+10.6pp). Mem0's 91.6% and EverMemOS's 93.05% use cloud LLMs; Mode C uses a local LLM (Ollama). BEAM-10M, the emerging successor benchmark, will be added in a future release.
262
+ After any install path: `slm setup` `slm doctor` `slm warmup` (optional, pre-downloads ~500MB embedding model).
381
263
 
382
- **What Mode A is**: CPU-only, SQLite-only, zero-LLM retrieval pipeline on published LoCoMo questions. To the best of our knowledge it is the only publicly-released local-first memory that clears Mem0's zero-LLM baseline on this benchmark. If another fully-local system hits similar numbers, please open an issue so we can update the table.
383
-
384
- Mathematical layers contribute **+12.7 percentage points** on average across 6 conversations (n=832 questions), with up to **+19.9pp on the most challenging dialogues**. This isn't more compute — it's better math.
385
-
386
- > **Upgrading from V2 (2.8.6)?** V3 is a complete architectural reinvention — new mathematical engine, new retrieval pipeline, new storage schema. Your existing data is preserved but requires migration. After installing V3, run `slm migrate` to upgrade your data. Read the [Migration Guide](https://github.com/qualixar/superlocalmemory/wiki/Migration-from-V2) before upgrading. Backup is created automatically.
264
+ | Component | Size | When |
265
+ |:----------|:-----|:-----|
266
+ | Core libraries (numpy, scipy, networkx) | ~50MB | During install |
267
+ | Dashboard & MCP server (fastapi, uvicorn) | ~20MB | During install |
268
+ | Learning engine (lightgbm) | ~10MB | During install |
269
+ | Search engine (sentence-transformers, torch) | ~200MB | During install |
270
+ | Embedding model (nomic-embed-text-v1.5, 768d) | ~500MB | First use or `slm warmup` |
271
+ | **Mode B** requires [Ollama](https://ollama.com) + a model (`ollama pull llama3.2`) | ~2GB | Manual |
387
272
 
388
273
  ---
389
274
 
390
- ## Quick Start
391
-
392
- ### Install via npm (recommended)
393
-
394
- ```bash
395
- npm install -g superlocalmemory
396
- slm setup # Choose mode (A/B/C)
397
- slm doctor # Verify everything is working
398
- slm warmup # Pre-download embedding model (~500MB, optional)
399
- ```
400
-
401
- ### Install via pip
402
-
403
- ```bash
404
- pip install superlocalmemory
405
- ```
406
-
407
- ### Start Saving on LLM Costs (v3.6 Optimize)
408
-
409
- ```bash
410
- # Wrap your agent — starts proxy + sets environment + launches agent
411
- slm wrap claude
412
- # Your first repeat prompt → CACHE HIT → $0.00 saved
413
- # See savings: slm optimize savings --since 1
414
- ```
415
-
416
- ### Upgrading to v3.6 "Optimize" + v3.5.0 "Scale-Ready"
417
-
418
- **Migration is automatic.** Upgrade the package, restart the daemon — all migrations run in the background.
419
-
420
- ```bash
421
- pip install -U superlocalmemory
422
- slm restart
423
- slm doctor
424
- ```
425
-
426
- No manual commands. No data loss. Zero downtime.
427
-
428
- **What you get after upgrading to v3.6.0:**
429
- - **Cache** — skip repeat LLM calls entirely. Exact-match + vCache-gated semantic. **100% cost saved on hit.**
430
- - **Compress** — shrink prompts 60-95% before sending. Extractive JSON/code (lossless) + LLMLingua-2 prose (opt-in). CCR reversible.
431
- - **Align** — stabilize prompt prefix for native provider KV-cache discounts (Anthropic 90%, OpenAI 50%).
432
- - **Savings dashboard** — live USD/INR/tokens saved displayed in the Optimize tab.
433
-
434
- **What you get after upgrading to v3.5.0:**
435
- - **CozoDB on the recall path** — entity_graph channel routes through the CozoDB backend (auto-detected, no config needed). Millions of graph edges indexed and traversed in milliseconds.
436
- - **LanceDB vector backend** — embedding search falls through to LanceDB when available (auto-detected, no config needed). Handles millions of vectors.
437
- - **6-channel recall <1s** — BM25→FTS5 (20ms vs 11s), Hopfield ANN prefilter (0.4s vs 6s), temporal fast-parse (0.25s vs 2.6s). All surfaces (MCP/CLI/Dashboard) use the same daemon path.
438
- - **Core Memory Block** — always-injected pinned facts (auto-derived + explicit pin/unpin via the `core_memory` MCP tool). Pinned facts surface even when the query doesn't match.
439
- - **Context Injection v2** — unified formatter, token-budgeted injection (mode-aware 2K/4K/8K), edge-placement ordering, full-fidelity content (no more 200-char stubs).
440
- - **Score normalization** — all fusion scores mapped to [0, 1] via soft-sigmoid. Monotonic — rank order preserved.
441
- - **Vector store auto-backfill** — facts with embeddings missing from the vector store are indexed on daemon start. No more "only 1/3 of corpus searchable."
442
-
443
- ### Release History
444
-
445
- | Version | Codename | Key Features |
446
- |---|---|---|
447
- | **v3.6.11** | Optimize Everywhere | **Three surfaces** — Proxy (A: full-turn cache), MCP tools (B: `slm_compress`/`slm_retrieve`/`slm_cache_set`/`slm_cache_get`/`slm_optimize_stats` — proxy-free, 1M window), Skill (C: `slm-optimize` zero-config). `CacheDB.get_value()` (pure KV lookup). 23 new tests. Links: [Three Surfaces →](#three-surfaces-proxy--mcp-tools--skill) · [docs/optimize-overview.md](docs/optimize-overview.md) |
448
- | **v3.6.0** | Optimize | **Cache** (skip repeat calls, 100% on hit) · **Compress** (shrink prompts 60-95%) · **Align** (KV-cache stabilization) · `slm optimize\|cache\|compress\|proxy\|wrap` CLI · Live savings dashboard (USD/INR/tokens) · Hot-reload config · Safe defaults · Links: [docs/optimize-overview.md](docs/optimize-overview.md) · [V3.6 Wiki](https://github.com/qualixar/superlocalmemory/wiki/V3.6-Overview) |
449
- | **v3.5.0** | Scale-Ready + Context Injection v2 | CozoDB/LanceDB migration, 6-channel recall <1s, Core Memory Block, BM25→FTS5, context injection v2, score normalization |
450
- | **v3.4.5** | Scale-Ready (foundation) | Tiered storage (active/warm/cold), graph pruning, BackendOrchestrator scaffolding, CozoDB + LanceDB init + migration code (read path wired in v3.5.0) |
451
- | **v3.4.51** | Recency Intelligence | Ebbinghaus decay + FSRS stability, age gate, session context time-awareness |
452
- | **v3.4.22** | Scale-Ready (scaling) | v2 ranking pipeline (LightGBM, bandit ensemble), Hopfield channel, 6-channel parallel execution |
453
- | **v3.3.x** | Foundation | BM25Plus, Fisher-Rao manifold, sqlite-vec, RRF fusion, cross-encoder rerank. 3 published papers (arXiv 2603.02240 / 2603.14588 / 2604.04514) |
454
-
455
- ### First Use
456
-
457
- ```bash
458
- slm remember "Alice works at Google as a Staff Engineer"
459
- slm recall "What does Alice do?"
460
- slm status
461
- ```
462
-
463
- ### MCP Integration (Claude, Cursor, Windsurf, VS Code, etc.)
275
+ ## MCP + Profiles
464
276
 
465
- SLM supports **two MCP transports** — use whichever fits your tool. Both expose the same 33 tools and 7 resources.
466
-
467
- #### Option A — HTTP transport (v3.6.7+, recommended)
468
-
469
- One shared process handles every client. RAM is flat regardless of how many IDE windows, subagents, or concurrent sessions connect. Requires the SLM daemon to be running (`slm start`).
277
+ SLM supports two MCP transports:
470
278
 
279
+ **HTTP (recommended, v3.6.7+):**
471
280
  ```json
472
- {
473
- "mcpServers": {
474
- "superlocalmemory": {
475
- "type": "http",
476
- "url": "http://127.0.0.1:8765/mcp/"
477
- }
478
- }
479
- }
281
+ { "mcpServers": { "superlocalmemory": { "type": "http", "url": "http://127.0.0.1:8765/mcp/" } } }
480
282
  ```
283
+ Or: `claude mcp add --transport http superlocalmemory http://127.0.0.1:8765/mcp/`
481
284
 
482
- > **Claude Code** also accepts:
483
- > ```bash
484
- > claude mcp add --transport http superlocalmemory http://127.0.0.1:8765/mcp/
485
- > ```
486
-
487
- #### Option B — stdio transport (universal, works everywhere)
488
-
489
- Spawns one `slm mcp` subprocess per client connection (~90–110 MB each). Works with every MCP-compatible tool including those that do not yet support HTTP transport. No daemon required.
490
-
285
+ **stdio (universal fallback):**
491
286
  ```json
492
- {
493
- "mcpServers": {
494
- "superlocalmemory": {
495
- "command": "slm",
496
- "args": ["mcp"]
497
- }
498
- }
499
- }
287
+ { "mcpServers": { "superlocalmemory": { "command": "slm", "args": ["mcp"] } } }
500
288
  ```
501
289
 
502
- #### Option C — `mcp-remote` bridge (for stdio-only tools that want HTTP)
503
-
504
- Some CLIs (e.g. Grok CLI) only speak stdio but you still want the RAM benefit of HTTP. The [`@modelcontextprotocol/client-cli`](https://www.npmjs.com/package/@modelcontextprotocol/client-cli) package bridges them:
505
-
506
- ```bash
507
- npm install -g @modelcontextprotocol/client-cli
508
- ```
509
-
510
- ```json
511
- {
512
- "mcpServers": {
513
- "superlocalmemory": {
514
- "command": "mcp-remote",
515
- "args": ["http://127.0.0.1:8765/mcp/", "--allow-http", "--transport", "http-only"]
516
- }
517
- }
518
- }
519
- ```
520
-
521
- #### When to use which
522
-
523
- | Situation | Use |
524
- |-----------|-----|
525
- | Claude Code / Claude Desktop (v3.6.7+) | **HTTP** — zero new processes per session |
526
- | Cursor, Windsurf, Gemini CLI, Antigravity | **HTTP** — native support |
527
- | Grok CLI, tools that only support stdio | **`mcp-remote` bridge** |
528
- | Offline / daemon-free usage | **stdio** |
529
- | Any tool, any version | **stdio** always works as fallback |
290
+ ### MCP Profiles (WP-01)
530
291
 
531
- See [`docs/ide-setup.md`](docs/ide-setup.md) for per-IDE configs. 33 MCP tools by default (+42 optional behind `SLM_MCP_ALL_TOOLS=1`) + 7 resources. Works with any MCP-compatible client — we ship templated configs for Claude Code, Cursor, Windsurf, VS Code Copilot, Continue, Cody, ChatGPT Desktop, Gemini CLI, JetBrains, Zed, and Antigravity (15 IDE configs in `ide/configs/`).
292
+ Control tool surface via `SLM_MCP_PROFILE`:
532
293
 
533
- ### Dual Interface: MCP + CLI
294
+ | Profile | Tools | Use case |
295
+ |:--------|:-----:|:---------|
296
+ | `core14` (default) | 14 | Memory core — `remember`, `recall`, `forget`, `session_init`, + mesh |
297
+ | `mesh8` | 8 | Mesh-only — multi-machine coordination |
298
+ | `full38` | 38 | Core + optimize + evolution + trust |
299
+ | `power50` | 50 | Full38 + admin + ingestion + compliance |
300
+ | `whole81` | 81 | Every tool (`SLM_MCP_ALL_TOOLS=1`) |
534
301
 
535
- SLM works everywhere from IDEs to CI pipelines to Docker containers. Both the MCP server and the agent-native CLI are first-class, so the same backend serves IDE-side integrations and scripted automations.
536
-
537
- | Need | Use | Example |
538
- |------|-----|---------|
539
- | IDE integration | MCP | Auto-configured for 17+ IDEs via `slm connect` |
540
- | Shell scripts | CLI + `--json` | `slm recall "auth" --json \| jq '.data.results[0]'` |
541
- | CI/CD pipelines | CLI + `--json` | `slm remember "deployed v2.1" --json` in GitHub Actions |
542
- | Agent frameworks | CLI + `--json` | OpenClaw, Codex, Goose, nanobot |
543
- | Human use | CLI | `slm recall "auth"` (readable text output) |
544
-
545
- **Agent-native JSON output** on every command:
302
+ **Precedence:** `ALL` > `TOOLS` > `PROFILE` > `default`
546
303
 
547
304
  ```bash
548
- # Human-readable (default)
549
- slm recall "database schema"
550
- # 1. [0.87] Database uses PostgreSQL 16 on port 5432...
551
-
552
- # Agent-native JSON
553
- slm recall "database schema" --json
554
- # {"success": true, "command": "recall", "version": "3.0.22", "data": {"results": [...]}}
305
+ export SLM_MCP_PROFILE=full38 # or core14 / mesh8 / power50 / whole81
306
+ slm mcp
555
307
  ```
556
308
 
557
- All `--json` responses follow a consistent envelope with `success`, `command`, `version`, `data`, and `next_actions` for agent guidance.
309
+ Per-IDE configs available for Claude Code, Cursor, Windsurf, VS Code Copilot, Continue, Gemini CLI, JetBrains, Zed, and more (15 configs in `ide/configs/`). See [docs/ide-setup.md](docs/ide-setup.md).
558
310
 
559
311
  ---
560
312
 
561
- ## Smart-hook architecture (v3.4.43)
313
+ ## Claude Code Plugin
562
314
 
563
- SLM ships a small set of Claude Code hooks that fire memory operations only
564
- when there's a real signal — not on a timer, not on every keystroke. The
565
- hooks are perf-budgeted (<10ms p99 for the hot path) and fail-open (any
566
- crash → silent exit, never blocks your prompt). Install them with one
567
- command:
315
+ Install directly in Claude Code without a system-level npm/pip install:
568
316
 
569
317
  ```bash
570
- slm hooks install # wires hooks into ~/.claude/settings.json
571
- slm hooks status # shows what's installed
572
- slm hooks remove # cleans up, preserves non-SLM hooks
318
+ /plugin install superlocalmemory@qualixar
573
319
  ```
574
320
 
575
- | Hook | Event | When it fires | Why |
576
- |---|---|---|---|
577
- | `slm hook start` | SessionStart | Once at session boot | Injects core memory + recent context + learned patterns. ~80ms. |
578
- | `slm hook user_prompt_rehash` | UserPromptSubmit | Every prompt | Detects re-queries within 60s (negative signal that prior recall didn't satisfy). <10ms hot path. |
579
- | **`slm hook topic_shift`** *(new in 3.4.43)* | UserPromptSubmit | When current prompt shares zero content words with every prompt in a 5-turn sliding window | Surfaces a one-line "consider recall" hint on real topic pivots. Replaces the time-based 15-min nag — event-based, not timer-based. <10ms. |
580
- | **`slm hook before_web`** *(new in 3.4.43)* | PreToolUse on `WebSearch\|WebFetch` | Every web search/fetch | Runs `slm recall <query> --limit 5` and injects local memories as a system-reminder BEFORE the web call. Cost: ~500-800ms per fire, fires 5-20× per session. |
581
- | `slm hook checkpoint` | PostToolUse on `Write\|Edit` | Every file write/edit | Auto-observes file changes into SLM. No periodic nag (removed in v3.4.43). |
582
- | `slm hook post_tool_outcome` | PostToolUse (all tools) | Every tool call | Tracks which recalled facts got used (learning signal). |
583
- | `slm hook stop` | Stop | Session end | Saves rich session summary with git context. |
584
-
585
- **What "smart" means here:** the hooks don't interrupt you on a schedule.
586
- They watch for specific events that indicate memory work would add value —
587
- a topic pivot, a web call about to fire, a re-asked question, a file edit.
588
- Otherwise they stay out of your way.
589
-
590
- **Observability for the new hooks:**
591
- `topic_shift` writes one TSV line per decision to
592
- `~/.superlocalmemory/logs/topic-shift.log`
593
- (`timestamp | session_hash | current_words_count | window_depth | max_overlap |
594
- fired | prompt_preview`). Disable with `SLM_TOPIC_SHIFT_LOG=0`.
595
-
596
- **Upgrading from v3.4.42 or older:** Run `slm hooks install` once after
597
- upgrade to pull in the new wiring. `slm hooks status` will flag the
598
- version mismatch. Merge is idempotent — safe to run twice.
321
+ - Self-bootstraps a Python venv, installs all deps in an isolated `SLM_DATA_DIR`
322
+ - Registers 14-tool core MCP surface (`core14` profile by default)
323
+ - Additive does not replace an existing SLM install
324
+ - `slm connect claude-code` detects an existing plugin install and links them
325
+
326
+ See [docs/getting-started.md](docs/getting-started.md) for full plugin walkthrough.
599
327
 
600
328
  ---
601
329
 
602
- ## Three Operating Modes
330
+ ## Modes + EU AI Act
331
+
332
+ <a id="eu-ai-act-compliance"></a>
603
333
 
604
334
  | Mode | What | Cloud? | EU AI Act | Best For |
605
335
  |:----:|:-----|:------:|:---------:|:---------|
@@ -613,87 +343,9 @@ slm mode b # Local Ollama
613
343
  slm mode c # Cloud LLM
614
344
  ```
615
345
 
616
- **Mode A** is, to the best of our knowledge, the only publicly-released agent memory that runs with zero cloud calls while clearing Mem0's published LoCoMo score. All data stays on your device. No API keys. No GPU. Runs on 2 vCPUs + 4GB RAM. If another fully-local system hits similar numbers, please open an issue — we'll update this line.
617
-
618
- ---
619
-
620
- ## Architecture
621
-
622
- ```
623
- Query ──► Strategy Classifier ──► 5 Parallel Channels:
624
- ├── Semantic (Fisher-Rao geodesic distance)
625
- ├── BM25 (keyword matching)
626
- ├── Entity Graph (spreading activation, 3 hops)
627
- ├── Temporal (date-aware retrieval)
628
- └── Hopfield (partial-query completion / associative recall)
629
-
630
- RRF Fusion (k=60)
631
-
632
- Scene Expansion + Bridge Discovery
633
-
634
- Cross-Encoder Reranking
635
-
636
- ◄── Top-K Results with channel scores
637
- ```
638
-
639
- ### Mathematical Foundations
640
-
641
- Three novel contributions replace cloud LLM dependency with mathematical guarantees:
642
-
643
- 1. **Fisher-Rao Retrieval Metric** — Similarity scoring derived from the Fisher information structure of diagonal Gaussian families. Graduated ramp from cosine to geodesic distance over the first 10 accesses. To the best of our knowledge, the first public application of information geometry specifically to agent memory retrieval — if prior work exists please open an issue so we can credit it.
644
-
645
- 2. **Sheaf Cohomology for Consistency** — Algebraic topology detects contradictions by computing coboundary norms on the knowledge graph. We are not aware of a prior production agent-memory system that computes sheaf-cohomology coboundary norms this way; corrections welcome.
646
-
647
- 3. **Riemannian Langevin Lifecycle** — Memory positions evolve on the Poincare ball via discretized Langevin SDE. Frequently accessed memories stay active; neglected memories self-archive. No hardcoded thresholds.
346
+ **Mode A** is, to the best of our knowledge, the only publicly-released agent memory that runs with zero cloud calls while clearing Mem0's published LoCoMo score. All data stays on your device. No API keys. No GPU. Runs on 2 vCPUs + 4GB RAM.
648
347
 
649
- These three layers collectively yield **+12.7pp average improvement** over the engineering-only baseline, with the Fisher metric alone contributing **+10.8pp** on the hardest conversations.
650
-
651
- ---
652
-
653
- ## Benchmarks
654
-
655
- Evaluated on [LoCoMo](https://arxiv.org/abs/2402.09714) — 10 multi-session conversations, 1,986 total questions, 4 scored categories.
656
-
657
- ### Mode A (Zero-Cloud, 10 Conversations, 1,276 Questions)
658
-
659
- | Category | Score | vs. Mem0 (64.2%) |
660
- |:---------|:-----:|:-----------------:|
661
- | Single-Hop | 72.0% | +3.0pp |
662
- | Multi-Hop | 70.3% | +8.6pp |
663
- | Temporal | 80.0% | +21.7pp |
664
- | **Open-Domain** | **85.0%** | **+35.0pp** |
665
- | **Aggregate** | **74.8%** | **+10.6pp** |
666
-
667
- Mode A achieves **85.0% on open-domain questions — the highest of any system in the evaluation**, including cloud-powered ones.
668
-
669
- ### Math Layer Impact (6 Conversations, n=832)
670
-
671
- | Conversation | With Math | Without | Delta |
672
- |:-------------|:---------:|:-------:|:-----:|
673
- | Easiest | 78.5% | 71.2% | +7.3pp |
674
- | Hardest | 64.2% | 44.3% | **+19.9pp** |
675
- | **Average** | **71.7%** | **58.9%** | **+12.7pp** |
676
-
677
- Mathematical layers help most where heuristic methods struggle — the harder the conversation, the bigger the improvement.
678
-
679
- ### Ablation (What Each Component Contributes)
680
-
681
- | Removed | Impact |
682
- |:--------|:------:|
683
- | Cross-encoder reranking | **-30.7pp** |
684
- | Fisher-Rao metric | **-10.8pp** |
685
- | All math layers | **-7.6pp** |
686
- | BM25 channel | **-6.5pp** |
687
- | Sheaf consistency | -1.7pp |
688
- | Entity graph | -1.0pp |
689
-
690
- Full ablation details in the [Wiki](https://github.com/qualixar/superlocalmemory/wiki/Benchmarks).
691
-
692
- ---
693
-
694
- ## EU AI Act Compliance
695
-
696
- The EU AI Act (Regulation 2024/1689) takes full effect **August 2, 2026**. Every AI memory system that sends personal data to cloud LLMs for core operations has a compliance question to answer.
348
+ The EU AI Act (Regulation 2024/1689) takes full effect **August 2, 2026**.
697
349
 
698
350
  | Requirement | Mode A | Mode B | Mode C |
699
351
  |:------------|:------:|:------:|:------:|
@@ -702,226 +354,52 @@ The EU AI Act (Regulation 2024/1689) takes full effect **August 2, 2026**. Every
702
354
  | Transparency (Art. 13) | **Pass** | **Pass** | **Pass** |
703
355
  | No network calls during memory ops | **Yes** | **Yes** | No |
704
356
 
705
- To the best of our knowledge, **no existing agent memory system addresses EU AI Act compliance**. Modes A and B pass all checks by architectural design — no personal data leaves the device during any memory operation.
357
+ To the best of our knowledge, no existing agent memory system addresses EU AI Act compliance by architectural design. Modes A and B pass all checks — no personal data leaves the device during any memory operation.
706
358
 
707
- Built-in compliance tools: GDPR Article 15/17 export + complete erasure, tamper-proof SHA-256 audit chain, data provenance tracking, ABAC policy enforcement.
359
+ Built-in compliance tools: GDPR Article 15/17 export + complete erasure, tamper-proof SHA-256 audit chain, data provenance tracking, ABAC policy enforcement. See [docs/compliance.md](docs/compliance.md).
708
360
 
709
361
  ---
710
362
 
711
- ## Multilingual Embedding Support
712
-
713
- **v3.4.24+:** Plug in any OpenAI-compatible embedding endpoint — Ollama, vLLM, LiteLLM, or self-hosted models like `bge-m3`, `multilingual-e5`, `Qwen3-Embedding`. Configure from the dashboard (Settings > Step 3) or `config.json`. SLM's math layer (Fisher-Rao, Sheaf, Langevin) is language-agnostic — swap the embedding model and all 30+ languages work at full retrieval quality. No cloud dependency. No code changes. Your data, your language, your model.
714
-
715
- ---
716
-
717
- ## Web Dashboard
718
-
363
+ ## Advanced
364
+
365
+ | Topic | Link |
366
+ |:------|:-----|
367
+ | Full optimize docs | [docs/optimize-overview.md](docs/optimize-overview.md) · [docs/optimize-cli.md](docs/optimize-cli.md) · [docs/optimize-config.md](docs/optimize-config.md) |
368
+ | Distributed deployment | [docs/distributed-deployment.md](docs/distributed-deployment.md) |
369
+ | Multi-machine mesh | [docs/multi-machine.md](docs/multi-machine.md) |
370
+ | Auto-memory hooks | [docs/auto-memory.md](docs/auto-memory.md) |
371
+ | Architecture + math | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) |
372
+ | CLI reference | [docs/cli-reference.md](docs/cli-reference.md) |
373
+ | MCP tools reference | [docs/mcp-tools.md](docs/mcp-tools.md) |
374
+ | Getting started | [docs/getting-started.md](docs/getting-started.md) |
375
+ | IDE setup (15 configs) | [docs/ide-setup.md](docs/ide-setup.md) |
376
+ | Skill evolution | [docs/skill-evolution.md](docs/skill-evolution.md) |
377
+ | V2 migration | [docs/migration-from-v2.md](docs/migration-from-v2.md) |
378
+ | Configuration | [docs/configuration.md](docs/configuration.md) |
379
+ | Wiki | [github.com/qualixar/superlocalmemory/wiki](https://github.com/qualixar/superlocalmemory/wiki) |
380
+
381
+ **Web dashboard:**
719
382
  ```bash
720
383
  slm dashboard # Opens at http://localhost:8765
721
384
  ```
385
+ 17-tab sidebar with Knowledge Graph (Sigma.js WebGL, community detection), Health Monitor, Entity Explorer, Mesh Peers, Ingestion Status, Privacy blur mode. Cross-platform: macOS + Windows + Linux.
722
386
 
723
- **v3.4.4 "Neural Glass":** 17-tab sidebar dashboard with light + dark theme. Knowledge Graph (Sigma.js WebGL, community detection), Health Monitor, Entity Explorer (1,300+ entities), Mesh Peers (P2P agent communication), Ingestion Status (Gmail/Calendar/Transcript management), Privacy blur mode. Always-on daemon with auto-start. 8 mesh MCP tools built-in. Cross-platform: macOS + Windows + Linux. All data stays local.
724
-
725
- <!-- UX-M1: link dashboard-coverage so users can find deferred Living Brain Evolution tiles -->
726
- > **Living Brain Evolution visibility:** v3.4.21 ships the reward model, shadow test + online retrain, and evolution cost log via the REST API and `slm status --json`; the dedicated dashboard tiles are deferred to the next cycle. See [docs/DASHBOARD-COVERAGE.md](docs/DASHBOARD-COVERAGE.md) for endpoints and workarounds.
727
-
728
- ---
729
-
730
- <details>
731
- <summary><strong>Active Memory (V3.1) — Memory That Learns</strong> (click to expand)</summary>
732
-
733
- Every recall generates learning signals. Over time, the system adapts to your patterns — from baseline (0-19 signals) → rule-based (20+) → ML model (200+, LightGBM trained on YOUR usage). Zero LLM tokens spent. Four mathematical signals computed locally: co-retrieval, confidence lifecycle, channel performance, and entropy gap.
734
-
735
- Auto-capture hooks: `slm hooks install` + `slm observe` + `slm session-context`. MCP tools: `session_init`, `observe`, `report_feedback`.
736
-
737
- **`session_init` MCP parameters:**
738
- | Parameter | Type | Default | Description |
739
- |---|---|---|---|
740
- | `project_path` | string | `""` | Working directory — used to derive search query |
741
- | `query` | string | `""` | Override search query |
742
- | `max_results` | int | `10` | Max memories to return |
743
- | `max_age_days` | int | `30` | Suppress memories older than N days (0 = disabled). Memories with score ≥ 0.70 always surface regardless of age. |
744
-
745
- **`slm session-context` CLI flags** (consistent with MCP):
746
- ```bash
747
- slm session-context # fast path, 30-day window (default)
748
- slm session-context --max-age-days 7 # only last 7 days
749
- slm session-context --max-age-days 0 # no age filter
750
- slm session-context "my query" --full # full engine path (slow, requires Ollama)
751
- slm session-context --json # agent-native JSON output
752
- ```
753
-
754
- **No competitor learns at zero token cost.**
387
+ **Release history:**
755
388
 
756
- </details>
757
-
758
- ---
759
-
760
- ## Multi-Machine Mesh Coordination (New in v3.4.48)
761
-
762
- Run SLM on multiple machines (M4 + M5) and have your agents coordinate as one team without any disruption.
763
-
764
- ### Setup
765
-
766
- **M4 (broker):**
767
- ```bash
768
- export SLM_MESH_HOST=192.168.1.100
769
- export SLM_MESH_SHARED_SECRET=my-secret-key
770
- slm init # Starts SLM at http://192.168.1.100:8765
771
- ```
772
-
773
- **M5 (client):**
774
- ```bash
775
- export SLM_MESH_PEER_URL=http://192.168.1.100:8765
776
- export SLM_MESH_SHARED_SECRET=my-secret-key
777
- slm init # Syncs M4's agents every 30s, proxies messages to M4
778
- ```
779
-
780
- ### How It Works
781
-
782
- - **HTTP-based sync** — M5 queries M4's `/mesh/peers` endpoint every 30 seconds
783
- - **Message proxying** — When M5's agent sends a message to an M4 agent, it's routed automatically
784
- - **mDNS discovery (optional)** — M5 can auto-discover M4 on the LAN via `_slm-mesh._tcp` (enable with `SLM_MESH_DISCOVERY=on`, default)
785
- - **Graceful fallback** — Network errors logged but don't crash; offline agents queue messages for delivery
786
- - **Shared secret** — `SLM_MESH_SHARED_SECRET` gates remote peer discovery (required for remote mode)
787
-
788
- ### Environment Variables
789
-
790
- | Variable | Default | Purpose |
791
- |:---------|:--------|:--------|
792
- | `SLM_MESH_HOST` | `127.0.0.1` | Host this SLM listens on (set to IP for remote) |
793
- | `SLM_MESH_PEER_URL` | unset | Full URL of remote SLM (e.g., `http://192.168.1.100:8765`) |
794
- | `SLM_MESH_SHARED_SECRET` | unset | Auth secret (required when remote) |
795
- | `SLM_MESH_DISCOVERY` | `on` | mDNS discovery (`on`/`off`) |
796
- | `SLM_MESH_WS_PORT` | `7900` | WebSocket port for mesh (internal use) |
797
-
798
- ### Dependencies
799
-
800
- - `zeroconf>=0.140` (new in v3.4.48, optional, pure Python, auto-installed)
801
- - `httpx==0.28.1` (already in core deps)
802
- - No Docker. No external broker. Works on WiFi + LAN.
803
-
804
- ### MCP Tools
805
-
806
- All 8 mesh tools work seamlessly across machines:
807
-
808
- | Tool | Description |
809
- |:-----|:------------|
810
- | `mesh_peers` | List local + remote peers merged |
811
- | `mesh_send` | Send message to any peer (local or remote) |
812
- | `mesh_broadcast` | Send to all agents (across machines) |
813
- | `mesh_project` | Send to all agents in a project (across machines) |
814
- | `mesh_inbox` | Get messages for this agent |
815
- | `mesh_pending` | Get offline messages (broadcast/project) |
816
- | `mesh_state` | Get/set shared state (replicated) |
817
- | `mesh_lock` | Acquire/release distributed file locks |
818
-
819
- ---
820
-
821
- ## Features
822
-
823
- ### LLM Cost Optimization (v3.6 Optimize)
824
- - **Exact Cache** — byte-identical repeat calls served from local SQLite. SHA-256 key derivation, stampede shield, tag-based invalidation. **100% cost saved on hit** (input + output tokens).
825
- - **Semantic Cache** (opt-in) — vCache-powered learned thresholds with SAFE-CACHE centroid defense. Near-duplicate queries served within error bound. CacheAttack 86% hijack class blocked.
826
- - **Extractive Compression** — structure-preserving compression for JSON, code (AST-aware: Python/JS/Go/Rust/Java/C++), and tool outputs. **60-95% fewer input tokens**, zero accuracy regression.
827
- - **LLMLingua-2 Prose** (opt-in) — extractive prose summarization for open-ended chat. Safety-warned before enable.
828
- - **CCR (Compressed Context Retrieval)** — pre-compression originals stored for byte-exact reversal under UUID. Every compressed block recoverable.
829
- - **CacheAligner** — detects volatile tokens (UUIDs, timestamps, JWTs) in system prompts. Maximizes native provider prefix-cache discounts (Anthropic 90%, OpenAI 50%).
830
- - **Interception Proxy** — HTTP proxy on port 8765 serving Anthropic, OpenAI, and Gemini surfaces. Zero-code integration — just set `base_url`.
831
- - **Agent Wrapping** — `slm wrap claude` — one command starts proxy + sets environment + launches agent. 10 supported agents.
832
- - **Savings Dashboard** — live USD/INR/tokens saved, hit rate, compression ratio, cache size. CLI + UI.
833
- - **Hot-Reload Config** — UI/CLI writes `optimize.json`; daemon reloads in 2 seconds. No restart.
834
- - **Fail-open** — any cache/compress/proxy error passes through. Your calls never break.
835
- - **Data isolation** — separate `llmcache.db` with AES-256-GCM encryption. Never touches `memory.db`.
836
-
837
- ### Retrieval
838
- - 5-channel hybrid: Semantic (Fisher-Rao) + BM25 + Entity Graph + Temporal + Hopfield (associative / partial-query completion)
839
- - RRF fusion + cross-encoder reranking
840
- - Agentic sufficiency verification (auto-retry on weak results)
841
- - Adaptive ranking with LightGBM (learns from usage)
842
- - Hopfield completion for vague/partial queries
843
-
844
- ### Intelligence
845
- - 11-step ingestion pipeline (entity resolution, fact extraction, emotional tagging, scene building)
846
- - Automatic contradiction detection via sheaf cohomology
847
- - Adaptive memory lifecycle — memories strengthen with use, fade when neglected
848
- - Smart compression — embedding precision adapts to memory importance (up to 32x savings)
849
- - Cognitive consolidation — automatic pattern extraction from related memories
850
- - Auto-learned soft prompts injected into agent context
851
- - Behavioral pattern detection and outcome tracking
852
-
853
- ### Skill Evolution
854
- - **Per-skill performance tracking** — tracks which skills succeed and fail across sessions (zero-LLM, always on)
855
- - **Evolution engine** — 3-trigger system with blind verification. Off by default — enable via `slm config set evolution.enabled true`
856
- - **MCP tools** — `evolve_skill`, `skill_health`, `skill_lineage` for programmatic access
857
- - **Lineage DAG** — visual evolution history in the dashboard
858
- - **CLI config** — `slm config get/set` for all evolution settings
859
- - **Post-session triggers** — automatic analysis on session end via Stop hook
860
- - **[ECC](https://github.com/affaan-m/everything-claude-code) integration** — optional enhanced observations via `slm ingest --source ecc`
861
-
862
- ### Tiered Storage & Scaling
863
- - **4-tier lifecycle** — active, warm, cold, archived with automatic promotion/demotion
864
- - **Deep recall** — archived facts searchable at reduced weight
865
- - **Graph pruning** — automatic cleanup of orphan edges, self-loops, duplicates
866
- - **Fact consolidation** — clusters related facts into consolidated summaries
867
-
868
- ### Trust & Security
869
- - Bayesian Beta-distribution trust scoring (per-agent, per-fact)
870
- - Trust gates (block low-trust agents from writing/deleting)
871
- - ABAC (Attribute-Based Access Control) with DB-persisted policies
872
- - Tamper-proof hash-chain audit trail (SHA-256 linked entries)
873
-
874
- ### Infrastructure
875
- - 17-tab web dashboard with real-time visualization
876
- - 17+ IDE integrations (Claude, Cursor, Windsurf, VS Code, JetBrains, Zed, etc.)
877
- - 33 default MCP tools (+42 optional via `SLM_MCP_ALL_TOOLS=1`) + 7 MCP resources
878
- - Profile isolation (independent memory spaces)
879
- - 2,900+ tests, AGPL v3, cross-platform (Mac/Linux/Windows)
880
- - CPU-only — no GPU required
881
- - Automatic orphaned process cleanup
882
-
883
- ---
884
-
885
- ## CLI Reference
886
-
887
- | Command | What It Does |
888
- |:--------|:-------------|
889
- | `slm optimize status` | Show all Optimize settings (cache, compress, proxy, config version) |
890
- | `slm optimize on\|off` | Enable/disable all Optimize features (hot-reload, no restart) |
891
- | `slm optimize savings [--since N] [--provider P] [--json]` | Token/cost savings report — live USD/INR |
892
- | `slm cache status\|clear\|invalidate\|ttl\|semantic` | Cache sub-control — exact + semantic tiers, TTL management |
893
- | `slm compress status\|mode\|code\|prose\|ccr\|align` | Compression control — per-channel toggle, safe/aggressive mode |
894
- | `slm proxy [--port] [--provider] [--no-compress] [--semantic]` | Start interception proxy (port 8765) |
895
- | `slm wrap <agent> [options]` | Proxy-activate an agent — one command to start saving |
896
- | `slm help-optimize [topic]` | Full developer reference + per-agent setup recipes |
897
- | `slm remember "..."` | Store a memory |
898
- | `slm recall "..."` | Search memories |
899
- | `slm forget "..."` | Delete matching memories |
900
- | `slm trace "..."` | Recall with per-channel score breakdown |
901
- | `slm status` | System status |
902
- | `slm health` | Math layer health (Fisher, Sheaf, Langevin) |
903
- | `slm doctor` | Pre-flight check (deps, worker, Ollama, database) |
904
- | `slm mode a/b/c` | Switch operating mode |
905
- | `slm setup` | Interactive first-time wizard |
906
- | `slm warmup` | Pre-download embedding model |
907
- | `slm migrate` | V2 to V3 migration |
908
- | `slm dashboard` | Launch 17-tab web dashboard |
909
- | `slm mcp` | Start MCP server (for IDE integration) |
910
- | `slm connect` | Configure IDE integrations |
911
- | `slm hooks install` | Wire auto-memory into Claude Code hooks |
912
- | `slm profile list/create/switch` | Profile management |
913
- | `slm decay` | Run memory lifecycle review |
914
- | `slm session-context [query]` | Print session context (for hooks). Flags: `--max-age-days N` (default 30), `--full`, `--json` |
915
- | `slm quantize` | Run smart compression cycle |
916
- | `slm consolidate --cognitive` | Extract patterns from memory clusters |
917
- | `slm soft-prompts` | View auto-learned patterns |
918
- | `slm reap` | Clean orphaned SLM processes |
389
+ | Version | Codename | Key Features |
390
+ |---|---|---|
391
+ | **v3.6.15** | Multi-scope | **Opt-in [shared memory](docs/shared-memory.md)** (personal/shared/global, off by default), default-deny scope at every read path, recall scope-race fix, contributor PRs #42/#43/#44, fixes #46–#49 |
392
+ | **v3.6.14** | Plugin-native | Claude Code Plugin (WP-06), MCP profiles (WP-01), IDE connect (WP-08), asset consolidation, UI polish (WP-12) |
393
+ | **v3.6.x** | Optimize Everywhere / Distributed-ready | Three surfaces (proxy/MCP/skill), `SLM_REMOTE=1` LAN mode, remote dashboard, custom LLM endpoints |
394
+ | **v3.5.0** | Scale-Ready | CozoDB/LanceDB, 6-channel recall <1s, Core Memory Block, context injection v2, score normalization |
395
+ | **v3.4.x** | Scale-Ready (foundation) | Tiered storage, graph pruning, Hopfield channel, LightGBM ranking, mDNS mesh discovery |
396
+ | **v3.3.x** | Foundation | BM25Plus, Fisher-Rao, sqlite-vec, RRF fusion, cross-encoder rerank. 3 published papers |
919
397
 
920
398
  ---
921
399
 
922
400
  ## Research Papers
923
401
 
924
- SuperLocalMemory is backed by three published research papers (arXiv preprints + Zenodo DOIs) covering trust, information geometry, and cognitive memory architecture. These are preprints — not conference-accepted or journal-published yet.
402
+ SuperLocalMemory is backed by three published research papers (arXiv preprints + Zenodo DOIs). These are preprints — not conference-accepted or journal-published yet.
925
403
 
926
404
  ### Paper 3: The Living Brain (V3.3)
927
405
  > **SuperLocalMemory V3.3: The Living Brain — Biologically-Inspired Forgetting, Cognitive Quantization, and Multi-Channel Retrieval for Zero-LLM Agent Memory Systems**
@@ -968,79 +446,51 @@ SuperLocalMemory is backed by three published research papers (arXiv preprints +
968
446
 
969
447
  ---
970
448
 
971
- ## Prerequisites
972
-
973
- | Requirement | Version | Why |
974
- |:-----------|:--------|:----|
975
- | **Node.js** | 14+ | npm package manager |
976
- | **Python** | 3.11+ | V3 engine runtime |
977
-
978
- All Python dependencies install automatically during `npm install` — core math, dashboard server, learning engine, and performance optimizations. If anything fails, the installer shows exact fix commands. Run `slm doctor` after install to verify everything works. BM25 keyword search works even without embeddings — you're never fully blocked.
979
-
980
- | Component | Size | When |
981
- |:----------|:-----|:-----|
982
- | Core libraries (numpy, scipy, networkx) | ~50MB | During install |
983
- | Dashboard & MCP server (fastapi, uvicorn) | ~20MB | During install |
984
- | Learning engine (lightgbm) | ~10MB | During install |
985
- | Search engine (sentence-transformers, torch) | ~200MB | During install |
986
- | Embedding model (nomic-embed-text-v1.5, 768d) | ~500MB | First use or `slm warmup` |
987
- | **Mode B** requires [Ollama](https://ollama.com) + a model (`ollama pull llama3.2`) | ~2GB | Manual |
988
-
989
- ---
990
-
991
- ## Contributing
449
+ ## Support / License / Qualixar
992
450
 
993
451
  See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. [Wiki](https://github.com/qualixar/superlocalmemory/wiki) for detailed documentation.
994
452
 
995
- ## License
996
-
997
453
  GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](LICENSE).
998
454
 
999
455
  For commercial licensing (closed-source, proprietary, or hosted use), see [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md) or contact varun.pratap.bhardwaj@gmail.com.
1000
456
 
1001
457
  Copyright (c) 2026 Varun Pratap Bhardwaj / Qualixar.
1002
458
 
1003
- ## Attribution
1004
-
1005
459
  Part of [Qualixar](https://qualixar.com) · Author: [Varun Pratap Bhardwaj](https://varunpratap.com)
1006
460
 
1007
461
  ### Acknowledgments
1008
462
 
1009
- - **[Everything Claude Code (ECC)](https://github.com/affaan-m/everything-claude-code)** — SLM's skill observation patterns were inspired by ECC's continuous learning architecture. SLM supports direct ingestion of ECC observations via `slm ingest --source ecc`, giving ECC users richer skill performance tracking. We recommend ECC for Claude Code users who want the deepest learning experience alongside SLM.
463
+ - **[Everything Claude Code (ECC)](https://github.com/affaan-m/everything-claude-code)** — SLM's skill observation patterns were inspired by ECC's continuous learning architecture. SLM supports direct ingestion of ECC observations via `slm ingest --source ecc`. We recommend ECC for Claude Code users who want the deepest learning experience alongside SLM.
1010
464
  - **[HKUDS/OpenSpace](https://github.com/HKUDS/OpenSpace)** — The skill evolution research in SLM draws from the EvoSkills co-evolutionary verification concepts (arXiv:2604.01687). We adopted their 3-trigger evolution system and anti-loop guard patterns.
1011
465
 
1012
- ---
466
+ ### Qualixar AI Agent Reliability Platform
1013
467
 
1014
- <p align="center">
1015
- <sub>Built with mathematical rigor. Not in the race — here to help everyone build better AI memory systems.</sub>
1016
- </p>
1017
-
1018
- ---
468
+ Qualixar is building the open-source infrastructure for AI agent reliability engineering. Seven products, one coherent platform:
1019
469
 
1020
- ## Support This Project
470
+ | Product | Purpose | Install |
471
+ |---------|---------|---------|
472
+ | **[SuperLocalMemory](https://github.com/qualixar/superlocalmemory)** | Persistent memory + learning | `npm install -g superlocalmemory` |
473
+ | **[Qualixar OS](https://github.com/qualixar/qualixar-os)** | Universal agent runtime | `npx qualixar-os` |
474
+ | **[SLM Mesh](https://github.com/qualixar/slm-mesh)** | P2P coordination across sessions | `npm i slm-mesh` |
475
+ | **[SLM MCP Hub](https://github.com/qualixar/slm-mcp-hub)** | Federate 430+ MCP tools | `pip install slm-mcp-hub` |
476
+ | **[AgentAssay](https://github.com/qualixar/agentassay)** | Token-efficient agent testing | `pip install agentassay` |
477
+ | **[AgentAssert](https://github.com/qualixar/agentassert-abc)** | Behavioral contracts + drift detection | `pip install agentassert-abc` |
478
+ | **[SkillFortify](https://github.com/qualixar/skillfortify)** | Formal verification for agent skills | `pip install skillfortify` |
1021
479
 
1022
- If this project solves a real problem for you, **please star the repo** it helps other developers discover Qualixar and signals that the AI agent reliability community is growing. Every star matters.
480
+ **Zero cloud dependency. Local-first. EU AI Act compliant.**
1023
481
 
1024
- [![Star History Chart](https://api.star-history.com/svg?repos=qualixar/superlocalmemory&type=Date)](https://star-history.com/#qualixar/superlocalmemory&Date)
482
+ Start here → **[qualixar.com](https://qualixar.com)** · [All papers on Qualixar HuggingFace](https://huggingface.co/Qualixar)
1025
483
 
1026
484
  ---
1027
485
 
1028
- ## Part of the Qualixar AI Agent Reliability Platform
1029
-
1030
- Qualixar is building the open-source infrastructure for AI agent reliability engineering. Seven products, seven research papers (published as arXiv preprints + Zenodo archives), one coherent platform. Each tool solves one reliability pillar:
486
+ <p align="center">
487
+ <sub>Built with mathematical rigor. Not in the race — here to help everyone build better AI memory systems.</sub>
488
+ </p>
1031
489
 
1032
- | Product | Purpose | Install | Paper |
1033
- |---------|---------|---------|-------|
1034
- | **[SuperLocalMemory](https://github.com/qualixar/superlocalmemory)** | Persistent memory + learning for AI agents | `npx superlocalmemory` | [arXiv:2604.04514](https://arxiv.org/abs/2604.04514) |
1035
- | **[Qualixar OS](https://github.com/qualixar/qualixar-os)** | Universal agent runtime (13 execution topologies) | `npx qualixar-os` | [arXiv:2604.06392](https://arxiv.org/abs/2604.06392) |
1036
- | **[SLM Mesh](https://github.com/qualixar/slm-mesh)** | P2P coordination across AI agent sessions | `npm i slm-mesh` | — |
1037
- | **[SLM MCP Hub](https://github.com/qualixar/slm-mcp-hub)** | Federate 430+ MCP tools through one gateway | `pip install slm-mcp-hub` | — |
1038
- | **[AgentAssay](https://github.com/qualixar/agentassay)** | Token-efficient AI agent testing | `pip install agentassay` | [arXiv:2603.02601](https://arxiv.org/abs/2603.02601) |
1039
- | **[AgentAssert](https://github.com/qualixar/agentassert-abc)** | Behavioral contracts + drift detection | `pip install agentassert-abc` | [arXiv:2602.22302](https://arxiv.org/abs/2602.22302) |
1040
- | **[SkillFortify](https://github.com/qualixar/skillfortify)** | Formal verification for AI agent skills | `pip install skillfortify` | [arXiv:2603.00195](https://arxiv.org/abs/2603.00195) |
490
+ ---
1041
491
 
1042
- **Zero cloud dependency. Local-first. EU AI Act compliant.**
492
+ ## Star This Project
1043
493
 
1044
- Start here **[qualixar.com](https://qualixar.com)** · [All papers on Qualixar HuggingFace](https://huggingface.co/Qualixar)
494
+ If this project solves a real problem for you, **please star the repo** it helps other developers discover Qualixar and signals that the AI agent reliability community is growing.
1045
495
 
1046
- ---
496
+ [![Star History Chart](https://api.star-history.com/svg?repos=qualixar/superlocalmemory&type=Date)](https://star-history.com/#qualixar/superlocalmemory&Date)