superlocalmemory 2.8.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/LICENSE +9 -1
  2. package/NOTICE +63 -0
  3. package/README.md +165 -480
  4. package/bin/slm +17 -449
  5. package/bin/slm-npm +1 -1
  6. package/conftest.py +5 -0
  7. package/docs/api-reference.md +284 -0
  8. package/docs/architecture.md +149 -0
  9. package/docs/auto-memory.md +150 -0
  10. package/docs/cli-reference.md +276 -0
  11. package/docs/compliance.md +191 -0
  12. package/docs/configuration.md +182 -0
  13. package/docs/getting-started.md +102 -0
  14. package/docs/ide-setup.md +261 -0
  15. package/docs/mcp-tools.md +220 -0
  16. package/docs/migration-from-v2.md +170 -0
  17. package/docs/profiles.md +173 -0
  18. package/docs/troubleshooting.md +310 -0
  19. package/{configs → ide/configs}/antigravity-mcp.json +3 -3
  20. package/ide/configs/chatgpt-desktop-mcp.json +16 -0
  21. package/{configs → ide/configs}/claude-desktop-mcp.json +3 -3
  22. package/{configs → ide/configs}/codex-mcp.toml +4 -4
  23. package/{configs → ide/configs}/continue-mcp.yaml +4 -3
  24. package/{configs → ide/configs}/continue-skills.yaml +6 -6
  25. package/ide/configs/cursor-mcp.json +15 -0
  26. package/{configs → ide/configs}/gemini-cli-mcp.json +2 -2
  27. package/{configs → ide/configs}/jetbrains-mcp.json +2 -2
  28. package/{configs → ide/configs}/opencode-mcp.json +2 -2
  29. package/{configs → ide/configs}/perplexity-mcp.json +2 -2
  30. package/{configs → ide/configs}/vscode-copilot-mcp.json +2 -2
  31. package/{configs → ide/configs}/windsurf-mcp.json +3 -3
  32. package/{configs → ide/configs}/zed-mcp.json +2 -2
  33. package/{hooks → ide/hooks}/context-hook.js +9 -20
  34. package/ide/hooks/memory-list-skill.js +70 -0
  35. package/ide/hooks/memory-profile-skill.js +101 -0
  36. package/ide/hooks/memory-recall-skill.js +62 -0
  37. package/ide/hooks/memory-remember-skill.js +68 -0
  38. package/ide/hooks/memory-reset-skill.js +160 -0
  39. package/{hooks → ide/hooks}/post-recall-hook.js +2 -2
  40. package/ide/integrations/langchain/README.md +106 -0
  41. package/ide/integrations/langchain/langchain_superlocalmemory/__init__.py +9 -0
  42. package/ide/integrations/langchain/langchain_superlocalmemory/chat_message_history.py +201 -0
  43. package/ide/integrations/langchain/pyproject.toml +38 -0
  44. package/{src/learning → ide/integrations/langchain}/tests/__init__.py +1 -0
  45. package/ide/integrations/langchain/tests/test_chat_message_history.py +215 -0
  46. package/ide/integrations/langchain/tests/test_security.py +117 -0
  47. package/ide/integrations/llamaindex/README.md +81 -0
  48. package/ide/integrations/llamaindex/llama_index/storage/chat_store/superlocalmemory/__init__.py +9 -0
  49. package/ide/integrations/llamaindex/llama_index/storage/chat_store/superlocalmemory/base.py +316 -0
  50. package/ide/integrations/llamaindex/pyproject.toml +43 -0
  51. package/{src/lifecycle → ide/integrations/llamaindex}/tests/__init__.py +1 -2
  52. package/ide/integrations/llamaindex/tests/test_chat_store.py +294 -0
  53. package/ide/integrations/llamaindex/tests/test_security.py +241 -0
  54. package/{skills → ide/skills}/slm-build-graph/SKILL.md +6 -6
  55. package/{skills → ide/skills}/slm-list-recent/SKILL.md +5 -5
  56. package/{skills → ide/skills}/slm-recall/SKILL.md +5 -5
  57. package/{skills → ide/skills}/slm-remember/SKILL.md +6 -6
  58. package/{skills → ide/skills}/slm-show-patterns/SKILL.md +7 -7
  59. package/{skills → ide/skills}/slm-status/SKILL.md +9 -9
  60. package/{skills → ide/skills}/slm-switch-profile/SKILL.md +9 -9
  61. package/package.json +13 -22
  62. package/pyproject.toml +85 -0
  63. package/scripts/build-dmg.sh +417 -0
  64. package/scripts/install-skills.ps1 +334 -0
  65. package/scripts/postinstall.js +2 -2
  66. package/scripts/start-dashboard.ps1 +52 -0
  67. package/scripts/start-dashboard.sh +41 -0
  68. package/scripts/sync-wiki.ps1 +127 -0
  69. package/scripts/sync-wiki.sh +82 -0
  70. package/scripts/test-dmg.sh +161 -0
  71. package/scripts/test-npm-package.ps1 +252 -0
  72. package/scripts/test-npm-package.sh +207 -0
  73. package/scripts/verify-install.ps1 +294 -0
  74. package/scripts/verify-install.sh +266 -0
  75. package/src/superlocalmemory/__init__.py +0 -0
  76. package/src/superlocalmemory/attribution/__init__.py +9 -0
  77. package/src/superlocalmemory/attribution/mathematical_dna.py +235 -0
  78. package/src/superlocalmemory/attribution/signer.py +153 -0
  79. package/src/superlocalmemory/attribution/watermark.py +189 -0
  80. package/src/superlocalmemory/cli/__init__.py +5 -0
  81. package/src/superlocalmemory/cli/commands.py +245 -0
  82. package/src/superlocalmemory/cli/main.py +89 -0
  83. package/src/superlocalmemory/cli/migrate_cmd.py +55 -0
  84. package/src/superlocalmemory/cli/post_install.py +99 -0
  85. package/src/superlocalmemory/cli/setup_wizard.py +129 -0
  86. package/src/superlocalmemory/compliance/__init__.py +0 -0
  87. package/src/superlocalmemory/compliance/abac.py +204 -0
  88. package/src/superlocalmemory/compliance/audit.py +314 -0
  89. package/src/superlocalmemory/compliance/eu_ai_act.py +131 -0
  90. package/src/superlocalmemory/compliance/gdpr.py +294 -0
  91. package/src/superlocalmemory/compliance/lifecycle.py +158 -0
  92. package/src/superlocalmemory/compliance/retention.py +232 -0
  93. package/src/superlocalmemory/compliance/scheduler.py +148 -0
  94. package/src/superlocalmemory/core/__init__.py +0 -0
  95. package/src/superlocalmemory/core/config.py +391 -0
  96. package/src/superlocalmemory/core/embeddings.py +293 -0
  97. package/src/superlocalmemory/core/engine.py +701 -0
  98. package/src/superlocalmemory/core/hooks.py +65 -0
  99. package/src/superlocalmemory/core/maintenance.py +172 -0
  100. package/src/superlocalmemory/core/modes.py +140 -0
  101. package/src/superlocalmemory/core/profiles.py +234 -0
  102. package/src/superlocalmemory/core/registry.py +117 -0
  103. package/src/superlocalmemory/dynamics/__init__.py +0 -0
  104. package/src/superlocalmemory/dynamics/fisher_langevin_coupling.py +223 -0
  105. package/src/superlocalmemory/encoding/__init__.py +0 -0
  106. package/src/superlocalmemory/encoding/consolidator.py +485 -0
  107. package/src/superlocalmemory/encoding/emotional.py +125 -0
  108. package/src/superlocalmemory/encoding/entity_resolver.py +525 -0
  109. package/src/superlocalmemory/encoding/entropy_gate.py +104 -0
  110. package/src/superlocalmemory/encoding/fact_extractor.py +775 -0
  111. package/src/superlocalmemory/encoding/foresight.py +91 -0
  112. package/src/superlocalmemory/encoding/graph_builder.py +302 -0
  113. package/src/superlocalmemory/encoding/observation_builder.py +160 -0
  114. package/src/superlocalmemory/encoding/scene_builder.py +183 -0
  115. package/src/superlocalmemory/encoding/signal_inference.py +90 -0
  116. package/src/superlocalmemory/encoding/temporal_parser.py +426 -0
  117. package/src/superlocalmemory/encoding/type_router.py +235 -0
  118. package/src/superlocalmemory/hooks/__init__.py +3 -0
  119. package/src/superlocalmemory/hooks/auto_capture.py +111 -0
  120. package/src/superlocalmemory/hooks/auto_recall.py +93 -0
  121. package/src/superlocalmemory/hooks/ide_connector.py +204 -0
  122. package/src/superlocalmemory/hooks/rules_engine.py +99 -0
  123. package/src/superlocalmemory/infra/__init__.py +3 -0
  124. package/src/superlocalmemory/infra/auth_middleware.py +82 -0
  125. package/src/superlocalmemory/infra/backup.py +317 -0
  126. package/src/superlocalmemory/infra/cache_manager.py +267 -0
  127. package/src/superlocalmemory/infra/event_bus.py +381 -0
  128. package/src/superlocalmemory/infra/rate_limiter.py +135 -0
  129. package/src/{webhook_dispatcher.py → superlocalmemory/infra/webhook_dispatcher.py} +104 -101
  130. package/src/superlocalmemory/learning/__init__.py +0 -0
  131. package/src/superlocalmemory/learning/adaptive.py +172 -0
  132. package/src/superlocalmemory/learning/behavioral.py +490 -0
  133. package/src/superlocalmemory/learning/behavioral_listener.py +94 -0
  134. package/src/superlocalmemory/learning/bootstrap.py +298 -0
  135. package/src/superlocalmemory/learning/cross_project.py +399 -0
  136. package/src/superlocalmemory/learning/database.py +376 -0
  137. package/src/superlocalmemory/learning/engagement.py +323 -0
  138. package/src/superlocalmemory/learning/features.py +138 -0
  139. package/src/superlocalmemory/learning/feedback.py +316 -0
  140. package/src/superlocalmemory/learning/outcomes.py +255 -0
  141. package/src/superlocalmemory/learning/project_context.py +366 -0
  142. package/src/superlocalmemory/learning/ranker.py +155 -0
  143. package/src/superlocalmemory/learning/source_quality.py +303 -0
  144. package/src/superlocalmemory/learning/workflows.py +309 -0
  145. package/src/superlocalmemory/llm/__init__.py +0 -0
  146. package/src/superlocalmemory/llm/backbone.py +316 -0
  147. package/src/superlocalmemory/math/__init__.py +0 -0
  148. package/src/superlocalmemory/math/fisher.py +356 -0
  149. package/src/superlocalmemory/math/langevin.py +398 -0
  150. package/src/superlocalmemory/math/sheaf.py +257 -0
  151. package/src/superlocalmemory/mcp/__init__.py +0 -0
  152. package/src/superlocalmemory/mcp/resources.py +245 -0
  153. package/src/superlocalmemory/mcp/server.py +61 -0
  154. package/src/superlocalmemory/mcp/tools.py +18 -0
  155. package/src/superlocalmemory/mcp/tools_core.py +305 -0
  156. package/src/superlocalmemory/mcp/tools_v28.py +223 -0
  157. package/src/superlocalmemory/mcp/tools_v3.py +286 -0
  158. package/src/superlocalmemory/retrieval/__init__.py +0 -0
  159. package/src/superlocalmemory/retrieval/agentic.py +295 -0
  160. package/src/superlocalmemory/retrieval/ann_index.py +223 -0
  161. package/src/superlocalmemory/retrieval/bm25_channel.py +185 -0
  162. package/src/superlocalmemory/retrieval/bridge_discovery.py +170 -0
  163. package/src/superlocalmemory/retrieval/engine.py +390 -0
  164. package/src/superlocalmemory/retrieval/entity_channel.py +179 -0
  165. package/src/superlocalmemory/retrieval/fusion.py +78 -0
  166. package/src/superlocalmemory/retrieval/profile_channel.py +105 -0
  167. package/src/superlocalmemory/retrieval/reranker.py +154 -0
  168. package/src/superlocalmemory/retrieval/semantic_channel.py +232 -0
  169. package/src/superlocalmemory/retrieval/strategy.py +96 -0
  170. package/src/superlocalmemory/retrieval/temporal_channel.py +175 -0
  171. package/src/superlocalmemory/server/__init__.py +1 -0
  172. package/src/superlocalmemory/server/api.py +248 -0
  173. package/src/superlocalmemory/server/routes/__init__.py +4 -0
  174. package/src/superlocalmemory/server/routes/agents.py +107 -0
  175. package/src/superlocalmemory/server/routes/backup.py +91 -0
  176. package/src/superlocalmemory/server/routes/behavioral.py +127 -0
  177. package/src/superlocalmemory/server/routes/compliance.py +160 -0
  178. package/src/superlocalmemory/server/routes/data_io.py +188 -0
  179. package/src/superlocalmemory/server/routes/events.py +183 -0
  180. package/src/superlocalmemory/server/routes/helpers.py +85 -0
  181. package/src/superlocalmemory/server/routes/learning.py +273 -0
  182. package/src/superlocalmemory/server/routes/lifecycle.py +116 -0
  183. package/src/superlocalmemory/server/routes/memories.py +399 -0
  184. package/src/superlocalmemory/server/routes/profiles.py +219 -0
  185. package/src/superlocalmemory/server/routes/stats.py +346 -0
  186. package/src/superlocalmemory/server/routes/v3_api.py +365 -0
  187. package/src/superlocalmemory/server/routes/ws.py +82 -0
  188. package/src/superlocalmemory/server/security_middleware.py +57 -0
  189. package/src/superlocalmemory/server/ui.py +245 -0
  190. package/src/superlocalmemory/storage/__init__.py +0 -0
  191. package/src/superlocalmemory/storage/access_control.py +182 -0
  192. package/src/superlocalmemory/storage/database.py +594 -0
  193. package/src/superlocalmemory/storage/migrations.py +303 -0
  194. package/src/superlocalmemory/storage/models.py +406 -0
  195. package/src/superlocalmemory/storage/schema.py +726 -0
  196. package/src/superlocalmemory/storage/v2_migrator.py +317 -0
  197. package/src/superlocalmemory/trust/__init__.py +0 -0
  198. package/src/superlocalmemory/trust/gate.py +130 -0
  199. package/src/superlocalmemory/trust/provenance.py +124 -0
  200. package/src/superlocalmemory/trust/scorer.py +347 -0
  201. package/src/superlocalmemory/trust/signals.py +153 -0
  202. package/ui/index.html +278 -5
  203. package/ui/js/auto-settings.js +70 -0
  204. package/ui/js/dashboard.js +90 -0
  205. package/ui/js/fact-detail.js +92 -0
  206. package/ui/js/feedback.js +2 -2
  207. package/ui/js/ide-status.js +102 -0
  208. package/ui/js/math-health.js +98 -0
  209. package/ui/js/recall-lab.js +127 -0
  210. package/ui/js/settings.js +2 -2
  211. package/ui/js/trust-dashboard.js +73 -0
  212. package/api_server.py +0 -724
  213. package/bin/aider-smart +0 -72
  214. package/bin/superlocalmemoryv2-learning +0 -4
  215. package/bin/superlocalmemoryv2-list +0 -3
  216. package/bin/superlocalmemoryv2-patterns +0 -4
  217. package/bin/superlocalmemoryv2-profile +0 -3
  218. package/bin/superlocalmemoryv2-recall +0 -3
  219. package/bin/superlocalmemoryv2-remember +0 -3
  220. package/bin/superlocalmemoryv2-reset +0 -3
  221. package/bin/superlocalmemoryv2-status +0 -3
  222. package/configs/chatgpt-desktop-mcp.json +0 -16
  223. package/configs/cursor-mcp.json +0 -15
  224. package/hooks/memory-list-skill.js +0 -139
  225. package/hooks/memory-profile-skill.js +0 -273
  226. package/hooks/memory-recall-skill.js +0 -114
  227. package/hooks/memory-remember-skill.js +0 -127
  228. package/hooks/memory-reset-skill.js +0 -274
  229. package/mcp_server.py +0 -1808
  230. package/requirements-core.txt +0 -22
  231. package/requirements-learning.txt +0 -12
  232. package/requirements.txt +0 -12
  233. package/src/agent_registry.py +0 -411
  234. package/src/auth_middleware.py +0 -61
  235. package/src/auto_backup.py +0 -459
  236. package/src/behavioral/__init__.py +0 -49
  237. package/src/behavioral/behavioral_listener.py +0 -203
  238. package/src/behavioral/behavioral_patterns.py +0 -275
  239. package/src/behavioral/cross_project_transfer.py +0 -206
  240. package/src/behavioral/outcome_inference.py +0 -194
  241. package/src/behavioral/outcome_tracker.py +0 -193
  242. package/src/behavioral/tests/__init__.py +0 -4
  243. package/src/behavioral/tests/test_behavioral_integration.py +0 -108
  244. package/src/behavioral/tests/test_behavioral_patterns.py +0 -150
  245. package/src/behavioral/tests/test_cross_project_transfer.py +0 -142
  246. package/src/behavioral/tests/test_mcp_behavioral.py +0 -139
  247. package/src/behavioral/tests/test_mcp_report_outcome.py +0 -117
  248. package/src/behavioral/tests/test_outcome_inference.py +0 -107
  249. package/src/behavioral/tests/test_outcome_tracker.py +0 -96
  250. package/src/cache_manager.py +0 -518
  251. package/src/compliance/__init__.py +0 -48
  252. package/src/compliance/abac_engine.py +0 -149
  253. package/src/compliance/abac_middleware.py +0 -116
  254. package/src/compliance/audit_db.py +0 -215
  255. package/src/compliance/audit_logger.py +0 -148
  256. package/src/compliance/retention_manager.py +0 -289
  257. package/src/compliance/retention_scheduler.py +0 -186
  258. package/src/compliance/tests/__init__.py +0 -4
  259. package/src/compliance/tests/test_abac_enforcement.py +0 -95
  260. package/src/compliance/tests/test_abac_engine.py +0 -124
  261. package/src/compliance/tests/test_abac_mcp_integration.py +0 -118
  262. package/src/compliance/tests/test_audit_db.py +0 -123
  263. package/src/compliance/tests/test_audit_logger.py +0 -98
  264. package/src/compliance/tests/test_mcp_audit.py +0 -128
  265. package/src/compliance/tests/test_mcp_retention_policy.py +0 -125
  266. package/src/compliance/tests/test_retention_manager.py +0 -131
  267. package/src/compliance/tests/test_retention_scheduler.py +0 -99
  268. package/src/compression/__init__.py +0 -25
  269. package/src/compression/cli.py +0 -150
  270. package/src/compression/cold_storage.py +0 -217
  271. package/src/compression/config.py +0 -72
  272. package/src/compression/orchestrator.py +0 -133
  273. package/src/compression/tier2_compressor.py +0 -228
  274. package/src/compression/tier3_compressor.py +0 -153
  275. package/src/compression/tier_classifier.py +0 -148
  276. package/src/db_connection_manager.py +0 -536
  277. package/src/embedding_engine.py +0 -63
  278. package/src/embeddings/__init__.py +0 -47
  279. package/src/embeddings/cache.py +0 -70
  280. package/src/embeddings/cli.py +0 -113
  281. package/src/embeddings/constants.py +0 -47
  282. package/src/embeddings/database.py +0 -91
  283. package/src/embeddings/engine.py +0 -247
  284. package/src/embeddings/model_loader.py +0 -145
  285. package/src/event_bus.py +0 -562
  286. package/src/graph/__init__.py +0 -36
  287. package/src/graph/build_helpers.py +0 -74
  288. package/src/graph/cli.py +0 -87
  289. package/src/graph/cluster_builder.py +0 -188
  290. package/src/graph/cluster_summary.py +0 -148
  291. package/src/graph/constants.py +0 -47
  292. package/src/graph/edge_builder.py +0 -162
  293. package/src/graph/entity_extractor.py +0 -95
  294. package/src/graph/graph_core.py +0 -226
  295. package/src/graph/graph_search.py +0 -231
  296. package/src/graph/hierarchical.py +0 -207
  297. package/src/graph/schema.py +0 -99
  298. package/src/graph_engine.py +0 -52
  299. package/src/hnsw_index.py +0 -628
  300. package/src/hybrid_search.py +0 -46
  301. package/src/learning/__init__.py +0 -217
  302. package/src/learning/adaptive_ranker.py +0 -682
  303. package/src/learning/bootstrap/__init__.py +0 -69
  304. package/src/learning/bootstrap/constants.py +0 -93
  305. package/src/learning/bootstrap/db_queries.py +0 -316
  306. package/src/learning/bootstrap/sampling.py +0 -82
  307. package/src/learning/bootstrap/text_utils.py +0 -71
  308. package/src/learning/cross_project_aggregator.py +0 -857
  309. package/src/learning/db/__init__.py +0 -40
  310. package/src/learning/db/constants.py +0 -44
  311. package/src/learning/db/schema.py +0 -279
  312. package/src/learning/engagement_tracker.py +0 -628
  313. package/src/learning/feature_extractor.py +0 -708
  314. package/src/learning/feedback_collector.py +0 -806
  315. package/src/learning/learning_db.py +0 -915
  316. package/src/learning/project_context_manager.py +0 -572
  317. package/src/learning/ranking/__init__.py +0 -33
  318. package/src/learning/ranking/constants.py +0 -84
  319. package/src/learning/ranking/helpers.py +0 -278
  320. package/src/learning/source_quality_scorer.py +0 -676
  321. package/src/learning/synthetic_bootstrap.py +0 -755
  322. package/src/learning/tests/test_adaptive_ranker.py +0 -325
  323. package/src/learning/tests/test_adaptive_ranker_v28.py +0 -60
  324. package/src/learning/tests/test_aggregator.py +0 -306
  325. package/src/learning/tests/test_auto_retrain_v28.py +0 -35
  326. package/src/learning/tests/test_e2e_ranking_v28.py +0 -82
  327. package/src/learning/tests/test_feature_extractor_v28.py +0 -93
  328. package/src/learning/tests/test_feedback_collector.py +0 -294
  329. package/src/learning/tests/test_learning_db.py +0 -602
  330. package/src/learning/tests/test_learning_db_v28.py +0 -110
  331. package/src/learning/tests/test_learning_init_v28.py +0 -48
  332. package/src/learning/tests/test_outcome_signals.py +0 -48
  333. package/src/learning/tests/test_project_context.py +0 -292
  334. package/src/learning/tests/test_schema_migration.py +0 -319
  335. package/src/learning/tests/test_signal_inference.py +0 -397
  336. package/src/learning/tests/test_source_quality.py +0 -351
  337. package/src/learning/tests/test_synthetic_bootstrap.py +0 -429
  338. package/src/learning/tests/test_workflow_miner.py +0 -318
  339. package/src/learning/workflow_pattern_miner.py +0 -655
  340. package/src/lifecycle/__init__.py +0 -54
  341. package/src/lifecycle/bounded_growth.py +0 -239
  342. package/src/lifecycle/compaction_engine.py +0 -226
  343. package/src/lifecycle/lifecycle_engine.py +0 -355
  344. package/src/lifecycle/lifecycle_evaluator.py +0 -257
  345. package/src/lifecycle/lifecycle_scheduler.py +0 -130
  346. package/src/lifecycle/retention_policy.py +0 -285
  347. package/src/lifecycle/tests/test_bounded_growth.py +0 -193
  348. package/src/lifecycle/tests/test_compaction.py +0 -179
  349. package/src/lifecycle/tests/test_lifecycle_engine.py +0 -137
  350. package/src/lifecycle/tests/test_lifecycle_evaluation.py +0 -177
  351. package/src/lifecycle/tests/test_lifecycle_scheduler.py +0 -127
  352. package/src/lifecycle/tests/test_lifecycle_search.py +0 -109
  353. package/src/lifecycle/tests/test_mcp_compact.py +0 -149
  354. package/src/lifecycle/tests/test_mcp_lifecycle_status.py +0 -114
  355. package/src/lifecycle/tests/test_retention_policy.py +0 -162
  356. package/src/mcp_tools_v28.py +0 -281
  357. package/src/memory/__init__.py +0 -36
  358. package/src/memory/cli.py +0 -205
  359. package/src/memory/constants.py +0 -39
  360. package/src/memory/helpers.py +0 -28
  361. package/src/memory/schema.py +0 -166
  362. package/src/memory-profiles.py +0 -595
  363. package/src/memory-reset.py +0 -491
  364. package/src/memory_compression.py +0 -989
  365. package/src/memory_store_v2.py +0 -1155
  366. package/src/migrate_v1_to_v2.py +0 -629
  367. package/src/pattern_learner.py +0 -34
  368. package/src/patterns/__init__.py +0 -24
  369. package/src/patterns/analyzers.py +0 -251
  370. package/src/patterns/learner.py +0 -271
  371. package/src/patterns/scoring.py +0 -171
  372. package/src/patterns/store.py +0 -225
  373. package/src/patterns/terminology.py +0 -140
  374. package/src/provenance_tracker.py +0 -312
  375. package/src/qualixar_attribution.py +0 -139
  376. package/src/qualixar_watermark.py +0 -78
  377. package/src/query_optimizer.py +0 -511
  378. package/src/rate_limiter.py +0 -83
  379. package/src/search/__init__.py +0 -20
  380. package/src/search/cli.py +0 -77
  381. package/src/search/constants.py +0 -26
  382. package/src/search/engine.py +0 -241
  383. package/src/search/fusion.py +0 -122
  384. package/src/search/index_loader.py +0 -114
  385. package/src/search/methods.py +0 -162
  386. package/src/search_engine_v2.py +0 -401
  387. package/src/setup_validator.py +0 -482
  388. package/src/subscription_manager.py +0 -391
  389. package/src/tree/__init__.py +0 -59
  390. package/src/tree/builder.py +0 -185
  391. package/src/tree/nodes.py +0 -202
  392. package/src/tree/queries.py +0 -257
  393. package/src/tree/schema.py +0 -80
  394. package/src/tree_manager.py +0 -19
  395. package/src/trust/__init__.py +0 -45
  396. package/src/trust/constants.py +0 -66
  397. package/src/trust/queries.py +0 -157
  398. package/src/trust/schema.py +0 -95
  399. package/src/trust/scorer.py +0 -299
  400. package/src/trust/signals.py +0 -95
  401. package/src/trust_scorer.py +0 -44
  402. package/ui/app.js +0 -1588
  403. package/ui/js/graph-cytoscape-monolithic-backup.js +0 -1168
  404. package/ui/js/graph-cytoscape.js +0 -1168
  405. package/ui/js/graph-d3-backup.js +0 -32
  406. package/ui/js/graph.js +0 -32
  407. package/ui_server.py +0 -286
  408. /package/docs/{ACCESSIBILITY.md → v2-archive/ACCESSIBILITY.md} +0 -0
  409. /package/docs/{ARCHITECTURE.md → v2-archive/ARCHITECTURE.md} +0 -0
  410. /package/docs/{CLI-COMMANDS-REFERENCE.md → v2-archive/CLI-COMMANDS-REFERENCE.md} +0 -0
  411. /package/docs/{COMPRESSION-README.md → v2-archive/COMPRESSION-README.md} +0 -0
  412. /package/docs/{FRAMEWORK-INTEGRATIONS.md → v2-archive/FRAMEWORK-INTEGRATIONS.md} +0 -0
  413. /package/docs/{MCP-MANUAL-SETUP.md → v2-archive/MCP-MANUAL-SETUP.md} +0 -0
  414. /package/docs/{MCP-TROUBLESHOOTING.md → v2-archive/MCP-TROUBLESHOOTING.md} +0 -0
  415. /package/docs/{PATTERN-LEARNING.md → v2-archive/PATTERN-LEARNING.md} +0 -0
  416. /package/docs/{PROFILES-GUIDE.md → v2-archive/PROFILES-GUIDE.md} +0 -0
  417. /package/docs/{RESET-GUIDE.md → v2-archive/RESET-GUIDE.md} +0 -0
  418. /package/docs/{SEARCH-ENGINE-V2.2.0.md → v2-archive/SEARCH-ENGINE-V2.2.0.md} +0 -0
  419. /package/docs/{SEARCH-INTEGRATION-GUIDE.md → v2-archive/SEARCH-INTEGRATION-GUIDE.md} +0 -0
  420. /package/docs/{UI-SERVER.md → v2-archive/UI-SERVER.md} +0 -0
  421. /package/docs/{UNIVERSAL-INTEGRATION.md → v2-archive/UNIVERSAL-INTEGRATION.md} +0 -0
  422. /package/docs/{V2.2.0-OPTIONAL-SEARCH.md → v2-archive/V2.2.0-OPTIONAL-SEARCH.md} +0 -0
  423. /package/docs/{WINDOWS-INSTALL-README.txt → v2-archive/WINDOWS-INSTALL-README.txt} +0 -0
  424. /package/docs/{WINDOWS-POST-INSTALL.txt → v2-archive/WINDOWS-POST-INSTALL.txt} +0 -0
  425. /package/docs/{example_graph_usage.py → v2-archive/example_graph_usage.py} +0 -0
  426. /package/{completions → ide/completions}/slm.bash +0 -0
  427. /package/{completions → ide/completions}/slm.zsh +0 -0
  428. /package/{configs → ide/configs}/cody-commands.json +0 -0
  429. /package/{install-skills.sh → scripts/install-skills.sh} +0 -0
  430. /package/{install.ps1 → scripts/install.ps1} +0 -0
  431. /package/{install.sh → scripts/install.sh} +0 -0
package/README.md CHANGED
@@ -2,573 +2,258 @@
2
2
  <img src="https://superlocalmemory.com/assets/logo-mark.png" alt="SuperLocalMemory" width="200"/>
3
3
  </p>
4
4
 
5
- <h1 align="center">SuperLocalMemory</h1>
6
- <p align="center"><strong>Your AI Finally Remembers You</strong></p>
5
+ <h1 align="center">SuperLocalMemory V3</h1>
6
+ <p align="center"><strong>Information-Geometric Agent Memory with Mathematical Guarantees</strong></p>
7
7
 
8
8
  <p align="center">
9
- <strong>Stop re-explaining your codebase every session. 100% local. Zero setup. Completely free.</strong>
9
+ The first agent memory system with mathematically grounded retrieval, lifecycle management, and consistency verification. Four-channel hybrid retrieval. Three operating modes. EU AI Act compliant.
10
10
  </p>
11
11
 
12
12
  <p align="center">
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>
13
+ <a href="https://superlocalmemory.com"><img src="https://img.shields.io/badge/Website-superlocalmemory.com-ff6b35?style=for-the-badge" alt="Website"/></a>
14
+ <a href="https://arxiv.org/abs/2603.02240"><img src="https://img.shields.io/badge/arXiv-2603.02240-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv Paper"/></a>
15
+ <a href="https://zenodo.org/records/19038659"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.19038659-blue?style=for-the-badge&logo=doi&logoColor=white" alt="V3 DOI"/></a>
14
16
  </p>
15
17
 
16
18
  <p align="center">
17
- <a href="https://arxiv.org/abs/2603.02240"><img src="https://img.shields.io/badge/arXiv-2603.02240-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv"/></a>
18
- <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>
19
- <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>
20
- <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>
21
- </p>
22
-
23
- <p align="center">
24
- <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.8+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.8+"/></a>
19
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+"/></a>
25
20
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License"/></a>
26
- <a href="#"><img src="https://img.shields.io/badge/local--first-100%25-brightgreen?style=flat-square" alt="100% Local"/></a>
27
- <a href="#"><img src="https://img.shields.io/badge/setup-5%20min-orange?style=flat-square" alt="5 Min Setup"/></a>
28
- <a href="#"><img src="https://img.shields.io/badge/platform-Mac%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square" alt="Cross Platform"/></a>
29
- <a href="https://github.com/varun369/SuperLocalMemoryV2/wiki"><img src="https://img.shields.io/badge/📚_Wiki-Documentation-blue?style=flat-square" alt="Wiki"/></a>
30
- </p>
31
-
32
- <p align="center">
33
- <a href="https://superlocalmemory.com"><strong>superlocalmemory.com</strong></a> •
34
- <a href="#-quick-start">Quick Start</a> •
35
- <a href="#-why-superlocalmemory">Why This?</a> •
36
- <a href="#-features">Features</a> •
37
- <a href="#-documentation">Docs</a> •
38
- <a href="https://github.com/varun369/SuperLocalMemoryV2/issues">Issues</a>
39
- </p>
40
-
41
- <p align="center">
42
- <b>A <a href="https://github.com/varun369">Qualixar</a> Product</b> · Created by <a href="https://github.com/varun369">Varun Pratap Bhardwaj</a> •
43
- <a href="https://github.com/sponsors/varun369">💖 Sponsor</a> •
44
- <a href="LICENSE">📜 MIT License</a>
21
+ <a href="#three-operating-modes"><img src="https://img.shields.io/badge/EU_AI_Act-Compliant-brightgreen?style=flat-square" alt="EU AI Act"/></a>
22
+ <a href="#"><img src="https://img.shields.io/badge/tests-1400+-brightgreen?style=flat-square" alt="1400+ Tests"/></a>
23
+ <a href="#"><img src="https://img.shields.io/badge/platform-Mac_|_Linux_|_Windows-blue?style=flat-square" alt="Cross Platform"/></a>
24
+ <a href="https://github.com/qualixar/superlocalmemory/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-blue?style=flat-square" alt="Wiki"/></a>
45
25
  </p>
46
26
 
47
27
  ---
48
28
 
49
- ## Research Paper
29
+ ## What is SuperLocalMemory?
50
30
 
51
- **SuperLocalMemory: Privacy-Preserving Multi-Agent Memory with Bayesian Trust Defense Against Memory Poisoning**
31
+ SuperLocalMemory gives AI assistants persistent, structured memory that survives across sessions. Unlike simple vector stores, V3 uses **information geometry** to provide mathematically grounded retrieval, automatic contradiction detection, and self-organizing memory lifecycle management.
52
32
 
53
- *Varun Pratap Bhardwaj, 2026*
33
+ **Works with:** Claude, Cursor, Windsurf, VS Code Copilot, Continue, Cody, ChatGPT Desktop, Gemini CLI, JetBrains, Zed, and 17+ AI tools via MCP.
54
34
 
55
- 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.
35
+ > **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](docs/migration-from-v2.md) before upgrading. Backup is created automatically.
56
36
 
57
- | Platform | Link |
58
- |----------|------|
59
- | **arXiv** | [arXiv:2603.02240](https://arxiv.org/abs/2603.02240) |
60
- | **Zenodo** (CERN) | [DOI: 10.5281/zenodo.18709670](https://zenodo.org/records/18709670) |
61
- | **ResearchGate** | [Publication Page](https://www.researchgate.net/publication/400976053) |
62
- | **Research Portfolio** | [superlocalmemory.com/research](https://superlocalmemory.com/research) |
37
+ ### Key Results
63
38
 
64
- If you use SuperLocalMemory in your research, please cite:
65
-
66
- ```bibtex
67
- @article{bhardwaj2026superlocalmemory,
68
- title={SuperLocalMemory: Privacy-Preserving Multi-Agent Memory with Bayesian Trust Defense Against Memory Poisoning},
69
- author={Bhardwaj, Varun Pratap},
70
- year={2026},
71
- eprint={2603.02240},
72
- archivePrefix={arXiv},
73
- primaryClass={cs.AI},
74
- url={https://arxiv.org/abs/2603.02240}
75
- }
76
- ```
39
+ | Metric | Score | Context |
40
+ |:-------|:-----:|:--------|
41
+ | LoCoMo (Mode A, zero-LLM) | **62.3%** | Highest zero-LLM score. No cloud dependency. |
42
+ | LoCoMo (Mode C, full) | **~78%** | Competitive with funded systems ($10M+) |
43
+ | Math layer improvement | **+12.7pp** | Average gain from mathematical foundations |
44
+ | Multi-hop improvement | **+12pp** | 50% vs 38% (math on vs off) |
77
45
 
78
46
  ---
79
47
 
80
- ## What's New in v2.8 — "Memory That Manages Itself"
81
-
82
- **SuperLocalMemory now manages its own memory lifecycle, learns from action outcomes, and provides enterprise-grade compliance — all 100% locally on your machine.**
83
-
84
- ### Memory Lifecycle Management (v2.8)
85
- Memories automatically transition through lifecycle states based on usage patterns:
86
- - **Active** — Frequently used, instantly available
87
- - **Warm** — Recently used, included in searches
88
- - **Cold** — Older, retrievable on demand
89
- - **Archived** — Compressed, restorable when needed
48
+ ## Three Operating Modes
90
49
 
91
- Configure bounds to keep your memory system fast:
92
- ```bash
93
- # Check lifecycle status
94
- slm lifecycle-status
95
-
96
- # Compact stale memories
97
- slm compact --dry-run
98
- ```
99
-
100
- ### Behavioral Learning (v2.8)
101
- The system learns from what works:
102
- - Report outcomes: `slm report-outcome --memory-ids 1,5 --outcome success`
103
- - View patterns: `slm behavioral-patterns`
104
- - Knowledge transfers across projects automatically
105
-
106
- ### Enterprise Compliance (v2.8)
107
- Built for regulated environments:
108
- - **Access Control** — Attribute-based policies (ABAC)
109
- - **Audit Trail** — Tamper-evident event logging
110
- - **Retention Policies** — GDPR erasure, HIPAA retention, EU AI Act compliance
111
-
112
- ### New MCP Tools (v2.8)
113
-
114
- | Tool | Purpose |
115
- |------|---------|
116
- | `report_outcome` | Record action outcomes for behavioral learning |
117
- | `get_lifecycle_status` | View memory lifecycle states |
118
- | `set_retention_policy` | Configure retention policies |
119
- | `compact_memories` | Trigger lifecycle transitions |
120
- | `get_behavioral_patterns` | View learned behavioral patterns |
121
- | `audit_trail` | Query compliance audit trail |
50
+ | Mode | What | LLM Required? | EU AI Act | Best For |
51
+ |:----:|:-----|:-------------:|:---------:|:---------|
52
+ | **A** | Local Guardian | No | Compliant | Privacy-first, air-gapped, enterprise |
53
+ | **B** | Smart Local | Local only (Ollama) | Compliant | Enhanced quality, data stays local |
54
+ | **C** | Full Power | Cloud (optional) | Partial | Maximum accuracy, research |
122
55
 
123
- ### Performance
124
-
125
- | Operation | Latency |
126
- |-----------|---------|
127
- | Lifecycle evaluation | Sub-2ms |
128
- | Access control check | Sub-1ms |
129
- | Feature vector (20-dim) | Sub-5ms |
130
-
131
- **Upgrade:** `npm install -g superlocalmemory@latest` — All v2.7 behavior preserved, zero breaking changes.
132
-
133
- [Upgrading to v2.8](https://github.com/varun369/SuperLocalMemoryV2/wiki/Upgrading-to-v2.8) | [Full Changelog](CHANGELOG.md)
56
+ **Mode A** is the only agent memory that operates with **zero cloud dependency** while achieving competitive retrieval accuracy. All data stays on your device. No API keys required.
134
57
 
135
58
  ---
136
59
 
137
- <details>
138
- <summary><strong>Previous: v2.7 — "Your AI Learns You"</strong></summary>
139
-
140
- 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.
141
-
142
- - **Adaptive Learning** — Learns tech preferences, project context, and workflow patterns
143
- - **Three-Phase Ranking** — Baseline → Rule-Based → ML Ranking (gets smarter over time)
144
- - **Privacy by Design** — Learning data stored separately, one-command GDPR erasure
145
- - **3 New MCP Tools** — Feedback signal, pattern transparency, and user correction
146
-
147
- </details>
148
-
149
- <details>
150
- <summary><strong>Previous: v2.6.5 — Interactive Knowledge Graph</strong></summary>
151
-
152
- - Fully interactive visualization with zoom, pan, and click-to-explore
153
- - 6 layout algorithms, smart cluster filtering, 10,000+ node performance
154
- - Mobile & accessibility support: touch gestures, keyboard nav, screen reader
155
-
156
- </details>
157
-
158
- <details>
159
- <summary><strong>Previous: v2.6 — Security & Scale</strong></summary>
160
-
161
- ## What's New in v2.6
162
-
163
- SuperLocalMemory is now **production-hardened** with security, performance, and scale improvements:
164
-
165
- - **Trust Enforcement** — Bayesian scoring actively protects your memory. Agents with trust below 0.3 are blocked from write/delete operations.
166
- - **Profile Isolation** — Memory profiles fully sandboxed. Zero cross-profile data leakage.
167
- - **Rate Limiting** — Protects against memory flooding from misbehaving agents.
168
- - **HNSW-Accelerated Graphs** — Knowledge graph edge building uses HNSW index for faster construction at scale.
169
- - **Hybrid Search Engine** — Combined semantic + FTS5 + graph retrieval for maximum accuracy.
170
-
171
- **v2.5 highlights (included):** Real-time event stream, WAL-mode concurrent writes, agent tracking, memory provenance, 28 API endpoints.
172
-
173
- **Upgrade:** `npm install -g superlocalmemory@latest`
174
-
175
- [Interactive Architecture Diagram](https://superlocalmemory.com/architecture.html) | [Architecture Doc](docs/ARCHITECTURE.md) | [Full Changelog](CHANGELOG.md)
176
-
177
- </details>
178
-
179
- ---
180
-
181
- ## The Problem
182
-
183
- Every time you start a new Claude session:
60
+ ## Architecture
184
61
 
185
62
  ```
186
- You: "Remember that authentication bug we fixed last week?"
187
- Claude: "I don't have access to previous conversations..."
188
- You: *sighs and explains everything again*
63
+ Query ──► Strategy Classifier ──► 4 Parallel Channels:
64
+ ├── Semantic (Fisher-Rao graduated similarity)
65
+ ├── BM25 (keyword matching, k1=1.2, b=0.75)
66
+ ├── Entity Graph (spreading activation, 3 hops)
67
+ └── Temporal (date-aware retrieval)
68
+
69
+ RRF Fusion (k=60)
70
+
71
+ Scene Expansion + Bridge Discovery
72
+
73
+ Cross-Encoder Reranking
74
+
75
+ ◄── Top-K Results with channel scores
189
76
  ```
190
77
 
191
- **AI assistants forget everything between sessions.** You waste time re-explaining your:
192
- - Project architecture
193
- - Coding preferences
194
- - Previous decisions
195
- - Debugging history
78
+ ### Mathematical Foundations (Novel Contributions)
196
79
 
197
- ---
198
-
199
- ## The Solution
80
+ 1. **Fisher-Rao Retrieval Metric** — Similarity scoring derived from the Fisher information structure of diagonal Gaussian families. Graduated ramp from cosine to Fisher-information-weighted scoring over the first 10 accesses per memory.
200
81
 
201
- ```bash
202
- # Install in one command
203
- npm install -g superlocalmemory
204
-
205
- # Save a memory
206
- superlocalmemoryv2-remember "Fixed auth bug - JWT tokens were expiring too fast, increased to 24h"
207
-
208
- # Later, in a new session...
209
- superlocalmemoryv2-recall "auth bug"
210
- # ✓ Found: "Fixed auth bug - JWT tokens were expiring too fast, increased to 24h"
211
- ```
82
+ 2. **Sheaf Cohomology for Consistency** — Algebraic topology detects contradictions between facts by computing coboundary norms on the knowledge graph. Non-trivial restriction maps amplify disagreements along discriminative subspaces.
212
83
 
213
- **Your AI now remembers everything.** Forever. Locally. For free.
84
+ 3. **Riemannian Langevin Lifecycle** Memory positions evolve on the Poincare ball via a discretized Langevin SDE. Frequently accessed memories stay near the origin (ACTIVE); neglected memories diffuse toward the boundary (ARCHIVED). The potential is modulated by access frequency, age, and importance.
214
85
 
215
86
  ---
216
87
 
217
- ## 🚀 Quick Start
88
+ ## Quick Start
218
89
 
219
- ### Install (One Command)
90
+ ### Install via npm (recommended)
220
91
 
221
92
  ```bash
222
93
  npm install -g superlocalmemory
94
+ slm setup
223
95
  ```
224
96
 
225
- Or clone manually:
226
- ```bash
227
- git clone https://github.com/varun369/SuperLocalMemoryV2.git && cd SuperLocalMemoryV2 && ./install.sh
228
- ```
229
-
230
- Both methods auto-detect and configure **17+ IDEs and AI tools** — Cursor, VS Code/Copilot, Codex, Claude, Windsurf, Gemini CLI, JetBrains, and more.
231
-
232
- ### Verify Installation
97
+ ### Install via pip
233
98
 
234
99
  ```bash
235
- superlocalmemoryv2-status
236
- # Database: OK (0 memories)
237
- # Graph: Ready
238
- # ✓ Patterns: Ready
100
+ pip install superlocalmemory
101
+ # or with all features:
102
+ pip install "superlocalmemory[full]"
239
103
  ```
240
104
 
241
- **That's it.** No Docker. No API keys. No cloud accounts. No configuration.
242
-
243
- ### Launch Dashboard
105
+ ### First Use
244
106
 
245
107
  ```bash
246
- # Start the interactive web UI
247
- python3 ~/.claude-memory/ui_server.py
108
+ # Store a memory
109
+ slm remember "Alice works at Google as a Staff Engineer"
248
110
 
249
- # Opens at http://localhost:8765
250
- # Features: Timeline, search, interactive graph, statistics
251
- ```
111
+ # Recall
112
+ slm recall "What does Alice do?"
252
113
 
253
- ---
254
-
255
- ## 💡 Why SuperLocalMemory?
256
-
257
- ### For Developers Who Use AI Daily
258
-
259
- | Scenario | Without Memory | With SuperLocalMemory |
260
- |----------|---------------|----------------------|
261
- | New Claude session | Re-explain entire project | `recall "project context"` → instant context |
262
- | Debugging | "We tried X last week..." starts over | Knowledge graph shows related past fixes |
263
- | Code preferences | "I prefer React..." every time | Pattern learning knows your style |
264
- | Multi-project | Context constantly bleeds | Separate profiles per project |
265
-
266
- ### Built on Peer-Reviewed Research
267
-
268
- 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.
269
-
270
- **The only open-source implementation combining all these approaches — entirely locally.**
114
+ # Check status
115
+ slm status
271
116
 
272
- [Read the paper →](https://zenodo.org/records/18709670)
273
-
274
- ---
275
-
276
- ## ✨ Features
277
-
278
- ### Multi-Layer Memory Architecture
279
-
280
- **[View Interactive Architecture Diagram](https://superlocalmemory.com/architecture.html)** — Click any layer for details, research references, and file paths.
281
-
282
- ```
283
- ┌─────────────────────────────────────────────────────────────┐
284
- │ Layer 9: VISUALIZATION (v2.2+) │
285
- │ Interactive dashboard: timeline, graph explorer, analytics │
286
- ├─────────────────────────────────────────────────────────────┤
287
- │ Layer 8: HYBRID SEARCH (v2.2+) │
288
- │ Combines: Semantic + FTS5 + Graph traversal │
289
- ├─────────────────────────────────────────────────────────────┤
290
- │ Layer 7: UNIVERSAL ACCESS │
291
- │ MCP + Skills + CLI (works everywhere) │
292
- │ 17+ IDEs with single database │
293
- ├─────────────────────────────────────────────────────────────┤
294
- │ Layer 6: MCP INTEGRATION │
295
- │ Model Context Protocol: 18 tools, 6 resources, 2 prompts │
296
- │ Auto-configured for Cursor, Windsurf, Claude │
297
- ├─────────────────────────────────────────────────────────────┤
298
- │ Layer 5½: ADAPTIVE LEARNING (v2.7 — NEW) │
299
- │ Three-layer learning: tech prefs + project context + flow │
300
- │ Local ML re-ranking — no cloud, no telemetry │
301
- ├─────────────────────────────────────────────────────────────┤
302
- │ Layer 5: SKILLS LAYER │
303
- │ 7 universal slash-commands for AI assistants │
304
- │ Compatible with Claude Code, Continue, Cody │
305
- ├─────────────────────────────────────────────────────────────┤
306
- │ Layer 4: PATTERN LEARNING │
307
- │ Confidence-scored preference detection │
308
- │ "You prefer React over Vue" (73% confidence) │
309
- ├─────────────────────────────────────────────────────────────┤
310
- │ Layer 3: KNOWLEDGE GRAPH + HIERARCHICAL CLUSTERING │
311
- │ Auto-clustering: "Python" → "Web API" → "Auth" │
312
- │ Community summaries with auto-generated labels │
313
- ├─────────────────────────────────────────────────────────────┤
314
- │ Layer 2: HIERARCHICAL INDEX │
315
- │ Tree structure for fast navigation │
316
- │ O(log n) lookups instead of O(n) scans │
317
- ├─────────────────────────────────────────────────────────────┤
318
- │ Layer 1: RAW STORAGE │
319
- │ SQLite + Full-text search + vector search │
320
- │ Compression: 60-96% space savings │
321
- └─────────────────────────────────────────────────────────────┘
117
+ # Switch modes
118
+ slm mode a # Zero-LLM (default)
119
+ slm mode b # Local Ollama
120
+ slm mode c # Full power
322
121
  ```
323
122
 
324
- ### Key Capabilities
123
+ ### MCP Integration (Claude, Cursor, etc.)
325
124
 
326
- - **[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*
327
- - **[Knowledge Graphs](https://github.com/varun369/SuperLocalMemoryV2/wiki/Knowledge-Graph-Guide)** — Automatic relationship discovery. Interactive visualization with zoom, pan, click.
328
- - **[Pattern Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Pattern-Learning-Explained)** — Learns your coding preferences and style automatically.
329
- - **[Multi-Profile Support](https://github.com/varun369/SuperLocalMemoryV2/wiki/Multi-Profile-Workflows)** — Isolated contexts for work, personal, clients. Zero context bleeding.
330
- - **[Hybrid Search](https://github.com/varun369/SuperLocalMemoryV2/wiki/Advanced-Search)** — Semantic + FTS5 + Graph retrieval combined for maximum accuracy.
331
- - **[Visualization Dashboard](https://github.com/varun369/SuperLocalMemoryV2/wiki/Visualization-Dashboard)** — Web UI for timeline, search, graph exploration, analytics.
332
- - **[Framework Integrations](docs/FRAMEWORK-INTEGRATIONS.md)** — Use with LangChain and LlamaIndex applications.
333
- - **[Real-Time Events](https://github.com/varun369/SuperLocalMemoryV2/wiki/Real-Time-Event-System)** — Live notifications via SSE/WebSocket/Webhooks when memories change.
334
- - **[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*
335
- - **[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*
336
- - **[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*
125
+ Add to your IDE's MCP config:
337
126
 
338
- ---
339
-
340
- ## 🌐 Works Everywhere
341
-
342
- **SuperLocalMemory is the ONLY memory system that works across ALL your tools:**
343
-
344
- ### Supported IDEs & Tools
345
-
346
- | Tool | Integration | How It Works |
347
- |------|-------------|--------------|
348
- | **Claude Code** | ✅ Skills + MCP | `/superlocalmemoryv2-remember` |
349
- | **Cursor** | ✅ MCP + Skills | AI uses memory tools natively |
350
- | **Windsurf** | ✅ MCP + Skills | Native memory access |
351
- | **Claude Desktop** | ✅ MCP | Built-in support |
352
- | **OpenAI Codex** | ✅ MCP + Skills | Auto-configured (TOML) |
353
- | **VS Code / Copilot** | ✅ MCP + Skills | `.vscode/mcp.json` |
354
- | **Continue.dev** | ✅ MCP + Skills | `/slm-remember` |
355
- | **Cody** | ✅ Custom Commands | `/slm-remember` |
356
- | **Gemini CLI** | ✅ MCP + Skills | Native MCP + skills |
357
- | **JetBrains IDEs** | ✅ MCP | Via AI Assistant settings |
358
- | **Zed Editor** | ✅ MCP | Native MCP tools |
359
- | **Aider** | ✅ Smart Wrapper | `aider-smart` with context |
360
- | **Any Terminal** | ✅ Universal CLI | `slm remember "content"` |
361
-
362
- ### Three Ways to Access
363
-
364
- 1. **MCP (Model Context Protocol)** — Auto-configured for Cursor, Windsurf, Claude Desktop
365
- - AI assistants get natural access to your memory
366
- - No manual commands needed
367
- - "Remember that we use this framework" just works
368
-
369
- 2. **Skills & Commands** — For Claude Code, Continue.dev, Cody
370
- - `/superlocalmemoryv2-remember` in Claude Code
371
- - `/slm-remember` in Continue.dev and Cody
372
- - Familiar slash command interface
373
-
374
- 3. **Universal CLI** — Works in any terminal or script
375
- - `slm remember "content"` - Simple, clean syntax
376
- - `slm recall "query"` - Search from anywhere
377
- - `aider-smart` - Aider with auto-context injection
378
-
379
- **All three methods use the SAME local database.** No data duplication, no conflicts.
380
-
381
- [Complete setup guide for all tools →](docs/MCP-MANUAL-SETUP.md)
382
-
383
- ---
127
+ ```json
128
+ {
129
+ "mcpServers": {
130
+ "superlocalmemory": {
131
+ "command": "slm",
132
+ "args": ["mcp"]
133
+ }
134
+ }
135
+ }
136
+ ```
384
137
 
385
- ## 🆚 vs Alternatives
386
-
387
- ### The Hard Truth About "Free" Tiers
388
-
389
- | Solution | Free Tier Limits | Paid Price | What's Missing |
390
- |----------|-----------------|------------|----------------|
391
- | **Mem0** | 10K memories, limited API | Usage-based | No pattern learning, not local |
392
- | **Zep** | Limited credits | $50/month | Credit system, cloud-only |
393
- | **Supermemory** | 1M tokens, 10K queries | $19-399/mo | Not local, no graphs |
394
- | **Personal.AI** | ❌ No free tier | $33/month | Cloud-only, closed ecosystem |
395
- | **Letta/MemGPT** | Self-hosted (complex) | TBD | Requires significant setup |
396
- | **SuperLocalMemory** | **Unlimited** | **$0 forever** | **Nothing.** |
397
-
398
- ### What Actually Matters
399
-
400
- | Feature | Mem0 | Zep | Khoj | Letta | **SuperLocalMemory** |
401
- |---------|------|-----|------|-------|------------------------|
402
- | **Works in Cursor** | Cloud Only | ❌ | ❌ | ❌ | ✅ **Local** |
403
- | **Works in Windsurf** | Cloud Only | ❌ | ❌ | ❌ | ✅ **Local** |
404
- | **Works in VS Code** | 3rd Party | ❌ | Partial | ❌ | ✅ **Native** |
405
- | **Universal CLI** | ❌ | ❌ | ❌ | ❌ | ✅ |
406
- | **Multi-Layer Architecture** | ❌ | ❌ | ❌ | ❌ | ✅ |
407
- | **Pattern Learning** | ❌ | ❌ | ❌ | ❌ | ✅ |
408
- | **Adaptive ML Ranking** | Cloud LLM | ❌ | ❌ | ❌ | ✅ **Local ML** |
409
- | **Knowledge Graphs** | ✅ | ✅ | ❌ | ❌ | ✅ |
410
- | **100% Local** | ❌ | ❌ | Partial | Partial | ✅ |
411
- | **GDPR by Design** | ❌ | ❌ | ❌ | ❌ | ✅ |
412
- | **Zero Setup** | ❌ | ❌ | ❌ | ❌ | ✅ |
413
- | **Completely Free** | Limited | Limited | Partial | ✅ | ✅ |
414
-
415
- **SuperLocalMemory is the ONLY solution that:**
416
- - ✅ **Learns and adapts** locally — no cloud LLM needed for personalization
417
- - ✅ Works across 17+ IDEs and CLI tools
418
- - ✅ Remains 100% local (no cloud dependencies)
419
- - ✅ GDPR Article 17 compliant — one-command data erasure
420
- - ✅ Completely free with unlimited memories
421
-
422
- [See full competitive analysis →](docs/COMPETITIVE-ANALYSIS.md)
138
+ 24 MCP tools available: `remember`, `recall`, `search`, `fetch`, `list_recent`, `get_status`, `build_graph`, `switch_profile`, `health`, `consistency_check`, `recall_trace`, and more.
423
139
 
424
140
  ---
425
141
 
426
- ## Measured Performance
427
-
428
- All numbers measured on real hardware (Apple M4 Pro, 24GB RAM). No estimates — real benchmarks.
429
-
430
- ### Search Speed
431
-
432
- | Database Size | Median Latency | P95 Latency |
433
- |---------------|----------------|-------------|
434
- | 100 memories | **10.6ms** | 14.9ms |
435
- | 500 memories | **65.2ms** | 101.7ms |
436
- | 1,000 memories | **124.3ms** | 190.1ms |
437
-
438
- For typical personal use (under 500 memories), search results return faster than you blink.
439
-
440
- ### Concurrent Writes — Zero Errors
441
-
442
- | Scenario | Writes/sec | Errors |
443
- |----------|------------|--------|
444
- | 1 AI tool writing | **204/sec** | 0 |
445
- | 2 AI tools simultaneously | **220/sec** | 0 |
446
- | 5 AI tools simultaneously | **130/sec** | 0 |
447
-
448
- Concurrent-safe architecture = zero "database is locked" errors, ever.
449
-
450
- ### Storage
451
-
452
- 10,000 memories = **13.6 MB** on disk (~1.4 KB per memory). Your entire AI memory history takes less space than a photo.
453
-
454
- ### Graph Construction
455
-
456
- | Memories | Build Time |
457
- |----------|-----------|
458
- | 100 | 0.28s |
459
- | 1,000 | 10.6s |
460
-
461
- Auto-clustering discovers 6-7 natural topic communities from your memories.
462
-
463
- [Full benchmark details →](https://github.com/varun369/SuperLocalMemoryV2/wiki/Performance-Benchmarks)
142
+ ## V3 Engine Features
143
+
144
+ ### Retrieval (4-Channel Hybrid)
145
+ - Semantic similarity with Fisher-Rao information geometry
146
+ - BM25 keyword matching (persisted tokens, survives restart)
147
+ - Entity graph with spreading activation (3-hop, decay=0.7)
148
+ - Temporal date-aware retrieval with interval support
149
+ - RRF fusion (k=60) + cross-encoder reranking
150
+
151
+ ### Intelligence
152
+ - 11-step ingestion pipeline (entity resolution, fact extraction, emotional tagging, scene building, sheaf consistency)
153
+ - Adaptive learning with LightGBM-based ranking (3-phase bootstrap)
154
+ - Behavioral pattern detection (query habits, entity preferences, active hours)
155
+ - Outcome tracking for retrieval feedback loops
156
+
157
+ ### Trust & Compliance
158
+ - Bayesian Beta distribution trust scoring (per-agent, per-fact)
159
+ - Trust gates (block low-trust agents from writing/deleting)
160
+ - ABAC (Attribute-Based Access Control) with DB-persisted policies
161
+ - GDPR Article 15/17 compliance (full export + complete erasure)
162
+ - EU AI Act data sovereignty (Mode A: zero cloud, data stays local)
163
+ - Tamper-proof hash-chain audit trail (SHA-256 linked entries)
164
+ - Data provenance tracking (who created what, when, from where)
165
+
166
+ ### Infrastructure
167
+ - 17-tab web dashboard (trust visualization, math health, recall lab)
168
+ - 17+ IDE integrations with pre-built configs
169
+ - Profile isolation (16+ independent memory spaces)
170
+ - V2 to V3 migration tool (zero data loss, rollback support)
171
+ - Auto-capture and auto-recall hooks for Claude Code
464
172
 
465
173
  ---
466
174
 
467
- ## 🔧 CLI Commands
175
+ ## Benchmarks
468
176
 
469
- ```bash
470
- # Memory Operations
471
- superlocalmemoryv2-remember "content" --tags tag1,tag2 # Save memory
472
- superlocalmemoryv2-recall "search query" # Search
473
- superlocalmemoryv2-list # Recent memories
474
- superlocalmemoryv2-status # System health
475
-
476
- # Profile Management
477
- superlocalmemoryv2-profile list # Show all profiles
478
- superlocalmemoryv2-profile create <name> # New profile
479
- superlocalmemoryv2-profile switch <name> # Switch context
480
-
481
- # Knowledge Graph
482
- python ~/.claude-memory/graph_engine.py build # Build graph
483
- python ~/.claude-memory/graph_engine.py stats # View clusters
484
-
485
- # Pattern Learning
486
- python ~/.claude-memory/pattern_learner.py update # Learn patterns
487
- python ~/.claude-memory/pattern_learner.py context 0.5 # Get identity
488
-
489
- # Visualization Dashboard
490
- python ~/.claude-memory/ui_server.py # Launch web UI
491
- ```
177
+ Evaluated on the [LoCoMo benchmark](https://arxiv.org/abs/2402.09714) (Long Conversation Memory):
492
178
 
493
- [Complete CLI reference →](docs/CLI-COMMANDS-REFERENCE.md)
179
+ ### Mode A Ablation (conv-30, 81 questions, zero-LLM)
494
180
 
495
- ---
496
-
497
- ## 📖 Documentation
498
-
499
- | Guide | Description |
500
- |-------|-------------|
501
- | [Quick Start](https://github.com/varun369/SuperLocalMemoryV2/wiki/Quick-Start-Tutorial) | Get running in 5 minutes |
502
- | [Installation](https://github.com/varun369/SuperLocalMemoryV2/wiki/Installation) | Detailed setup instructions |
503
- | [Visualization Dashboard](https://github.com/varun369/SuperLocalMemoryV2/wiki/Visualization-Dashboard) | Interactive web UI guide |
504
- | [Interactive Graph](https://github.com/varun369/SuperLocalMemoryV2/wiki/Using-Interactive-Graph) | Graph exploration guide (NEW v2.6.5) |
505
- | [Framework Integrations](docs/FRAMEWORK-INTEGRATIONS.md) | LangChain & LlamaIndex setup |
506
- | [Knowledge Graph](https://github.com/varun369/SuperLocalMemoryV2/wiki/Knowledge-Graph-Guide) | How clustering works |
507
- | [Pattern Learning](docs/PATTERN-LEARNING.md) | Identity extraction |
508
- | [Memory Lifecycle](https://github.com/varun369/SuperLocalMemoryV2/wiki/Memory-Lifecycle) | Lifecycle states, compaction, bounded growth (v2.8) |
509
- | [Behavioral Learning](https://github.com/varun369/SuperLocalMemoryV2/wiki/Behavioral-Learning) | Action outcomes, pattern extraction (v2.8) |
510
- | [Enterprise Compliance](https://github.com/varun369/SuperLocalMemoryV2/wiki/Enterprise-Compliance) | ABAC, audit trail, retention policies (v2.8) |
511
- | [Upgrading to v2.8](https://github.com/varun369/SuperLocalMemoryV2/wiki/Upgrading-to-v2.8) | Migration guide from v2.7 |
512
- | [API Reference](docs/API-REFERENCE.md) | Python API documentation |
513
-
514
- ---
181
+ | Configuration | Micro Avg | Multi-Hop | Open Domain |
182
+ |:-------------|:---------:|:---------:|:-----------:|
183
+ | Full (all layers) | **62.3%** | **50%** | **78%** |
184
+ | Math layers off | 59.3% | 38% | 70% |
185
+ | Entity channel off | 56.8% | 38% | 73% |
186
+ | BM25 channel off | 53.2% | 23% | 71% |
187
+ | Cross-encoder off | 31.8% | 17% | |
515
188
 
516
- ## 🤝 Contributing
189
+ ### Competitive Landscape
517
190
 
518
- We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
191
+ | System | Score | LLM Required | Open Source | EU AI Act |
192
+ |:-------|:-----:|:------------:|:-----------:|:---------:|
193
+ | EverMemOS | 92.3% | Yes | No | No |
194
+ | MemMachine | 91.7% | Yes | No | No |
195
+ | Hindsight | 89.6% | Yes | No | No |
196
+ | **SLM V3 Mode C** | **~78%** | Optional | **Yes** | Partial |
197
+ | **SLM V3 Mode A** | **62.3%** | **No** | **Yes** | **Yes** |
198
+ | Mem0 ($24M) | 34.2% F1 | Yes | Partial | No |
519
199
 
520
- **Areas for contribution:**
521
- - Additional pattern categories
522
- - Performance optimizations
523
- - Integration with more AI assistants
524
- - Documentation improvements
200
+ *SLM V3 is the only system offering a fully local mode with mathematical guarantees and EU AI Act compliance.*
525
201
 
526
202
  ---
527
203
 
528
- ## 💖 Support This Project
204
+ ## Research Papers
529
205
 
530
- If SuperLocalMemory saves you time, consider supporting its development:
206
+ ### V3: Information-Geometric Foundations
207
+ > **SuperLocalMemory V3: Information-Geometric Foundations for Zero-LLM Enterprise Agent Memory**
208
+ > Varun Pratap Bhardwaj (2026)
209
+ > [Zenodo DOI: 10.5281/zenodo.19038659](https://zenodo.org/records/19038659)
531
210
 
532
- - **Star this repo** — helps others discover it
533
- - 🐛 **Report bugs** [open an issue](https://github.com/varun369/SuperLocalMemoryV2/issues)
534
- - 💡 **Suggest features** — [start a discussion](https://github.com/varun369/SuperLocalMemoryV2/discussions)
535
- - **Buy me a coffee** — [buymeacoffee.com/varunpratah](https://buymeacoffee.com/varunpratah)
536
- - 💸 **PayPal** — [paypal.me/varunpratapbhardwaj](https://paypal.me/varunpratapbhardwaj)
537
- - 💖 **Sponsor** — [GitHub Sponsors](https://github.com/sponsors/varun369)
211
+ ### V2: Architecture & Engineering
212
+ > **SuperLocalMemory: A Structured Local Memory Architecture for Persistent AI Agent Context**
213
+ > Varun Pratap Bhardwaj (2026)
214
+ > [arXiv:2603.02240](https://arxiv.org/abs/2603.02240) | [Zenodo DOI: 10.5281/zenodo.18709670](https://zenodo.org/records/18709670)
538
215
 
539
216
  ---
540
217
 
541
- ## 📜 License
218
+ ## Project Structure
542
219
 
543
- MIT License — use freely, even commercially. Just include the license.
220
+ ```
221
+ superlocalmemory/
222
+ ├── src/superlocalmemory/ # Python package (17 sub-packages)
223
+ │ ├── core/ # Engine, config, modes, profiles
224
+ │ ├── retrieval/ # 4-channel retrieval + fusion + reranking
225
+ │ ├── math/ # Fisher-Rao, Sheaf, Langevin
226
+ │ ├── encoding/ # 11-step ingestion pipeline
227
+ │ ├── storage/ # SQLite with WAL, FTS5, migrations
228
+ │ ├── trust/ # Bayesian scoring, gates, provenance
229
+ │ ├── compliance/ # GDPR, EU AI Act, ABAC, audit chain
230
+ │ ├── learning/ # Adaptive ranking, behavioral patterns
231
+ │ ├── mcp/ # MCP server (24 tools, 6 resources)
232
+ │ ├── cli/ # CLI with setup wizard
233
+ │ └── server/ # Dashboard API + UI server
234
+ ├── tests/ # 1400+ tests
235
+ ├── ui/ # 17-tab web dashboard
236
+ ├── ide/ # IDE configs for 17+ tools
237
+ ├── docs/ # Documentation
238
+ └── pyproject.toml # Modern Python packaging
239
+ ```
544
240
 
545
241
  ---
546
242
 
547
- ## 👨‍💻 Author
548
-
549
- **Varun Pratap Bhardwaj** — Founder, Qualixar · Solution Architect
243
+ ## Contributing
550
244
 
551
- [![GitHub](https://img.shields.io/badge/GitHub-@varun369-181717?style=flat-square&logo=github)](https://github.com/varun369)
245
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
552
246
 
553
- Building the complete agent development platform at Qualixar — memory, testing, contracts, and security for AI agents.
247
+ ## License
554
248
 
555
- ### Part of the Qualixar Agent Development Platform
249
+ MIT License. See [LICENSE](LICENSE).
556
250
 
557
- SuperLocalMemory is part of **Qualixar**, a suite of open-source tools for building reliable AI agents:
251
+ ## Attribution
558
252
 
559
- | Product | What It Does |
560
- |---------|-------------|
561
- | **SuperLocalMemory** | Local-first AI agent memory |
562
- | **SkillFortify** | Agent skill supply chain security |
253
+ Part of [Qualixar](https://qualixar.com) | Author: [Varun Pratap Bhardwaj](https://varunpratap.com)
563
254
 
564
255
  ---
565
256
 
566
257
  <p align="center">
567
- <b>100% local. 100% private. 100% yours.</b>
568
- </p>
569
-
570
- <p align="center">
571
- <a href="https://github.com/varun369/SuperLocalMemoryV2">
572
- <img src="https://img.shields.io/badge/⭐_Star_on_GitHub-black?style=for-the-badge&logo=github" alt="Star on GitHub"/>
573
- </a>
258
+ <sub>Built with mathematical rigor. Not in the race — here to help everyone build better AI memory systems.</sub>
574
259
  </p>