superlocalmemory 2.7.6 → 2.8.1

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 (177) hide show
  1. package/CHANGELOG.md +120 -155
  2. package/README.md +115 -89
  3. package/api_server.py +25 -12
  4. package/bin/slm +20 -0
  5. package/docs/PATTERN-LEARNING.md +64 -199
  6. package/docs/example_graph_usage.py +4 -6
  7. package/install.sh +74 -0
  8. package/mcp_server.py +120 -9
  9. package/package.json +1 -8
  10. package/scripts/generate-thumbnails.py +3 -5
  11. package/skills/slm-build-graph/SKILL.md +1 -1
  12. package/skills/slm-list-recent/SKILL.md +2 -2
  13. package/skills/slm-recall/SKILL.md +1 -1
  14. package/skills/slm-remember/SKILL.md +2 -2
  15. package/skills/slm-show-patterns/SKILL.md +1 -1
  16. package/skills/slm-status/SKILL.md +2 -2
  17. package/skills/slm-switch-profile/SKILL.md +4 -4
  18. package/src/agent_registry.py +7 -18
  19. package/src/auth_middleware.py +3 -5
  20. package/src/auto_backup.py +3 -7
  21. package/src/behavioral/__init__.py +49 -0
  22. package/src/behavioral/behavioral_listener.py +203 -0
  23. package/src/behavioral/behavioral_patterns.py +275 -0
  24. package/src/behavioral/cross_project_transfer.py +206 -0
  25. package/src/behavioral/outcome_inference.py +194 -0
  26. package/src/behavioral/outcome_tracker.py +193 -0
  27. package/src/behavioral/tests/__init__.py +4 -0
  28. package/src/behavioral/tests/test_behavioral_integration.py +108 -0
  29. package/src/behavioral/tests/test_behavioral_patterns.py +150 -0
  30. package/src/behavioral/tests/test_cross_project_transfer.py +142 -0
  31. package/src/behavioral/tests/test_mcp_behavioral.py +139 -0
  32. package/src/behavioral/tests/test_mcp_report_outcome.py +117 -0
  33. package/src/behavioral/tests/test_outcome_inference.py +107 -0
  34. package/src/behavioral/tests/test_outcome_tracker.py +96 -0
  35. package/src/cache_manager.py +4 -6
  36. package/src/compliance/__init__.py +48 -0
  37. package/src/compliance/abac_engine.py +149 -0
  38. package/src/compliance/abac_middleware.py +116 -0
  39. package/src/compliance/audit_db.py +215 -0
  40. package/src/compliance/audit_logger.py +148 -0
  41. package/src/compliance/retention_manager.py +289 -0
  42. package/src/compliance/retention_scheduler.py +186 -0
  43. package/src/compliance/tests/__init__.py +4 -0
  44. package/src/compliance/tests/test_abac_enforcement.py +95 -0
  45. package/src/compliance/tests/test_abac_engine.py +124 -0
  46. package/src/compliance/tests/test_abac_mcp_integration.py +118 -0
  47. package/src/compliance/tests/test_audit_db.py +123 -0
  48. package/src/compliance/tests/test_audit_logger.py +98 -0
  49. package/src/compliance/tests/test_mcp_audit.py +128 -0
  50. package/src/compliance/tests/test_mcp_retention_policy.py +125 -0
  51. package/src/compliance/tests/test_retention_manager.py +131 -0
  52. package/src/compliance/tests/test_retention_scheduler.py +99 -0
  53. package/src/db_connection_manager.py +2 -12
  54. package/src/embedding_engine.py +61 -669
  55. package/src/embeddings/__init__.py +47 -0
  56. package/src/embeddings/cache.py +70 -0
  57. package/src/embeddings/cli.py +113 -0
  58. package/src/embeddings/constants.py +47 -0
  59. package/src/embeddings/database.py +91 -0
  60. package/src/embeddings/engine.py +247 -0
  61. package/src/embeddings/model_loader.py +145 -0
  62. package/src/event_bus.py +3 -13
  63. package/src/graph/__init__.py +36 -0
  64. package/src/graph/build_helpers.py +74 -0
  65. package/src/graph/cli.py +87 -0
  66. package/src/graph/cluster_builder.py +188 -0
  67. package/src/graph/cluster_summary.py +148 -0
  68. package/src/graph/constants.py +47 -0
  69. package/src/graph/edge_builder.py +162 -0
  70. package/src/graph/entity_extractor.py +95 -0
  71. package/src/graph/graph_core.py +226 -0
  72. package/src/graph/graph_search.py +231 -0
  73. package/src/graph/hierarchical.py +207 -0
  74. package/src/graph/schema.py +99 -0
  75. package/src/graph_engine.py +45 -1451
  76. package/src/hnsw_index.py +13 -11
  77. package/src/hybrid_search.py +36 -683
  78. package/src/learning/__init__.py +27 -12
  79. package/src/learning/adaptive_ranker.py +50 -12
  80. package/src/learning/cross_project_aggregator.py +2 -12
  81. package/src/learning/engagement_tracker.py +2 -12
  82. package/src/learning/feature_extractor.py +175 -43
  83. package/src/learning/feedback_collector.py +7 -12
  84. package/src/learning/learning_db.py +180 -12
  85. package/src/learning/project_context_manager.py +2 -12
  86. package/src/learning/source_quality_scorer.py +2 -12
  87. package/src/learning/synthetic_bootstrap.py +2 -12
  88. package/src/learning/tests/__init__.py +2 -0
  89. package/src/learning/tests/test_adaptive_ranker.py +2 -6
  90. package/src/learning/tests/test_adaptive_ranker_v28.py +60 -0
  91. package/src/learning/tests/test_aggregator.py +2 -6
  92. package/src/learning/tests/test_auto_retrain_v28.py +35 -0
  93. package/src/learning/tests/test_e2e_ranking_v28.py +82 -0
  94. package/src/learning/tests/test_feature_extractor_v28.py +93 -0
  95. package/src/learning/tests/test_feedback_collector.py +2 -6
  96. package/src/learning/tests/test_learning_db.py +2 -6
  97. package/src/learning/tests/test_learning_db_v28.py +110 -0
  98. package/src/learning/tests/test_learning_init_v28.py +48 -0
  99. package/src/learning/tests/test_outcome_signals.py +48 -0
  100. package/src/learning/tests/test_project_context.py +2 -6
  101. package/src/learning/tests/test_schema_migration.py +319 -0
  102. package/src/learning/tests/test_signal_inference.py +11 -13
  103. package/src/learning/tests/test_source_quality.py +2 -6
  104. package/src/learning/tests/test_synthetic_bootstrap.py +3 -7
  105. package/src/learning/tests/test_workflow_miner.py +2 -6
  106. package/src/learning/workflow_pattern_miner.py +2 -12
  107. package/src/lifecycle/__init__.py +54 -0
  108. package/src/lifecycle/bounded_growth.py +239 -0
  109. package/src/lifecycle/compaction_engine.py +226 -0
  110. package/src/lifecycle/lifecycle_engine.py +355 -0
  111. package/src/lifecycle/lifecycle_evaluator.py +257 -0
  112. package/src/lifecycle/lifecycle_scheduler.py +130 -0
  113. package/src/lifecycle/retention_policy.py +285 -0
  114. package/src/lifecycle/tests/__init__.py +4 -0
  115. package/src/lifecycle/tests/test_bounded_growth.py +193 -0
  116. package/src/lifecycle/tests/test_compaction.py +179 -0
  117. package/src/lifecycle/tests/test_lifecycle_engine.py +137 -0
  118. package/src/lifecycle/tests/test_lifecycle_evaluation.py +177 -0
  119. package/src/lifecycle/tests/test_lifecycle_scheduler.py +127 -0
  120. package/src/lifecycle/tests/test_lifecycle_search.py +109 -0
  121. package/src/lifecycle/tests/test_mcp_compact.py +149 -0
  122. package/src/lifecycle/tests/test_mcp_lifecycle_status.py +114 -0
  123. package/src/lifecycle/tests/test_retention_policy.py +162 -0
  124. package/src/mcp_tools_v28.py +281 -0
  125. package/src/memory-profiles.py +3 -12
  126. package/src/memory-reset.py +2 -12
  127. package/src/memory_compression.py +2 -12
  128. package/src/memory_store_v2.py +76 -20
  129. package/src/migrate_v1_to_v2.py +2 -12
  130. package/src/pattern_learner.py +29 -975
  131. package/src/patterns/__init__.py +24 -0
  132. package/src/patterns/analyzers.py +247 -0
  133. package/src/patterns/learner.py +267 -0
  134. package/src/patterns/scoring.py +167 -0
  135. package/src/patterns/store.py +223 -0
  136. package/src/patterns/terminology.py +138 -0
  137. package/src/provenance_tracker.py +4 -14
  138. package/src/query_optimizer.py +4 -6
  139. package/src/rate_limiter.py +2 -6
  140. package/src/search/__init__.py +20 -0
  141. package/src/search/cli.py +77 -0
  142. package/src/search/constants.py +26 -0
  143. package/src/search/engine.py +239 -0
  144. package/src/search/fusion.py +122 -0
  145. package/src/search/index_loader.py +112 -0
  146. package/src/search/methods.py +162 -0
  147. package/src/search_engine_v2.py +4 -6
  148. package/src/setup_validator.py +7 -13
  149. package/src/subscription_manager.py +2 -12
  150. package/src/tree/__init__.py +59 -0
  151. package/src/tree/builder.py +183 -0
  152. package/src/tree/nodes.py +196 -0
  153. package/src/tree/queries.py +252 -0
  154. package/src/tree/schema.py +76 -0
  155. package/src/tree_manager.py +10 -711
  156. package/src/trust/__init__.py +45 -0
  157. package/src/trust/constants.py +66 -0
  158. package/src/trust/queries.py +157 -0
  159. package/src/trust/schema.py +95 -0
  160. package/src/trust/scorer.py +299 -0
  161. package/src/trust/signals.py +95 -0
  162. package/src/trust_scorer.py +39 -697
  163. package/src/webhook_dispatcher.py +2 -12
  164. package/ui/app.js +1 -1
  165. package/ui/index.html +152 -4
  166. package/ui/js/agents.js +1 -1
  167. package/ui/js/behavioral.js +276 -0
  168. package/ui/js/compliance.js +252 -0
  169. package/ui/js/init.js +10 -0
  170. package/ui/js/lifecycle.js +298 -0
  171. package/ui/js/profiles.js +4 -0
  172. package/ui_server.py +21 -14
  173. package/ATTRIBUTION.md +0 -140
  174. package/docs/ARCHITECTURE-V2.5.md +0 -190
  175. package/docs/GRAPH-ENGINE.md +0 -503
  176. package/docs/architecture-diagram.drawio +0 -405
  177. package/docs/plans/2026-02-13-benchmark-suite.md +0 -1349
package/README.md CHANGED
@@ -1,21 +1,22 @@
1
1
  <p align="center">
2
- <img src="https://superlocalmemory.com/assets/logo-mark.png" alt="SuperLocalMemory V2" width="200"/>
2
+ <img src="https://superlocalmemory.com/assets/logo-mark.png" alt="SuperLocalMemory" width="200"/>
3
3
  </p>
4
4
 
5
- <h1 align="center">SuperLocalMemory V2</h1>
5
+ <h1 align="center">SuperLocalMemory</h1>
6
6
  <p align="center"><strong>Your AI Finally Remembers You</strong></p>
7
7
 
8
8
  <p align="center">
9
- <strong>⚡ Created & Architected by <a href="https://github.com/varun369">Varun Pratap Bhardwaj</a> ⚡</strong><br/>
10
- <em>Solution Architect • Original Creator • 2026</em>
9
+ <strong>Stop re-explaining your codebase every session. 100% local. Zero setup. Completely free.</strong>
11
10
  </p>
12
11
 
13
12
  <p align="center">
14
- <strong>Stop re-explaining your codebase every session. 100% local. Zero setup. Completely free.</strong>
13
+ <a href="https://superlocalmemory.com"><img src="https://img.shields.io/badge/🌐_Website-superlocalmemory.com-ff6b35?style=for-the-badge" alt="Official Website"/></a>
15
14
  </p>
16
15
 
17
16
  <p align="center">
18
- <a href="https://superlocalmemory.com"><img src="https://img.shields.io/badge/🌐_Website-superlocalmemory.com-ff6b35?style=for-the-badge" alt="Official Website"/></a>
17
+ <a href="https://zenodo.org/records/18709670"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18709670-blue?style=for-the-badge&logo=doi&logoColor=white" alt="DOI"/></a>
18
+ <a href="https://zenodo.org/records/18709670"><img src="https://img.shields.io/badge/Zenodo-Research_Paper-1682D4?style=for-the-badge&logo=zenodo&logoColor=white" alt="Zenodo"/></a>
19
+ <a href="https://www.researchgate.net/publication/400976053"><img src="https://img.shields.io/badge/ResearchGate-Paper-00CCBB?style=for-the-badge&logo=researchgate&logoColor=white" alt="ResearchGate"/></a>
19
20
  </p>
20
21
 
21
22
  <p align="center">
@@ -39,86 +40,114 @@
39
40
  <p align="center">
40
41
  <b>Created by <a href="https://github.com/varun369">Varun Pratap Bhardwaj</a></b> •
41
42
  <a href="https://github.com/sponsors/varun369">💖 Sponsor</a> •
42
- <a href="ATTRIBUTION.md">📜 Attribution Required</a>
43
+ <a href="LICENSE">📜 MIT License</a>
43
44
  </p>
44
45
 
45
46
  ---
46
47
 
47
- ## What's New in v2.7 — "Your AI Learns You"
48
+ ## Research Paper
48
49
 
49
- **SuperLocalMemory now learns your patterns, adapts to your workflow, and personalizes recall — all 100% locally on your machine.** No cloud. No LLM. Your behavioral data never leaves your device.
50
+ **SuperLocalMemory: Privacy-Preserving Multi-Agent Memory with Bayesian Trust Defense Against Memory Poisoning**
50
51
 
51
- ### Adaptive Learning System
52
+ *Varun Pratap Bhardwaj, 2026*
52
53
 
53
- Your memory system evolves with you through three learning layers:
54
+ The paper presents SuperLocalMemory's architecture for defending against OWASP ASI06 memory poisoning through local-first design, Bayesian trust scoring, and adaptive learning-to-rank — all without cloud dependencies or LLM inference calls.
54
55
 
55
- | Layer | What It Learns | How |
56
- |-------|---------------|-----|
57
- | **Tech Preferences** | "You prefer FastAPI over Django" (83% confidence) | Cross-project frequency analysis with Bayesian scoring |
58
- | **Project Context** | Detects your active project from 4 signals | Path analysis, tags, profile, content clustering |
59
- | **Workflow Patterns** | "You typically: docs → architecture → code → test" | Time-weighted sliding-window sequence mining |
56
+ | Platform | Link |
57
+ |----------|------|
58
+ | **Zenodo** (CERN) | [DOI: 10.5281/zenodo.18709670](https://zenodo.org/records/18709670) |
59
+ | **ResearchGate** | [Publication Page](https://www.researchgate.net/publication/400976053) |
60
+ | **arXiv** | Submission under review |
61
+ | **Research Portfolio** | [superlocalmemory.com/research](https://superlocalmemory.com/research) |
60
62
 
61
- ### Three-Phase Adaptive Ranking
63
+ If you use SuperLocalMemory in your research, please cite:
62
64
 
63
- Recall results get smarter over time — automatically:
65
+ ```bibtex
66
+ @misc{bhardwaj2026superlocalmemory,
67
+ title={SuperLocalMemory: Privacy-Preserving Multi-Agent Memory with Bayesian Trust Defense Against Memory Poisoning},
68
+ author={Bhardwaj, Varun Pratap},
69
+ year={2026},
70
+ doi={10.5281/zenodo.18709670},
71
+ url={https://zenodo.org/records/18709670},
72
+ note={Preprint}
73
+ }
74
+ ```
64
75
 
65
- 1. **Phase 1 (Baseline):** Standard search — same as v2.6
66
- 2. **Phase 2 (Rule-Based):** After ~20 feedback signals — boosts results matching your preferences
67
- 3. **Phase 3 (ML Ranking):** After ~200 signals LightGBM LambdaRank re-ranks with 9 personalized features
76
+ ---
77
+
78
+ ## What's New in v2.8"Memory That Manages Itself"
68
79
 
69
- ### Privacy by DesignGDPR Compliant
80
+ **SuperLocalMemory now manages its own memory lifecycle, learns from action outcomes, and provides enterprise-grade compliance all 100% locally on your machine.**
70
81
 
71
- | Concern | SuperLocalMemory v2.7 | Cloud-Based Alternatives |
72
- |---------|----------------------|--------------------------|
73
- | **Where is learning data?** | `~/.claude-memory/learning.db` on YOUR machine | Their servers, their terms |
74
- | **Who processes your behavior?** | Local gradient boosting (no LLM, no GPU) | Cloud LLMs process your data |
75
- | **Right to erasure (GDPR Art. 17)?** | `slm learning reset` one command, instant | Submit a request, wait weeks |
76
- | **Data portability?** | Copy the SQLite file | Vendor lock-in |
77
- | **Telemetry?** | Zero. Absolutely none. | Usage analytics, behavior tracking |
82
+ ### Memory Lifecycle Management (v2.8)
83
+ Memories automatically transition through lifecycle states based on usage patterns:
84
+ - **Active** Frequently used, instantly available
85
+ - **Warm** Recently used, included in searches
86
+ - **Cold**Older, retrievable on demand
87
+ - **Archived** Compressed, restorable when needed
78
88
 
79
- **Your learning data is stored separately from your memories.** Delete `learning.db` and your memories are untouched. Delete `memory.db` and your learning patterns are untouched. Full data sovereignty.
89
+ Configure bounds to keep your memory system fast:
90
+ ```bash
91
+ # Check lifecycle status
92
+ slm lifecycle-status
80
93
 
81
- ### Research-Backed Architecture
94
+ # Compact stale memories
95
+ slm compact --dry-run
96
+ ```
82
97
 
83
- Every component is grounded in peer-reviewed research, adapted for local-first operation:
98
+ ### Behavioral Learning (v2.8)
99
+ The system learns from what works:
100
+ - Report outcomes: `slm report-outcome --memory-ids 1,5 --outcome success`
101
+ - View patterns: `slm behavioral-patterns`
102
+ - Knowledge transfers across projects automatically
84
103
 
85
- | Component | Research Basis |
86
- |-----------|---------------|
87
- | Two-stage retrieval pipeline | BM25 re-ranker (eKNOW 2025) |
88
- | Adaptive cold-start ranking | Hierarchical meta-learning (LREC 2024) |
89
- | Time-weighted sequence mining | TSW-PrefixSpan (IEEE 2020) |
90
- | Bayesian confidence scoring | MACLA (arXiv:2512.18950) |
91
- | LightGBM LambdaRank | Pairwise ranking (Burges 2010, MO-LightGBM SIGIR 2025) |
92
- | Privacy-preserving feedback | Zero-communication design — stronger than differential privacy (ADPMF, IPM 2024) |
104
+ ### Enterprise Compliance (v2.8)
105
+ Built for regulated environments:
106
+ - **Access Control** Attribute-based policies (ABAC)
107
+ - **Audit Trail** Tamper-evident event logging
108
+ - **Retention Policies** GDPR erasure, HIPAA retention, EU AI Act compliance
93
109
 
94
- ### New MCP Tools
110
+ ### New MCP Tools (v2.8)
95
111
 
96
112
  | Tool | Purpose |
97
113
  |------|---------|
98
- | `memory_used` | Tell the AI which recalled memories were useful — trains the ranking model |
99
- | `get_learned_patterns` | See what the system has learned about your preferences |
100
- | `correct_pattern` | Fix a wrong pattern — your correction overrides with maximum confidence |
114
+ | `report_outcome` | Record action outcomes for behavioral learning |
115
+ | `get_lifecycle_status` | View memory lifecycle states |
116
+ | `set_retention_policy` | Configure retention policies |
117
+ | `compact_memories` | Trigger lifecycle transitions |
118
+ | `get_behavioral_patterns` | View learned behavioral patterns |
119
+ | `audit_trail` | Query compliance audit trail |
101
120
 
102
- ### New CLI Commands
121
+ ### Performance
103
122
 
104
- ```bash
105
- slm useful 42 87 # Mark memories as useful (ranking feedback)
106
- slm patterns list # See learned tech preferences
107
- slm learning status # Learning system diagnostics
108
- slm learning reset # Delete all behavioral data (memories preserved)
109
- slm engagement # Local engagement health metrics
110
- ```
123
+ | Operation | Latency |
124
+ |-----------|---------|
125
+ | Lifecycle evaluation | Sub-2ms |
126
+ | Access control check | Sub-1ms |
127
+ | Feature vector (20-dim) | Sub-5ms |
111
128
 
112
- **Upgrade:** `npm install -g superlocalmemory@latest` — Learning dependencies install automatically.
129
+ **Upgrade:** `npm install -g superlocalmemory@latest` — All v2.7 behavior preserved, zero breaking changes.
113
130
 
114
- [Learning System Guide →](https://github.com/varun369/SuperLocalMemoryV2/wiki/Learning-System) | [Upgrade Guide →](https://github.com/varun369/SuperLocalMemoryV2/wiki/Upgrading-to-v2.7) | [Full Changelog](CHANGELOG.md)
131
+ [Upgrading to v2.8](https://github.com/varun369/SuperLocalMemoryV2/wiki/Upgrading-to-v2.8) | [Full Changelog](CHANGELOG.md)
115
132
 
116
133
  ---
117
134
 
135
+ <details>
136
+ <summary><strong>Previous: v2.7 — "Your AI Learns You"</strong></summary>
137
+
138
+ SuperLocalMemory learns your patterns, adapts to your workflow, and personalizes recall — all 100% locally. No cloud. No LLM. Your behavioral data never leaves your device.
139
+
140
+ - **Adaptive Learning** — Learns tech preferences, project context, and workflow patterns
141
+ - **Three-Phase Ranking** — Baseline → Rule-Based → ML Ranking (gets smarter over time)
142
+ - **Privacy by Design** — Learning data stored separately, one-command GDPR erasure
143
+ - **3 New MCP Tools** — Feedback signal, pattern transparency, and user correction
144
+
145
+ </details>
146
+
118
147
  <details>
119
148
  <summary><strong>Previous: v2.6.5 — Interactive Knowledge Graph</strong></summary>
120
149
 
121
- - Fully interactive visualization with zoom, pan, click-to-explore (Cytoscape.js)
150
+ - Fully interactive visualization with zoom, pan, and click-to-explore
122
151
  - 6 layout algorithms, smart cluster filtering, 10,000+ node performance
123
152
  - Mobile & accessibility support: touch gestures, keyboard nav, screen reader
124
153
 
@@ -141,7 +170,7 @@ SuperLocalMemory is now **production-hardened** with security, performance, and
141
170
 
142
171
  **Upgrade:** `npm install -g superlocalmemory@latest`
143
172
 
144
- [Interactive Architecture Diagram](https://superlocalmemory.com/architecture.html) | [Architecture Doc](docs/ARCHITECTURE-V2.5.md) | [Full Changelog](CHANGELOG.md)
173
+ [Interactive Architecture Diagram](https://superlocalmemory.com/architecture.html) | [Architecture Doc](docs/ARCHITECTURE.md) | [Full Changelog](CHANGELOG.md)
145
174
 
146
175
  </details>
147
176
 
@@ -232,22 +261,13 @@ python3 ~/.claude-memory/ui_server.py
232
261
  | Code preferences | "I prefer React..." every time | Pattern learning knows your style |
233
262
  | Multi-project | Context constantly bleeds | Separate profiles per project |
234
263
 
235
- ### Built on 2026 Research
236
-
237
- Not another simple key-value store. SuperLocalMemory implements **cutting-edge memory architecture** backed by peer-reviewed research:
264
+ ### Built on Peer-Reviewed Research
238
265
 
239
- - **PageIndex** (Meta AI) Hierarchical memory organization
240
- - **GraphRAG** (Microsoft) → Knowledge graph with auto-clustering
241
- - **xMemory** (Stanford) → Identity pattern learning
242
- - **A-RAG** → Multi-level retrieval with context awareness
243
- - **LambdaRank** (Burges 2010, MO-LightGBM SIGIR 2025) → Adaptive re-ranking *(v2.7)*
244
- - **TSW-PrefixSpan** (IEEE 2020) → Time-weighted workflow pattern mining *(v2.7)*
245
- - **MACLA** (arXiv:2512.18950) → Bayesian temporal confidence scoring *(v2.7)*
246
- - **FCS** (LREC 2024) → Hierarchical cold-start mitigation *(v2.7)*
266
+ Not another simple key-value store. SuperLocalMemory implements **cutting-edge memory architecture** backed by peer-reviewed research hierarchical organization, knowledge graph clustering, identity pattern learning, multi-level retrieval, adaptive re-ranking, workflow sequence mining, temporal confidence scoring, and cold-start mitigation.
247
267
 
248
- **The only open-source implementation combining all eight approaches — entirely locally.**
268
+ **The only open-source implementation combining all these approaches — entirely locally.**
249
269
 
250
- [See research citations →](https://github.com/varun369/SuperLocalMemoryV2/wiki/Research-Foundations)
270
+ [Read the paper →](https://zenodo.org/records/18709670)
251
271
 
252
272
  ---
253
273
 
@@ -270,52 +290,54 @@ Not another simple key-value store. SuperLocalMemory implements **cutting-edge m
270
290
  │ 17+ IDEs with single database │
271
291
  ├─────────────────────────────────────────────────────────────┤
272
292
  │ Layer 6: MCP INTEGRATION │
273
- │ Model Context Protocol: 12 tools, 6 resources, 2 prompts │
293
+ │ Model Context Protocol: 18 tools, 6 resources, 2 prompts │
274
294
  │ Auto-configured for Cursor, Windsurf, Claude │
275
295
  ├─────────────────────────────────────────────────────────────┤
276
296
  │ Layer 5½: ADAPTIVE LEARNING (v2.7 — NEW) │
277
297
  │ Three-layer learning: tech prefs + project context + flow │
278
- LightGBM LambdaRank re-ranking (fully local, no cloud)
279
- │ Research: eKNOW 2025, MACLA, TSW-PrefixSpan, LREC 2024 │
298
+ Local ML re-ranking no cloud, no telemetry
280
299
  ├─────────────────────────────────────────────────────────────┤
281
300
  │ Layer 5: SKILLS LAYER │
282
301
  │ 7 universal slash-commands for AI assistants │
283
302
  │ Compatible with Claude Code, Continue, Cody │
284
303
  ├─────────────────────────────────────────────────────────────┤
285
- │ Layer 4: PATTERN LEARNING + MACLA
286
- Bayesian confidence scoring (arXiv:2512.18950)
304
+ │ Layer 4: PATTERN LEARNING
305
+ Confidence-scored preference detection
287
306
  │ "You prefer React over Vue" (73% confidence) │
288
307
  ├─────────────────────────────────────────────────────────────┤
289
308
  │ Layer 3: KNOWLEDGE GRAPH + HIERARCHICAL CLUSTERING │
290
- Recursive Leiden algorithm: "Python" → "FastAPI" → "Auth"
291
- │ Community summaries with TF-IDF structured reports
309
+ Auto-clustering: "Python" → "Web API" → "Auth"
310
+ │ Community summaries with auto-generated labels
292
311
  ├─────────────────────────────────────────────────────────────┤
293
312
  │ Layer 2: HIERARCHICAL INDEX │
294
313
  │ Tree structure for fast navigation │
295
314
  │ O(log n) lookups instead of O(n) scans │
296
315
  ├─────────────────────────────────────────────────────────────┤
297
316
  │ Layer 1: RAW STORAGE │
298
- │ SQLite + Full-text search + TF-IDF vectors
317
+ │ SQLite + Full-text search + vector search
299
318
  │ Compression: 60-96% space savings │
300
319
  └─────────────────────────────────────────────────────────────┘
301
320
  ```
302
321
 
303
322
  ### Key Capabilities
304
323
 
305
- - **[Adaptive Learning System](https://github.com/varun369/SuperLocalMemoryV2/wiki/Learning-System)** — Learns your tech preferences, workflow patterns, and project context. Personalizes recall ranking using local ML (LightGBM). Zero cloud dependency. *New in v2.7*
306
- - **[Knowledge Graphs](https://github.com/varun369/SuperLocalMemoryV2/wiki/Knowledge-Graph)** — Automatic relationship discovery. Interactive visualization with zoom, pan, click.
307
- - **[Pattern Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Pattern-Learning)** — Learns your coding preferences and style automatically.
308
- - **[Multi-Profile Support](https://github.com/varun369/SuperLocalMemoryV2/wiki/Using-Memory-Profiles)** — Isolated contexts for work, personal, clients. Zero context bleeding.
324
+ - **[Adaptive Learning System](https://github.com/varun369/SuperLocalMemoryV2/wiki/Learning-System)** — Learns your tech preferences, workflow patterns, and project context. Personalizes recall ranking using local ML. Zero cloud dependency. *New in v2.7*
325
+ - **[Knowledge Graphs](https://github.com/varun369/SuperLocalMemoryV2/wiki/Knowledge-Graph-Guide)** — Automatic relationship discovery. Interactive visualization with zoom, pan, click.
326
+ - **[Pattern Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Pattern-Learning-Explained)** — Learns your coding preferences and style automatically.
327
+ - **[Multi-Profile Support](https://github.com/varun369/SuperLocalMemoryV2/wiki/Multi-Profile-Workflows)** — Isolated contexts for work, personal, clients. Zero context bleeding.
309
328
  - **[Hybrid Search](https://github.com/varun369/SuperLocalMemoryV2/wiki/Advanced-Search)** — Semantic + FTS5 + Graph retrieval combined for maximum accuracy.
310
329
  - **[Visualization Dashboard](https://github.com/varun369/SuperLocalMemoryV2/wiki/Visualization-Dashboard)** — Web UI for timeline, search, graph exploration, analytics.
311
330
  - **[Framework Integrations](docs/FRAMEWORK-INTEGRATIONS.md)** — Use with LangChain and LlamaIndex applications.
312
331
  - **[Real-Time Events](https://github.com/varun369/SuperLocalMemoryV2/wiki/Real-Time-Event-System)** — Live notifications via SSE/WebSocket/Webhooks when memories change.
332
+ - **[Memory Lifecycle](https://github.com/varun369/SuperLocalMemoryV2/wiki/Memory-Lifecycle)** — Automatic state transitions (Active → Warm → Cold → Archived) with bounded growth guarantees. *New in v2.8*
333
+ - **[Behavioral Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Behavioral-Learning)** — Learns from action outcomes, extracts success/failure patterns, transfers knowledge across projects. *New in v2.8*
334
+ - **[Enterprise Compliance](https://github.com/varun369/SuperLocalMemoryV2/wiki/Enterprise-Compliance)** — ABAC access control, tamper-evident audit trail, GDPR/HIPAA/EU AI Act retention policies. *New in v2.8*
313
335
 
314
336
  ---
315
337
 
316
338
  ## 🌐 Works Everywhere
317
339
 
318
- **SuperLocalMemory V2 is the ONLY memory system that works across ALL your tools:**
340
+ **SuperLocalMemory is the ONLY memory system that works across ALL your tools:**
319
341
 
320
342
  ### Supported IDEs & Tools
321
343
 
@@ -340,7 +362,7 @@ Not another simple key-value store. SuperLocalMemory implements **cutting-edge m
340
362
  1. **MCP (Model Context Protocol)** — Auto-configured for Cursor, Windsurf, Claude Desktop
341
363
  - AI assistants get natural access to your memory
342
364
  - No manual commands needed
343
- - "Remember that we use FastAPI" just works
365
+ - "Remember that we use this framework" just works
344
366
 
345
367
  2. **Skills & Commands** — For Claude Code, Continue.dev, Cody
346
368
  - `/superlocalmemoryv2:remember` in Claude Code
@@ -369,11 +391,11 @@ Not another simple key-value store. SuperLocalMemory implements **cutting-edge m
369
391
  | **Supermemory** | 1M tokens, 10K queries | $19-399/mo | Not local, no graphs |
370
392
  | **Personal.AI** | ❌ No free tier | $33/month | Cloud-only, closed ecosystem |
371
393
  | **Letta/MemGPT** | Self-hosted (complex) | TBD | Requires significant setup |
372
- | **SuperLocalMemory V2** | **Unlimited** | **$0 forever** | **Nothing.** |
394
+ | **SuperLocalMemory** | **Unlimited** | **$0 forever** | **Nothing.** |
373
395
 
374
396
  ### What Actually Matters
375
397
 
376
- | Feature | Mem0 | Zep | Khoj | Letta | **SuperLocalMemory V2** |
398
+ | Feature | Mem0 | Zep | Khoj | Letta | **SuperLocalMemory** |
377
399
  |---------|------|-----|------|-------|------------------------|
378
400
  | **Works in Cursor** | Cloud Only | ❌ | ❌ | ❌ | ✅ **Local** |
379
401
  | **Works in Windsurf** | Cloud Only | ❌ | ❌ | ❌ | ✅ **Local** |
@@ -388,7 +410,7 @@ Not another simple key-value store. SuperLocalMemory implements **cutting-edge m
388
410
  | **Zero Setup** | ❌ | ❌ | ❌ | ❌ | ✅ |
389
411
  | **Completely Free** | Limited | Limited | Partial | ✅ | ✅ |
390
412
 
391
- **SuperLocalMemory V2 is the ONLY solution that:**
413
+ **SuperLocalMemory is the ONLY solution that:**
392
414
  - ✅ **Learns and adapts** locally — no cloud LLM needed for personalization
393
415
  - ✅ Works across 17+ IDEs and CLI tools
394
416
  - ✅ Remains 100% local (no cloud dependencies)
@@ -421,7 +443,7 @@ For typical personal use (under 500 memories), search results return faster than
421
443
  | 2 AI tools simultaneously | **220/sec** | 0 |
422
444
  | 5 AI tools simultaneously | **130/sec** | 0 |
423
445
 
424
- WAL mode + serialized write queue = zero "database is locked" errors, ever.
446
+ Concurrent-safe architecture = zero "database is locked" errors, ever.
425
447
 
426
448
  ### Storage
427
449
 
@@ -434,7 +456,7 @@ WAL mode + serialized write queue = zero "database is locked" errors, ever.
434
456
  | 100 | 0.28s |
435
457
  | 1,000 | 10.6s |
436
458
 
437
- Leiden clustering discovers 6-7 natural topic communities automatically.
459
+ Auto-clustering discovers 6-7 natural topic communities from your memories.
438
460
 
439
461
  [Full benchmark details →](https://github.com/varun369/SuperLocalMemoryV2/wiki/Performance-Benchmarks)
440
462
 
@@ -479,8 +501,12 @@ python ~/.claude-memory/ui_server.py # Launch web UI
479
501
  | [Visualization Dashboard](https://github.com/varun369/SuperLocalMemoryV2/wiki/Visualization-Dashboard) | Interactive web UI guide |
480
502
  | [Interactive Graph](https://github.com/varun369/SuperLocalMemoryV2/wiki/Using-Interactive-Graph) | Graph exploration guide (NEW v2.6.5) |
481
503
  | [Framework Integrations](docs/FRAMEWORK-INTEGRATIONS.md) | LangChain & LlamaIndex setup |
482
- | [Knowledge Graph](docs/GRAPH-ENGINE.md) | How clustering works |
504
+ | [Knowledge Graph](https://github.com/varun369/SuperLocalMemoryV2/wiki/Knowledge-Graph-Guide) | How clustering works |
483
505
  | [Pattern Learning](docs/PATTERN-LEARNING.md) | Identity extraction |
506
+ | [Memory Lifecycle](https://github.com/varun369/SuperLocalMemoryV2/wiki/Memory-Lifecycle) | Lifecycle states, compaction, bounded growth (v2.8) |
507
+ | [Behavioral Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Behavioral-Learning) | Action outcomes, pattern extraction (v2.8) |
508
+ | [Enterprise Compliance](https://github.com/varun369/SuperLocalMemoryV2/wiki/Enterprise-Compliance) | ABAC, audit trail, retention policies (v2.8) |
509
+ | [Upgrading to v2.8](https://github.com/varun369/SuperLocalMemoryV2/wiki/Upgrading-to-v2.8) | Migration guide from v2.7 |
484
510
  | [API Reference](docs/API-REFERENCE.md) | Python API documentation |
485
511
 
486
512
  ---
package/api_server.py CHANGED
@@ -1,16 +1,6 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - Intelligent Local Memory System
4
- Copyright (c) 2026 Varun Pratap Bhardwaj
5
- Licensed under MIT License
6
-
7
- Repository: https://github.com/varun369/SuperLocalMemoryV2
8
- Author: Varun Pratap Bhardwaj (Solution Architect)
9
-
10
- NOTICE: This software is protected by MIT License.
11
- Attribution must be preserved in all copies or derivatives.
12
- """
13
-
2
+ # SPDX-License-Identifier: MIT
3
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
14
4
  """
15
5
  SuperLocalMemory V2 - FastAPI UI Server
16
6
  Provides REST endpoints for memory visualization and exploration.
@@ -681,6 +671,29 @@ async def get_tree():
681
671
  }
682
672
 
683
673
 
674
+ # ============================================================================
675
+ # v2.8 Routes (graceful — don't fail if engines unavailable)
676
+ # ============================================================================
677
+
678
+ try:
679
+ from routes.lifecycle import router as lifecycle_router
680
+ app.include_router(lifecycle_router)
681
+ except ImportError:
682
+ pass
683
+
684
+ try:
685
+ from routes.behavioral import router as behavioral_router
686
+ app.include_router(behavioral_router)
687
+ except ImportError:
688
+ pass
689
+
690
+ try:
691
+ from routes.compliance import router as compliance_router
692
+ app.include_router(compliance_router)
693
+ except ImportError:
694
+ pass
695
+
696
+
684
697
  # ============================================================================
685
698
  # Server Startup
686
699
  # ============================================================================
package/bin/slm CHANGED
@@ -55,6 +55,23 @@ case "$1" in
55
55
  "$SLM_DIR/bin/superlocalmemoryv2:profile" "$@"
56
56
  ;;
57
57
 
58
+ switch-profile)
59
+ shift
60
+ # Convenience alias: "slm switch-profile <name>" -> "slm profile switch <name>"
61
+ "$SLM_DIR/bin/superlocalmemoryv2:profile" switch "$@"
62
+ ;;
63
+
64
+ list-profiles)
65
+ # Convenience alias: "slm list-profiles" -> "slm profile list"
66
+ "$SLM_DIR/bin/superlocalmemoryv2:profile" list
67
+ ;;
68
+
69
+ create-profile)
70
+ shift
71
+ # Convenience alias: "slm create-profile <name>" -> "slm profile create <name>"
72
+ "$SLM_DIR/bin/superlocalmemoryv2:profile" create "$@"
73
+ ;;
74
+
58
75
  reset)
59
76
  shift
60
77
  # Calls existing command - no duplicate logic
@@ -310,6 +327,9 @@ PROFILE MANAGEMENT:
310
327
  slm profile switch <name> Switch to profile
311
328
  slm profile delete <name> Delete profile
312
329
  slm profile current Show current profile
330
+ slm switch-profile <name> Shortcut for profile switch
331
+ slm list-profiles Shortcut for profile list
332
+ slm create-profile <name> Shortcut for profile create
313
333
 
314
334
  KNOWLEDGE GRAPH:
315
335
  slm graph build Build/rebuild knowledge graph