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/mcp_server.py CHANGED
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - MCP Server
2
+ # SPDX-License-Identifier: MIT
3
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
4
+ """SuperLocalMemory V2 - MCP Server
4
5
  Universal memory access for all MCP-compatible tools (Cursor, Windsurf, Claude Desktop, Continue.dev)
5
6
 
6
- Copyright (c) 2026 Varun Pratap Bhardwaj
7
- Licensed under MIT License
8
- Repository: https://github.com/varun369/SuperLocalMemoryV2
9
-
10
7
  IMPORTANT: This is an ADDITION to existing skills, not a replacement.
11
8
  Skills in Claude Code continue to work unchanged.
12
9
 
@@ -24,7 +21,6 @@ Usage:
24
21
  # Run as HTTP MCP server (for remote access)
25
22
  python3 mcp_server.py --transport http --port 8001
26
23
  """
27
-
28
24
  from mcp.server.fastmcp import FastMCP, Context
29
25
  from mcp.types import ToolAnnotations
30
26
  import sys
@@ -564,6 +560,36 @@ def _maybe_passive_decay() -> None:
564
560
  pass
565
561
 
566
562
 
563
+ # ============================================================================
564
+ # Eager initialization — ensure schema migration runs at startup (v2.8)
565
+ # ============================================================================
566
+
567
+ def _eager_init():
568
+ """Initialize all engines at startup. Ensures schema migration runs."""
569
+ try:
570
+ get_store() # Triggers MemoryStoreV2._init_db() which creates v2.8 columns
571
+ except Exception:
572
+ pass # Don't block server startup
573
+ try:
574
+ from lifecycle.lifecycle_engine import LifecycleEngine
575
+ LifecycleEngine() # Triggers _ensure_columns()
576
+ except Exception:
577
+ pass
578
+ try:
579
+ from behavioral.outcome_tracker import OutcomeTracker
580
+ OutcomeTracker(str(Path.home() / ".claude-memory" / "learning.db"))
581
+ except Exception:
582
+ pass
583
+ try:
584
+ from compliance.audit_db import AuditDB
585
+ AuditDB(str(Path.home() / ".claude-memory" / "audit.db"))
586
+ except Exception:
587
+ pass
588
+
589
+ # Run once at module load
590
+ _eager_init()
591
+
592
+
567
593
  # ============================================================================
568
594
  # MCP TOOLS (Functions callable by AI)
569
595
  # ============================================================================
@@ -589,7 +615,7 @@ async def remember(
589
615
  Args:
590
616
  content: The content to remember (required)
591
617
  tags: Comma-separated tags (optional, e.g. "python,api,backend")
592
- project: Project name (optional, groups related memories)
618
+ project: Project name to scope the memory
593
619
  importance: Importance score 1-10 (default 5)
594
620
 
595
621
  Returns:
@@ -1349,6 +1375,84 @@ async def fetch(id: str) -> dict:
1349
1375
  raise ValueError(f"Failed to fetch memory {id}: {_sanitize_error(e)}")
1350
1376
 
1351
1377
 
1378
+ # ============================================================================
1379
+ # v2.8 MCP TOOLS — Lifecycle, Behavioral Learning, Compliance
1380
+ # ============================================================================
1381
+
1382
+ try:
1383
+ from mcp_tools_v28 import (
1384
+ report_outcome as _report_outcome,
1385
+ get_lifecycle_status as _get_lifecycle_status,
1386
+ set_retention_policy as _set_retention_policy,
1387
+ compact_memories as _compact_memories,
1388
+ get_behavioral_patterns as _get_behavioral_patterns,
1389
+ audit_trail as _audit_trail,
1390
+ )
1391
+
1392
+ V28_AVAILABLE = True
1393
+
1394
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
1395
+ async def report_outcome(
1396
+ memory_ids: list,
1397
+ outcome: str,
1398
+ action_type: str = "other",
1399
+ context: str = None,
1400
+ agent_id: str = "user",
1401
+ project: str = None,
1402
+ ) -> dict:
1403
+ """Record action outcome for behavioral learning. Outcomes: success/failure/partial."""
1404
+ return await _report_outcome(memory_ids, outcome, action_type, context, agent_id, project)
1405
+
1406
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
1407
+ async def get_lifecycle_status(memory_id: int = None) -> dict:
1408
+ """Get memory lifecycle status — state distribution or single memory state."""
1409
+ return await _get_lifecycle_status(memory_id)
1410
+
1411
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
1412
+ async def set_retention_policy(
1413
+ name: str,
1414
+ framework: str,
1415
+ retention_days: int,
1416
+ action: str = "retain",
1417
+ applies_to_tags: list = None,
1418
+ applies_to_project: str = None,
1419
+ ) -> dict:
1420
+ """Create a retention policy (GDPR, HIPAA, EU AI Act)."""
1421
+ return await _set_retention_policy(
1422
+ name, framework, retention_days, action, applies_to_tags, applies_to_project
1423
+ )
1424
+
1425
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
1426
+ async def compact_memories(dry_run: bool = True, profile: str = None) -> dict:
1427
+ """Evaluate and compact stale memories through lifecycle transitions. dry_run=True by default.
1428
+
1429
+ Args:
1430
+ dry_run: If True (default), show what would happen without changes.
1431
+ profile: Profile name to filter.
1432
+ """
1433
+ return await _compact_memories(dry_run, profile)
1434
+
1435
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
1436
+ async def get_behavioral_patterns(
1437
+ min_confidence: float = 0.0, project: str = None
1438
+ ) -> dict:
1439
+ """Get learned behavioral patterns from outcome analysis."""
1440
+ return await _get_behavioral_patterns(min_confidence, project)
1441
+
1442
+ @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
1443
+ async def audit_trail(
1444
+ event_type: str = None,
1445
+ actor: str = None,
1446
+ limit: int = 50,
1447
+ verify_chain: bool = False,
1448
+ ) -> dict:
1449
+ """Query compliance audit trail with optional hash chain verification."""
1450
+ return await _audit_trail(event_type, actor, limit, verify_chain)
1451
+
1452
+ except ImportError:
1453
+ V28_AVAILABLE = False # v2.8 tools unavailable — graceful degradation
1454
+
1455
+
1352
1456
  # ============================================================================
1353
1457
  # MCP RESOURCES (Data endpoints)
1354
1458
  # ============================================================================
@@ -1580,12 +1684,19 @@ if __name__ == "__main__":
1580
1684
  print(" - list_recent(limit)", file=sys.stderr)
1581
1685
  print(" - get_status()", file=sys.stderr)
1582
1686
  print(" - build_graph()", file=sys.stderr)
1583
- print(" - switch_profile(name)", file=sys.stderr)
1687
+ print(" - switch_profile(name) [Project/Profile switch]", file=sys.stderr)
1584
1688
  print(" - backup_status() [Auto-Backup]", file=sys.stderr)
1585
1689
  if LEARNING_AVAILABLE:
1586
1690
  print(" - memory_used(memory_id, query, usefulness) [v2.7 Learning]", file=sys.stderr)
1587
1691
  print(" - get_learned_patterns(min_confidence, category) [v2.7 Learning]", file=sys.stderr)
1588
1692
  print(" - correct_pattern(pattern_id, correct_value) [v2.7 Learning]", file=sys.stderr)
1693
+ if V28_AVAILABLE:
1694
+ print(" - report_outcome(memory_ids, outcome) [v2.8 Behavioral]", file=sys.stderr)
1695
+ print(" - get_lifecycle_status(memory_id) [v2.8 Lifecycle]", file=sys.stderr)
1696
+ print(" - set_retention_policy(name, framework, days) [v2.8 Compliance]", file=sys.stderr)
1697
+ print(" - compact_memories(dry_run) [v2.8 Lifecycle]", file=sys.stderr)
1698
+ print(" - get_behavioral_patterns(min_confidence) [v2.8 Behavioral]", file=sys.stderr)
1699
+ print(" - audit_trail(event_type, verify_chain) [v2.8 Compliance]", file=sys.stderr)
1589
1700
  print("", file=sys.stderr)
1590
1701
  print("MCP Resources Available:", file=sys.stderr)
1591
1702
  print(" - memory://recent/{limit}", file=sys.stderr)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "2.7.6",
3
+ "version": "2.8.1",
4
4
  "description": "Your AI Finally Remembers You - Local-first intelligent memory system for AI assistants. Works with Claude, Cursor, Windsurf, VS Code/Copilot, Codex, and 17+ AI tools. 100% local, zero cloud dependencies.",
5
5
  "keywords": [
6
6
  "ai-memory",
@@ -94,13 +94,6 @@
94
94
  "url": "https://github.com/varun369"
95
95
  }
96
96
  ],
97
- "attribution": {
98
- "creator": "Varun Pratap Bhardwaj",
99
- "role": "Solution Architect & Original Creator",
100
- "year": "2026",
101
- "github": "https://github.com/varun369",
102
- "required": "Attribution notice must be preserved in all copies and derivative works"
103
- },
104
97
  "dependencies": {
105
98
  "docx": "^9.5.1"
106
99
  }
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - Thumbnail Generator
4
- Copyright (c) 2026 Varun Pratap Bhardwaj
5
- Licensed under MIT License
2
+ # SPDX-License-Identifier: MIT
3
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
4
+ """SuperLocalMemory V2 - Thumbnail Generator
6
5
 
7
6
  Generates optimized thumbnail versions of all screenshots.
8
7
  - Size: 320×180px (16:9 ratio)
@@ -10,7 +9,6 @@ Generates optimized thumbnail versions of all screenshots.
10
9
  - Quality: High enough to recognize content
11
10
  - File size: < 50KB per thumbnail
12
11
  """
13
-
14
12
  import os
15
13
  import json
16
14
  from pathlib import Path
@@ -417,7 +417,7 @@ Each profile has separate graph
417
417
 
418
418
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
419
419
  **Project:** SuperLocalMemory V2
420
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
420
+ **License:** MIT (see [LICENSE](../../LICENSE))
421
421
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
422
422
 
423
423
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -336,13 +336,13 @@ date
336
336
  - `slm remember` - Save a new memory
337
337
  - `slm recall` - Search memories by relevance
338
338
  - `slm status` - Check memory count and stats
339
- - `slm switch-profile` - View different project's memories
339
+ - `slm switch-profile` - View different profile's memories
340
340
 
341
341
  ---
342
342
 
343
343
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
344
344
  **Project:** SuperLocalMemory V2
345
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
345
+ **License:** MIT (see [LICENSE](../../LICENSE))
346
346
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
347
347
 
348
348
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -320,7 +320,7 @@ slm recall "query" --format csv
320
320
 
321
321
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
322
322
  **Project:** SuperLocalMemory V2
323
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
323
+ **License:** MIT (see [LICENSE](../../LICENSE))
324
324
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
325
325
 
326
326
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -157,7 +157,7 @@ slm remember "Commit: $commit_msg (${commit_hash:0:7})" \
157
157
  - **Cross-tool sync:** All AI tools access same database (Cursor, ChatGPT, Claude, etc.)
158
158
  - **Unlimited:** No memory limits, no quotas
159
159
  - **Privacy:** Your data stays on your computer
160
- - **Profiles:** Use `slm switch-profile` for project isolation
160
+ - **Profiles:** Use `slm switch-profile` for profile isolation
161
161
 
162
162
  ## Related Commands
163
163
 
@@ -188,7 +188,7 @@ slm remember "Commit: $commit_msg (${commit_hash:0:7})" \
188
188
 
189
189
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
190
190
  **Project:** SuperLocalMemory V2
191
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
191
+ **License:** MIT (see [LICENSE](../../LICENSE))
192
192
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
193
193
 
194
194
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -218,7 +218,7 @@ slm engagement
218
218
 
219
219
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
220
220
  **Project:** SuperLocalMemory V2
221
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
221
+ **License:** MIT (see [LICENSE](../../LICENSE))
222
222
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
223
223
 
224
224
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -155,7 +155,7 @@ Corrupted Entries: 0 found
155
155
  - **Last Used:** Last access timestamp
156
156
 
157
157
  **Profiles allow:**
158
- - Project isolation
158
+ - Profile isolation
159
159
  - Context switching
160
160
  - Separate memory spaces
161
161
 
@@ -357,7 +357,7 @@ slm build-graph
357
357
 
358
358
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
359
359
  **Project:** SuperLocalMemory V2
360
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
360
+ **License:** MIT (see [LICENSE](../../LICENSE))
361
361
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
362
362
 
363
363
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: slm-switch-profile
3
- description: Switch between memory profiles for project isolation and context management. Use when the user wants to change project context, separate work/personal memories, or manage multiple independent memory spaces. Each profile has its own database, graph, and patterns.
3
+ description: Switch between memory profiles for context isolation and management. Use when the user wants to change profile context, separate work/personal memories, or manage multiple independent memory spaces. Each profile has its own database, graph, and patterns.
4
4
  version: "2.1.0"
5
5
  license: MIT
6
6
  compatibility: "Requires SuperLocalMemory V2 installed at ~/.claude-memory/"
@@ -26,8 +26,8 @@ slm switch-profile <name> [--create]
26
26
 
27
27
  Each profile has its own:
28
28
  - ✅ **Separate database** - Zero context bleeding
29
- - ✅ **Independent knowledge graph** - Project-specific relationships
30
- - ✅ **Unique patterns** - Different coding preferences per project
29
+ - ✅ **Independent knowledge graph** - Profile-specific relationships
30
+ - ✅ **Unique patterns** - Different coding preferences per profile
31
31
  - ✅ **Isolated history** - No cross-contamination
32
32
 
33
33
  **Think of profiles as workspaces:**
@@ -436,7 +436,7 @@ slm list-profiles
436
436
 
437
437
  **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
438
438
  **Project:** SuperLocalMemory V2
439
- **License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
439
+ **License:** MIT (see [LICENSE](../../LICENSE))
440
440
  **Repository:** https://github.com/varun369/SuperLocalMemoryV2
441
441
 
442
442
  *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -1,22 +1,12 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - Agent Registry
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
  AgentRegistry — Tracks which AI agents connect to SuperLocalMemory,
16
6
  what they write, when, and via which protocol.
17
7
 
18
- Every MCP client (Claude, Cursor, Windsurf), CLI call, REST API request,
19
- and future A2A agent gets registered here. This powers:
8
+ Every MCP client (Claude, Cursor, Windsurf), CLI call, and REST API request
9
+ gets registered here. This powers:
20
10
  - Dashboard "Connected Agents" panel
21
11
  - Trust scoring input (v2.5 silent collection)
22
12
  - Provenance tracking (who created which memory)
@@ -31,7 +21,6 @@ Protocols:
31
21
  cli — Command-line interface (slm command, bin/ scripts)
32
22
  rest — REST API (api_server.py)
33
23
  python — Direct Python import
34
- a2a — Agent-to-Agent Protocol (v2.7+)
35
24
  """
36
25
 
37
26
  import json
@@ -155,7 +144,7 @@ class AgentRegistry:
155
144
  Args:
156
145
  agent_id: Unique identifier (e.g., "mcp:claude-desktop")
157
146
  agent_name: Human-readable name (e.g., "Claude Desktop")
158
- protocol: Connection protocol (mcp, cli, rest, python, a2a)
147
+ protocol: Connection protocol (mcp, cli, rest, python)
159
148
  metadata: Additional agent info (version, capabilities, etc.)
160
149
 
161
150
  Returns:
@@ -164,7 +153,7 @@ class AgentRegistry:
164
153
  if not agent_id or not isinstance(agent_id, str):
165
154
  raise ValueError("agent_id must be a non-empty string")
166
155
 
167
- valid_protocols = ("mcp", "cli", "rest", "python", "a2a")
156
+ valid_protocols = ("mcp", "cli", "rest", "python")
168
157
  if protocol not in valid_protocols:
169
158
  raise ValueError(f"Invalid protocol: {protocol}. Must be one of {valid_protocols}")
170
159
 
@@ -283,7 +272,7 @@ class AgentRegistry:
283
272
  List registered agents with optional filtering.
284
273
 
285
274
  Args:
286
- protocol: Filter by protocol (mcp, cli, rest, python, a2a)
275
+ protocol: Filter by protocol (mcp, cli, rest, python)
287
276
  limit: Max agents to return
288
277
  active_since_hours: Only agents seen within N hours
289
278
 
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - Optional API Key Authentication
4
- Copyright (c) 2026 Varun Pratap Bhardwaj
5
- Licensed under MIT License
2
+ # SPDX-License-Identifier: MIT
3
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
4
+ """SuperLocalMemory V2 - Optional API Key Authentication
6
5
 
7
6
  Opt-in API key authentication for dashboard and API endpoints.
8
7
  When ~/.claude-memory/api_key file exists, write endpoints require
9
8
  X-SLM-API-Key header. Read endpoints remain open for backward compatibility.
10
9
  """
11
-
12
10
  import os
13
11
  import hashlib
14
12
  import logging
@@ -1,10 +1,7 @@
1
1
  #!/usr/bin/env python3
2
- """
3
- SuperLocalMemory V2 - Auto Backup System
4
- Copyright (c) 2026 Varun Pratap Bhardwaj
5
- Licensed under MIT License
6
-
7
- Repository: https://github.com/varun369/SuperLocalMemoryV2
2
+ # SPDX-License-Identifier: MIT
3
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
4
+ """SuperLocalMemory V2 - Auto Backup System
8
5
 
9
6
  Automated backup system for memory.db:
10
7
  - Configurable interval: 24h (daily) or 7 days (weekly, default)
@@ -13,7 +10,6 @@ Automated backup system for memory.db:
13
10
  - Auto-triggers on memory operations when backup is due
14
11
  - Manual backup via CLI
15
12
  """
16
-
17
13
  import sqlite3
18
14
  import shutil
19
15
  import json
@@ -0,0 +1,49 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # Copyright (c) 2026 SuperLocalMemory (superlocalmemory.com)
3
+ """SLM v2.8 Behavioral Learning Engine — Action Outcome Learning.
4
+
5
+ Tracks what happens AFTER memories are recalled (success/failure/partial).
6
+ Extracts behavioral patterns. Transfers across projects (privacy-safe).
7
+ All local, zero-LLM.
8
+
9
+ Graceful degradation: if this module fails to import,
10
+ adaptive ranking continues with v2.7 features only.
11
+ """
12
+ import threading
13
+ from pathlib import Path
14
+ from typing import Optional, Dict, Any
15
+
16
+ BEHAVIORAL_AVAILABLE = False
17
+ _init_error = None
18
+
19
+ try:
20
+ from .outcome_tracker import OutcomeTracker
21
+ from .behavioral_patterns import BehavioralPatternExtractor
22
+ BEHAVIORAL_AVAILABLE = True
23
+ except ImportError as e:
24
+ _init_error = str(e)
25
+
26
+ _outcome_tracker: Optional["OutcomeTracker"] = None
27
+ _tracker_lock = threading.Lock()
28
+
29
+
30
+ def get_outcome_tracker(db_path: Optional[Path] = None) -> Optional["OutcomeTracker"]:
31
+ """Get or create the outcome tracker singleton."""
32
+ global _outcome_tracker
33
+ if not BEHAVIORAL_AVAILABLE:
34
+ return None
35
+ with _tracker_lock:
36
+ if _outcome_tracker is None:
37
+ try:
38
+ _outcome_tracker = OutcomeTracker(db_path)
39
+ except Exception:
40
+ return None
41
+ return _outcome_tracker
42
+
43
+
44
+ def get_status() -> Dict[str, Any]:
45
+ return {
46
+ "behavioral_available": BEHAVIORAL_AVAILABLE,
47
+ "init_error": _init_error,
48
+ "tracker_active": _outcome_tracker is not None,
49
+ }