superlocalmemory 3.4.46 → 3.4.49

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.
@@ -0,0 +1,771 @@
1
+ Metadata-Version: 2.4
2
+ Name: superlocalmemory
3
+ Version: 3.4.49
4
+ Summary: Information-geometric agent memory with mathematical guarantees
5
+ Author-email: Varun Pratap Bhardwaj <admin@superlocalmemory.com>
6
+ License: AGPL-3.0-or-later
7
+ Project-URL: Homepage, https://superlocalmemory.com
8
+ Project-URL: Repository, https://github.com/qualixar/superlocalmemory
9
+ Project-URL: Documentation, https://github.com/qualixar/superlocalmemory/wiki
10
+ Project-URL: Issues, https://github.com/qualixar/superlocalmemory/issues
11
+ Keywords: ai-memory,mcp-server,local-first,agent-memory,information-geometry,privacy-first,eu-ai-act
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: <3.15,>=3.11
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ License-File: NOTICE
29
+ License-File: AUTHORS.md
30
+ Requires-Dist: httpx==0.28.1
31
+ Requires-Dist: numpy==2.4.4
32
+ Requires-Dist: scipy==1.17.1
33
+ Requires-Dist: networkx==3.6.1
34
+ Requires-Dist: mcp==1.27.1
35
+ Requires-Dist: python-dateutil==2.9.0.post0
36
+ Requires-Dist: rank-bm25==0.2.2
37
+ Requires-Dist: vadersentiment==3.3.2
38
+ Requires-Dist: einops==0.8.2
39
+ Requires-Dist: fastapi[all]==0.136.1
40
+ Requires-Dist: uvicorn==0.46.0
41
+ Requires-Dist: websockets==16.0
42
+ Requires-Dist: zeroconf>=0.140
43
+ Requires-Dist: lightgbm==4.6.0
44
+ Requires-Dist: orjson==3.11.9
45
+ Requires-Dist: tree-sitter==0.25.2
46
+ Requires-Dist: tree-sitter-language-pack==0.13.0
47
+ Requires-Dist: rustworkx==0.17.1
48
+ Requires-Dist: watchdog==5.0.3
49
+ Requires-Dist: psutil==7.2.2
50
+ Requires-Dist: structlog==25.5.0
51
+ Requires-Dist: portalocker==3.2.0
52
+ Requires-Dist: sentence-transformers==5.3.0
53
+ Requires-Dist: optimum==2.1.0
54
+ Requires-Dist: onnxruntime==1.24.4
55
+ Requires-Dist: transformers==4.57.6
56
+ Requires-Dist: huggingface_hub==0.36.2
57
+ Requires-Dist: torch==2.11.0
58
+ Requires-Dist: scikit-learn==1.8.0
59
+ Requires-Dist: sqlite-vec==0.1.9
60
+ Provides-Extra: search
61
+ Requires-Dist: sentence-transformers==5.3.0; extra == "search"
62
+ Requires-Dist: optimum==2.1.0; extra == "search"
63
+ Requires-Dist: einops==0.8.2; extra == "search"
64
+ Requires-Dist: torch==2.11.0; extra == "search"
65
+ Requires-Dist: scikit-learn==1.8.0; extra == "search"
66
+ Requires-Dist: geoopt>=0.5.0; extra == "search"
67
+ Requires-Dist: onnxruntime==1.24.4; extra == "search"
68
+ Provides-Extra: ui
69
+ Requires-Dist: fastapi[all]>=0.135.1; extra == "ui"
70
+ Requires-Dist: uvicorn>=0.42.0; extra == "ui"
71
+ Requires-Dist: python-multipart<1.0.0,>=0.0.6; extra == "ui"
72
+ Provides-Extra: learning
73
+ Requires-Dist: lightgbm>=4.0.0; extra == "learning"
74
+ Provides-Extra: performance
75
+ Requires-Dist: orjson>=3.9.0; extra == "performance"
76
+ Provides-Extra: ingestion
77
+ Requires-Dist: keyring>=25.0.0; extra == "ingestion"
78
+ Requires-Dist: google-auth-oauthlib>=1.2.0; extra == "ingestion"
79
+ Requires-Dist: google-api-python-client>=2.100.0; extra == "ingestion"
80
+ Requires-Dist: icalendar>=6.0.0; extra == "ingestion"
81
+ Provides-Extra: full
82
+ Requires-Dist: superlocalmemory[ingestion,learning,performance,search,ui]; extra == "full"
83
+ Provides-Extra: dev
84
+ Requires-Dist: pytest>=8.0; extra == "dev"
85
+ Requires-Dist: pytest-cov>=4.1; extra == "dev"
86
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
87
+ Requires-Dist: sqlite-vec>=0.1.6; extra == "dev"
88
+ Dynamic: license-file
89
+
90
+ <p align="center">
91
+ <img src="https://superlocalmemory.com/assets/logo-mark.png" alt="SuperLocalMemory" width="200"/>
92
+ </p>
93
+
94
+ <h1 align="center">SuperLocalMemory V3.4</h1>
95
+ <p align="center"><strong>Every other AI forgets. Yours won't.</strong><br/><em>Infinite memory for Claude Code, Cursor, Windsurf, and any MCP-compatible AI client.</em></p>
96
+ <p align="center"><code>v3.4.48</code> — Install once. Every session remembers the last. Automatically.<br><strong>Now with multi-machine agent mesh — M4 and M5 coordinate as one.</strong></p>
97
+ <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>
98
+
99
+ <p align="center">
100
+ <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>
101
+ </p>
102
+
103
+ <p align="center">
104
+ <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>
105
+ <a href="https://pypi.org/project/superlocalmemory/"><img src="https://img.shields.io/pypi/v/superlocalmemory?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"/></a>
106
+ <a href="https://www.npmjs.com/package/superlocalmemory"><img src="https://img.shields.io/npm/v/superlocalmemory?style=for-the-badge&logo=npm&logoColor=white" alt="npm"/></a>
107
+ <a href="https://www.gnu.org/licenses/agpl-3.0"><img src="https://img.shields.io/badge/License-AGPL_v3-blue.svg?style=for-the-badge" alt="AGPL v3"/></a>
108
+ <a href="#eu-ai-act-compliance"><img src="https://img.shields.io/badge/EU_AI_Act-Design_Compliant-brightgreen?style=for-the-badge" alt="EU AI Act Design Compliant"/></a>
109
+ <a href="https://superlocalmemory.com"><img src="https://img.shields.io/badge/Web-superlocalmemory.com-ff6b35?style=for-the-badge" alt="Website"/></a>
110
+ <a href="#dual-interface-mcp--cli"><img src="https://img.shields.io/badge/MCP-Native-blue?style=for-the-badge" alt="MCP Native"/></a>
111
+ <a href="#dual-interface-mcp--cli"><img src="https://img.shields.io/badge/CLI-Agent--Native-green?style=for-the-badge" alt="CLI Agent-Native"/></a>
112
+ <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>
113
+ </p>
114
+
115
+ <p align="center">
116
+ <video src="https://github.com/user-attachments/assets/c3b54a1d-f62a-4ea7-bba7-900435e7b3ab" width="800" autoplay loop muted playsinline></video>
117
+ </p>
118
+
119
+ ---
120
+
121
+ ## Why SuperLocalMemory?
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ **The numbers** (evaluated on [LoCoMo](https://arxiv.org/abs/2402.09714), the standard long-conversation memory benchmark). Published numbers as of April 2026:
128
+
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, repro script in `docs/benchmarks/` |
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, repro script in `docs/benchmarks/` |
137
+ | Mem0 (zero-retrieval-LLM) | 64.2% | Local baseline | No | Partial | Mem0 paper, zero-LLM row |
138
+
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. 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.
140
+
141
+ **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.
142
+
143
+ 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.
144
+
145
+ > **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.
146
+
147
+ ---
148
+
149
+ <details>
150
+ <summary><strong>What's New in V3.3 — The Living Brain Evolves</strong> (click to expand)</summary>
151
+
152
+ > 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.
153
+
154
+ ### Features at a Glance
155
+
156
+ - **Adaptive Memory Lifecycle** — memories naturally strengthen with use and fade when neglected. No manual cleanup, no hardcoded TTLs.
157
+ - **Smart Compression** — embedding precision adapts to memory importance. Low-priority memories compress up to 32x. High-value memories stay full-resolution.
158
+ - **Cognitive Consolidation** — the system automatically extracts patterns from clusters of related memories. One decision referenced 50 times becomes one reusable insight.
159
+ - **Pattern Learning** — auto-learned soft prompts injected into your agent's context at session start. The system teaches itself what matters to you.
160
+ - **Hopfield Retrieval (6th Channel)** — vague or partial queries now complete themselves. Ask half a question, get the whole answer.
161
+ - **Process Health** — orphaned SLM processes detected and cleaned automatically. No more zombie workers eating RAM.
162
+
163
+ ### New CLI Commands
164
+
165
+ ```bash
166
+ # Run a memory lifecycle review — strengthens active memories, archives neglected ones
167
+ slm decay
168
+
169
+ # Run smart compression — adapts embedding precision to memory importance
170
+ slm quantize
171
+
172
+ # Extract reusable patterns from memory clusters
173
+ slm consolidate --cognitive
174
+
175
+ # View auto-learned patterns that get injected into agent context
176
+ slm soft-prompts
177
+
178
+ # Clean up orphaned SLM processes
179
+ slm reap
180
+ ```
181
+
182
+ ### New MCP Tools
183
+
184
+ | Tool | Description |
185
+ |:-----|:------------|
186
+ | `forget` | Programmatic memory archival via lifecycle rules |
187
+ | `quantize` | Trigger smart compression on demand |
188
+ | `consolidate_cognitive` | Extract and store patterns from memory clusters |
189
+ | `get_soft_prompts` | Retrieve auto-learned patterns for context injection |
190
+ | `reap_processes` | Clean orphaned SLM processes |
191
+ | `get_retention_stats` | Memory lifecycle analytics |
192
+
193
+ ### Mode A/B Memory Improvements
194
+
195
+ | Metric | V3.2 | V3.3 | Change |
196
+ |:-------|:----:|:----:|:------:|
197
+ | RAM usage (Mode A/B) | ~4GB | ~40MB | **100x reduction** |
198
+ | Retrieval channels | 5 | 6 | +Hopfield completion |
199
+ | MCP tools (default) | 29 | 33 | +4 new (mesh set) |
200
+ | CLI commands | 21 | 26 | +5 new |
201
+ | 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)) |
202
+ | API endpoints | 9 | 16 | +7 new |
203
+
204
+ Embedding migration happens automatically when you switch modes — no manual steps needed.
205
+
206
+ ### Dashboard
207
+
208
+ 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.
209
+
210
+ ### Enable V3.3 Features
211
+
212
+ All new features default OFF. Zero breaking changes. Opt in when ready:
213
+
214
+ ```bash
215
+ # Turn on adaptive memory lifecycle
216
+ slm config set lifecycle.enabled true
217
+
218
+ # Turn on smart compression
219
+ slm config set quantization.enabled true
220
+
221
+ # Turn on cognitive consolidation
222
+ slm config set consolidation.cognitive.enabled true
223
+
224
+ # Turn on pattern learning (soft prompts)
225
+ slm config set soft_prompts.enabled true
226
+
227
+ # Turn on Hopfield retrieval (6th channel)
228
+ slm config set retrieval.hopfield.enabled true
229
+
230
+ # Or enable everything at once
231
+ slm config set v33_features.all true
232
+ ```
233
+
234
+ **Fully backward compatible.** All existing MCP tools, CLI commands, and configs work unchanged. New tables are created automatically on first run. No migration needed.
235
+
236
+ </details>
237
+
238
+ ---
239
+
240
+ <details>
241
+ <summary><strong>What's New in V3.2 — The Living Brain</strong> (click to expand)</summary>
242
+
243
+ 100x faster recall (<10ms at 10K facts), automatic memory surfacing, associative retrieval (5th channel), temporal intelligence with bi-temporal validity, sleep-time consolidation, and core memory blocks. All features default OFF, zero breaking changes.
244
+
245
+ | Metric | V3.0 | V3.2 | Change |
246
+ |:-------|:----:|:----:|:------:|
247
+ | Recall latency (10K facts) | ~500ms | <10ms | **100x faster** |
248
+ | Retrieval channels | 4 | 5 | +spreading activation |
249
+ | MCP tools | 24 | 29 | +5 new |
250
+ | DB tables | 9 | 18 | +9 new |
251
+
252
+ Enable with `slm config set v32_features.all true`. See the [V3.2 Overview](https://github.com/qualixar/superlocalmemory/wiki/V3.2-Overview) wiki page for details.
253
+
254
+ </details>
255
+
256
+ ---
257
+
258
+ ## Quick Start
259
+
260
+ ### Install via npm (recommended)
261
+
262
+ ```bash
263
+ npm install -g superlocalmemory
264
+ slm setup # Choose mode (A/B/C)
265
+ slm doctor # Verify everything is working
266
+ slm warmup # Pre-download embedding model (~500MB, optional)
267
+ ```
268
+
269
+ ### Install via pip
270
+
271
+ ```bash
272
+ pip install superlocalmemory
273
+ ```
274
+
275
+ ### First Use
276
+
277
+ ```bash
278
+ slm remember "Alice works at Google as a Staff Engineer"
279
+ slm recall "What does Alice do?"
280
+ slm status
281
+ ```
282
+
283
+ ### MCP Integration (Claude, Cursor, Windsurf, VS Code, etc.)
284
+
285
+ ```json
286
+ {
287
+ "mcpServers": {
288
+ "superlocalmemory": {
289
+ "command": "slm",
290
+ "args": ["mcp"]
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ 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/`). **V3.3: Adaptive lifecycle, smart compression, and pattern learning.**
297
+
298
+ ### Dual Interface: MCP + CLI
299
+
300
+ 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.
301
+
302
+ | Need | Use | Example |
303
+ |------|-----|---------|
304
+ | IDE integration | MCP | Auto-configured for 17+ IDEs via `slm connect` |
305
+ | Shell scripts | CLI + `--json` | `slm recall "auth" --json \| jq '.data.results[0]'` |
306
+ | CI/CD pipelines | CLI + `--json` | `slm remember "deployed v2.1" --json` in GitHub Actions |
307
+ | Agent frameworks | CLI + `--json` | OpenClaw, Codex, Goose, nanobot |
308
+ | Human use | CLI | `slm recall "auth"` (readable text output) |
309
+
310
+ **Agent-native JSON output** on every command:
311
+
312
+ ```bash
313
+ # Human-readable (default)
314
+ slm recall "database schema"
315
+ # 1. [0.87] Database uses PostgreSQL 16 on port 5432...
316
+
317
+ # Agent-native JSON
318
+ slm recall "database schema" --json
319
+ # {"success": true, "command": "recall", "version": "3.0.22", "data": {"results": [...]}}
320
+ ```
321
+
322
+ All `--json` responses follow a consistent envelope with `success`, `command`, `version`, `data`, and `next_actions` for agent guidance.
323
+
324
+ ---
325
+
326
+ ## Smart-hook architecture (v3.4.43)
327
+
328
+ SLM ships a small set of Claude Code hooks that fire memory operations only
329
+ when there's a real signal — not on a timer, not on every keystroke. The
330
+ hooks are perf-budgeted (<10ms p99 for the hot path) and fail-open (any
331
+ crash → silent exit, never blocks your prompt). Install them with one
332
+ command:
333
+
334
+ ```bash
335
+ slm hooks install # wires hooks into ~/.claude/settings.json
336
+ slm hooks status # shows what's installed
337
+ slm hooks remove # cleans up, preserves non-SLM hooks
338
+ ```
339
+
340
+ | Hook | Event | When it fires | Why |
341
+ |---|---|---|---|
342
+ | `slm hook start` | SessionStart | Once at session boot | Injects core memory + recent context + learned patterns. ~80ms. |
343
+ | `slm hook user_prompt_rehash` | UserPromptSubmit | Every prompt | Detects re-queries within 60s (negative signal that prior recall didn't satisfy). <10ms hot path. |
344
+ | **`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. |
345
+ | **`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. |
346
+ | `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). |
347
+ | `slm hook post_tool_outcome` | PostToolUse (all tools) | Every tool call | Tracks which recalled facts got used (learning signal). |
348
+ | `slm hook stop` | Stop | Session end | Saves rich session summary with git context. |
349
+
350
+ **What "smart" means here:** the hooks don't interrupt you on a schedule.
351
+ They watch for specific events that indicate memory work would add value —
352
+ a topic pivot, a web call about to fire, a re-asked question, a file edit.
353
+ Otherwise they stay out of your way.
354
+
355
+ **Observability for the new hooks:**
356
+ `topic_shift` writes one TSV line per decision to
357
+ `~/.superlocalmemory/logs/topic-shift.log`
358
+ (`timestamp | session_hash | current_words_count | window_depth | max_overlap |
359
+ fired | prompt_preview`). Disable with `SLM_TOPIC_SHIFT_LOG=0`.
360
+
361
+ **Upgrading from v3.4.42 or older:** Run `slm hooks install` once after
362
+ upgrade to pull in the new wiring. `slm hooks status` will flag the
363
+ version mismatch. Merge is idempotent — safe to run twice.
364
+
365
+ ---
366
+
367
+ ## Three Operating Modes
368
+
369
+ | Mode | What | Cloud? | EU AI Act | Best For |
370
+ |:----:|:-----|:------:|:---------:|:---------|
371
+ | **A** | Local Guardian | **None** | **Compliant** | Privacy-first, air-gapped, enterprise |
372
+ | **B** | Smart Local | Local only (Ollama) | Compliant | Better answers, data stays local |
373
+ | **C** | Full Power | Cloud LLM | Partial | Maximum accuracy, research |
374
+
375
+ ```bash
376
+ slm mode a # Zero-cloud (default)
377
+ slm mode b # Local Ollama
378
+ slm mode c # Cloud LLM
379
+ ```
380
+
381
+ **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.
382
+
383
+ ---
384
+
385
+ ## Architecture
386
+
387
+ ```
388
+ Query ──► Strategy Classifier ──► 5 Parallel Channels:
389
+ ├── Semantic (Fisher-Rao geodesic distance)
390
+ ├── BM25 (keyword matching)
391
+ ├── Entity Graph (spreading activation, 3 hops)
392
+ ├── Temporal (date-aware retrieval)
393
+ └── Hopfield (partial-query completion / associative recall)
394
+
395
+ RRF Fusion (k=60)
396
+
397
+ Scene Expansion + Bridge Discovery
398
+
399
+ Cross-Encoder Reranking
400
+
401
+ ◄── Top-K Results with channel scores
402
+ ```
403
+
404
+ ### Mathematical Foundations
405
+
406
+ Three novel contributions replace cloud LLM dependency with mathematical guarantees:
407
+
408
+ 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.
409
+
410
+ 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.
411
+
412
+ 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.
413
+
414
+ 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.
415
+
416
+ ---
417
+
418
+ ## Benchmarks
419
+
420
+ Evaluated on [LoCoMo](https://arxiv.org/abs/2402.09714) — 10 multi-session conversations, 1,986 total questions, 4 scored categories.
421
+
422
+ ### Mode A (Zero-Cloud, 10 Conversations, 1,276 Questions)
423
+
424
+ | Category | Score | vs. Mem0 (64.2%) |
425
+ |:---------|:-----:|:-----------------:|
426
+ | Single-Hop | 72.0% | +3.0pp |
427
+ | Multi-Hop | 70.3% | +8.6pp |
428
+ | Temporal | 80.0% | +21.7pp |
429
+ | **Open-Domain** | **85.0%** | **+35.0pp** |
430
+ | **Aggregate** | **74.8%** | **+10.6pp** |
431
+
432
+ Mode A achieves **85.0% on open-domain questions — the highest of any system in the evaluation**, including cloud-powered ones.
433
+
434
+ ### Math Layer Impact (6 Conversations, n=832)
435
+
436
+ | Conversation | With Math | Without | Delta |
437
+ |:-------------|:---------:|:-------:|:-----:|
438
+ | Easiest | 78.5% | 71.2% | +7.3pp |
439
+ | Hardest | 64.2% | 44.3% | **+19.9pp** |
440
+ | **Average** | **71.7%** | **58.9%** | **+12.7pp** |
441
+
442
+ Mathematical layers help most where heuristic methods struggle — the harder the conversation, the bigger the improvement.
443
+
444
+ ### Ablation (What Each Component Contributes)
445
+
446
+ | Removed | Impact |
447
+ |:--------|:------:|
448
+ | Cross-encoder reranking | **-30.7pp** |
449
+ | Fisher-Rao metric | **-10.8pp** |
450
+ | All math layers | **-7.6pp** |
451
+ | BM25 channel | **-6.5pp** |
452
+ | Sheaf consistency | -1.7pp |
453
+ | Entity graph | -1.0pp |
454
+
455
+ Full ablation details in the [Wiki](https://github.com/qualixar/superlocalmemory/wiki/Benchmarks).
456
+
457
+ ---
458
+
459
+ ## EU AI Act Compliance
460
+
461
+ 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.
462
+
463
+ | Requirement | Mode A | Mode B | Mode C |
464
+ |:------------|:------:|:------:|:------:|
465
+ | Data sovereignty (Art. 10) | **Pass** | **Pass** | Requires DPA |
466
+ | Right to erasure (GDPR Art. 17) | **Pass** | **Pass** | **Pass** |
467
+ | Transparency (Art. 13) | **Pass** | **Pass** | **Pass** |
468
+ | No network calls during memory ops | **Yes** | **Yes** | No |
469
+
470
+ 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.
471
+
472
+ Built-in compliance tools: GDPR Article 15/17 export + complete erasure, tamper-proof SHA-256 audit chain, data provenance tracking, ABAC policy enforcement.
473
+
474
+ ---
475
+
476
+ ## Multilingual Embedding Support
477
+
478
+ **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.
479
+
480
+ ---
481
+
482
+ ## Web Dashboard
483
+
484
+ ```bash
485
+ slm dashboard # Opens at http://localhost:8765
486
+ ```
487
+
488
+ **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.
489
+
490
+ <!-- UX-M1: link dashboard-coverage so users can find deferred Living Brain Evolution tiles -->
491
+ > **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.
492
+
493
+ ---
494
+
495
+ <details>
496
+ <summary><strong>Active Memory (V3.1) — Memory That Learns</strong> (click to expand)</summary>
497
+
498
+ 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.
499
+
500
+ Auto-capture hooks: `slm hooks install` + `slm observe` + `slm session-context`. MCP tools: `session_init`, `observe`, `report_feedback`.
501
+
502
+ **No competitor learns at zero token cost.**
503
+
504
+ </details>
505
+
506
+ ---
507
+
508
+ ## Multi-Machine Mesh Coordination (New in v3.4.48)
509
+
510
+ Run SLM on multiple machines (M4 + M5) and have your agents coordinate as one team without any disruption.
511
+
512
+ ### Setup
513
+
514
+ **M4 (broker):**
515
+ ```bash
516
+ export SLM_MESH_HOST=192.168.1.100
517
+ export SLM_MESH_SHARED_SECRET=my-secret-key
518
+ slm init # Starts SLM at http://192.168.1.100:8765
519
+ ```
520
+
521
+ **M5 (client):**
522
+ ```bash
523
+ export SLM_MESH_PEER_URL=http://192.168.1.100:8765
524
+ export SLM_MESH_SHARED_SECRET=my-secret-key
525
+ slm init # Syncs M4's agents every 30s, proxies messages to M4
526
+ ```
527
+
528
+ ### How It Works
529
+
530
+ - **HTTP-based sync** — M5 queries M4's `/mesh/peers` endpoint every 30 seconds
531
+ - **Message proxying** — When M5's agent sends a message to an M4 agent, it's routed automatically
532
+ - **mDNS discovery (optional)** — M5 can auto-discover M4 on the LAN via `_slm-mesh._tcp` (enable with `SLM_MESH_DISCOVERY=on`, default)
533
+ - **Graceful fallback** — Network errors logged but don't crash; offline agents queue messages for delivery
534
+ - **Shared secret** — `SLM_MESH_SHARED_SECRET` gates remote peer discovery (required for remote mode)
535
+
536
+ ### Environment Variables
537
+
538
+ | Variable | Default | Purpose |
539
+ |:---------|:--------|:--------|
540
+ | `SLM_MESH_HOST` | `127.0.0.1` | Host this SLM listens on (set to IP for remote) |
541
+ | `SLM_MESH_PEER_URL` | unset | Full URL of remote SLM (e.g., `http://192.168.1.100:8765`) |
542
+ | `SLM_MESH_SHARED_SECRET` | unset | Auth secret (required when remote) |
543
+ | `SLM_MESH_DISCOVERY` | `on` | mDNS discovery (`on`/`off`) |
544
+ | `SLM_MESH_WS_PORT` | `7900` | WebSocket port for mesh (internal use) |
545
+
546
+ ### Dependencies
547
+
548
+ - `zeroconf>=0.140` (new in v3.4.48, optional, pure Python, auto-installed)
549
+ - `httpx==0.28.1` (already in core deps)
550
+ - No Docker. No external broker. Works on WiFi + LAN.
551
+
552
+ ### MCP Tools
553
+
554
+ All 8 mesh tools work seamlessly across machines:
555
+
556
+ | Tool | Description |
557
+ |:-----|:------------|
558
+ | `mesh_peers` | List local + remote peers merged |
559
+ | `mesh_send` | Send message to any peer (local or remote) |
560
+ | `mesh_broadcast` | Send to all agents (across machines) |
561
+ | `mesh_project` | Send to all agents in a project (across machines) |
562
+ | `mesh_inbox` | Get messages for this agent |
563
+ | `mesh_pending` | Get offline messages (broadcast/project) |
564
+ | `mesh_state` | Get/set shared state (replicated) |
565
+ | `mesh_lock` | Acquire/release distributed file locks |
566
+
567
+ ---
568
+
569
+ ## Features
570
+
571
+ ### Retrieval
572
+ - 5-channel hybrid: Semantic (Fisher-Rao) + BM25 + Entity Graph + Temporal + Hopfield (associative / partial-query completion)
573
+ - RRF fusion + cross-encoder reranking
574
+ - Agentic sufficiency verification (auto-retry on weak results)
575
+ - Adaptive ranking with LightGBM (learns from usage)
576
+ - Hopfield completion for vague/partial queries
577
+
578
+ ### Intelligence
579
+ - 11-step ingestion pipeline (entity resolution, fact extraction, emotional tagging, scene building)
580
+ - Automatic contradiction detection via sheaf cohomology
581
+ - Adaptive memory lifecycle — memories strengthen with use, fade when neglected
582
+ - Smart compression — embedding precision adapts to memory importance (up to 32x savings)
583
+ - Cognitive consolidation — automatic pattern extraction from related memories
584
+ - Auto-learned soft prompts injected into agent context
585
+ - Behavioral pattern detection and outcome tracking
586
+
587
+ ### Skill Evolution
588
+ - **Per-skill performance tracking** — tracks which skills succeed and fail across sessions (zero-LLM, always on)
589
+ - **Evolution engine** — 3-trigger system with blind verification. Off by default — enable via `slm config set evolution.enabled true`
590
+ - **MCP tools** — `evolve_skill`, `skill_health`, `skill_lineage` for programmatic access
591
+ - **Lineage DAG** — visual evolution history in the dashboard
592
+ - **CLI config** — `slm config get/set` for all evolution settings
593
+ - **Post-session triggers** — automatic analysis on session end via Stop hook
594
+ - **[ECC](https://github.com/affaan-m/everything-claude-code) integration** — optional enhanced observations via `slm ingest --source ecc`
595
+
596
+ ### Tiered Storage & Scaling
597
+ - **4-tier lifecycle** — active, warm, cold, archived with automatic promotion/demotion
598
+ - **Deep recall** — archived facts searchable at reduced weight
599
+ - **Graph pruning** — automatic cleanup of orphan edges, self-loops, duplicates
600
+ - **Fact consolidation** — clusters related facts into consolidated summaries
601
+
602
+ ### Trust & Security
603
+ - Bayesian Beta-distribution trust scoring (per-agent, per-fact)
604
+ - Trust gates (block low-trust agents from writing/deleting)
605
+ - ABAC (Attribute-Based Access Control) with DB-persisted policies
606
+ - Tamper-proof hash-chain audit trail (SHA-256 linked entries)
607
+
608
+ ### Infrastructure
609
+ - 17-tab web dashboard with real-time visualization
610
+ - 17+ IDE integrations (Claude, Cursor, Windsurf, VS Code, JetBrains, Zed, etc.)
611
+ - 33 default MCP tools (+42 optional via `SLM_MCP_ALL_TOOLS=1`) + 7 MCP resources
612
+ - Profile isolation (independent memory spaces)
613
+ - 2,900+ tests, AGPL v3, cross-platform (Mac/Linux/Windows)
614
+ - CPU-only — no GPU required
615
+ - Automatic orphaned process cleanup
616
+
617
+ ---
618
+
619
+ ## CLI Reference
620
+
621
+ | Command | What It Does |
622
+ |:--------|:-------------|
623
+ | `slm remember "..."` | Store a memory |
624
+ | `slm recall "..."` | Search memories |
625
+ | `slm forget "..."` | Delete matching memories |
626
+ | `slm trace "..."` | Recall with per-channel score breakdown |
627
+ | `slm status` | System status |
628
+ | `slm health` | Math layer health (Fisher, Sheaf, Langevin) |
629
+ | `slm doctor` | Pre-flight check (deps, worker, Ollama, database) |
630
+ | `slm mode a/b/c` | Switch operating mode |
631
+ | `slm setup` | Interactive first-time wizard |
632
+ | `slm warmup` | Pre-download embedding model |
633
+ | `slm migrate` | V2 to V3 migration |
634
+ | `slm dashboard` | Launch 17-tab web dashboard |
635
+ | `slm mcp` | Start MCP server (for IDE integration) |
636
+ | `slm connect` | Configure IDE integrations |
637
+ | `slm hooks install` | Wire auto-memory into Claude Code hooks |
638
+ | `slm profile list/create/switch` | Profile management |
639
+ | `slm decay` | Run memory lifecycle review |
640
+ | `slm quantize` | Run smart compression cycle |
641
+ | `slm consolidate --cognitive` | Extract patterns from memory clusters |
642
+ | `slm soft-prompts` | View auto-learned patterns |
643
+ | `slm reap` | Clean orphaned SLM processes |
644
+
645
+ ---
646
+
647
+ ## Research Papers
648
+
649
+ 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.
650
+
651
+ ### Paper 3: The Living Brain (V3.3)
652
+ > **SuperLocalMemory V3.3: The Living Brain — Biologically-Inspired Forgetting, Cognitive Quantization, and Multi-Channel Retrieval for Zero-LLM Agent Memory Systems**
653
+ > Varun Pratap Bhardwaj (2026)
654
+ > [arXiv:2604.04514](https://arxiv.org/abs/2604.04514) · [Zenodo DOI: 10.5281/zenodo.19435120](https://zenodo.org/records/19435120)
655
+
656
+ ### Paper 2: Information-Geometric Foundations (V3)
657
+ > **SuperLocalMemory V3: Information-Geometric Foundations for Zero-LLM Enterprise Agent Memory**
658
+ > Varun Pratap Bhardwaj (2026)
659
+ > [arXiv:2603.14588](https://arxiv.org/abs/2603.14588) · [Zenodo DOI: 10.5281/zenodo.19038659](https://zenodo.org/records/19038659)
660
+
661
+ ### Paper 1: Trust & Behavioral Foundations (V2)
662
+ > **SuperLocalMemory: A Structured Local Memory Architecture for Persistent AI Agent Context**
663
+ > Varun Pratap Bhardwaj (2026)
664
+ > [arXiv:2603.02240](https://arxiv.org/abs/2603.02240) · [Zenodo DOI: 10.5281/zenodo.18709670](https://zenodo.org/records/18709670)
665
+
666
+ ### Cite This Work
667
+
668
+ ```bibtex
669
+ @article{bhardwaj2026slmv33,
670
+ title={SuperLocalMemory V3.3: The Living Brain — Biologically-Inspired
671
+ Forgetting, Cognitive Quantization, and Multi-Channel Retrieval
672
+ for Zero-LLM Agent Memory Systems},
673
+ author={Bhardwaj, Varun Pratap},
674
+ journal={arXiv preprint arXiv:2604.04514},
675
+ year={2026},
676
+ url={https://arxiv.org/abs/2604.04514}
677
+ }
678
+
679
+ @article{bhardwaj2026slmv3,
680
+ title={Information-Geometric Foundations for Zero-LLM Enterprise Agent Memory},
681
+ author={Bhardwaj, Varun Pratap},
682
+ journal={arXiv preprint arXiv:2603.14588},
683
+ year={2026}
684
+ }
685
+
686
+ @article{bhardwaj2026slm,
687
+ title={A Structured Local Memory Architecture for Persistent AI Agent Context},
688
+ author={Bhardwaj, Varun Pratap},
689
+ journal={arXiv preprint arXiv:2603.02240},
690
+ year={2026}
691
+ }
692
+ ```
693
+
694
+ ---
695
+
696
+ ## Prerequisites
697
+
698
+ | Requirement | Version | Why |
699
+ |:-----------|:--------|:----|
700
+ | **Node.js** | 14+ | npm package manager |
701
+ | **Python** | 3.11+ | V3 engine runtime |
702
+
703
+ 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.
704
+
705
+ | Component | Size | When |
706
+ |:----------|:-----|:-----|
707
+ | Core libraries (numpy, scipy, networkx) | ~50MB | During install |
708
+ | Dashboard & MCP server (fastapi, uvicorn) | ~20MB | During install |
709
+ | Learning engine (lightgbm) | ~10MB | During install |
710
+ | Search engine (sentence-transformers, torch) | ~200MB | During install |
711
+ | Embedding model (nomic-embed-text-v1.5, 768d) | ~500MB | First use or `slm warmup` |
712
+ | **Mode B** requires [Ollama](https://ollama.com) + a model (`ollama pull llama3.2`) | ~2GB | Manual |
713
+
714
+ ---
715
+
716
+ ## Contributing
717
+
718
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. [Wiki](https://github.com/qualixar/superlocalmemory/wiki) for detailed documentation.
719
+
720
+ ## License
721
+
722
+ GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](LICENSE).
723
+
724
+ For commercial licensing (closed-source, proprietary, or hosted use), see [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md) or contact varun.pratap.bhardwaj@gmail.com.
725
+
726
+ Copyright (c) 2026 Varun Pratap Bhardwaj / Qualixar.
727
+
728
+ ## Attribution
729
+
730
+ Part of [Qualixar](https://qualixar.com) · Author: [Varun Pratap Bhardwaj](https://varunpratap.com)
731
+
732
+ ### Acknowledgments
733
+
734
+ - **[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.
735
+ - **[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.
736
+
737
+ ---
738
+
739
+ <p align="center">
740
+ <sub>Built with mathematical rigor. Not in the race — here to help everyone build better AI memory systems.</sub>
741
+ </p>
742
+
743
+ ---
744
+
745
+ ## ⭐ Support This Project
746
+
747
+ 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.
748
+
749
+ [![Star History Chart](https://api.star-history.com/svg?repos=qualixar/superlocalmemory&type=Date)](https://star-history.com/#qualixar/superlocalmemory&Date)
750
+
751
+ ---
752
+
753
+ ## Part of the Qualixar AI Agent Reliability Platform
754
+
755
+ 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:
756
+
757
+ | Product | Purpose | Install | Paper |
758
+ |---------|---------|---------|-------|
759
+ | **[SuperLocalMemory](https://github.com/qualixar/superlocalmemory)** | Persistent memory + learning for AI agents | `npx superlocalmemory` | [arXiv:2604.04514](https://arxiv.org/abs/2604.04514) |
760
+ | **[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) |
761
+ | **[SLM Mesh](https://github.com/qualixar/slm-mesh)** | P2P coordination across AI agent sessions | `npm i slm-mesh` | — |
762
+ | **[SLM MCP Hub](https://github.com/qualixar/slm-mcp-hub)** | Federate 430+ MCP tools through one gateway | `pip install slm-mcp-hub` | — |
763
+ | **[AgentAssay](https://github.com/qualixar/agentassay)** | Token-efficient AI agent testing | `pip install agentassay` | [arXiv:2603.02601](https://arxiv.org/abs/2603.02601) |
764
+ | **[AgentAssert](https://github.com/qualixar/agentassert-abc)** | Behavioral contracts + drift detection | `pip install agentassert-abc` | [arXiv:2602.22302](https://arxiv.org/abs/2602.22302) |
765
+ | **[SkillFortify](https://github.com/qualixar/skillfortify)** | Formal verification for AI agent skills | `pip install skillfortify` | [arXiv:2603.00195](https://arxiv.org/abs/2603.00195) |
766
+
767
+ **Zero cloud dependency. Local-first. EU AI Act compliant.**
768
+
769
+ Start here → **[qualixar.com](https://qualixar.com)** · [All papers on Qualixar HuggingFace](https://huggingface.co/Qualixar)
770
+
771
+ ---