superlocalmemory 2.7.5 → 2.8.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.
- package/CHANGELOG.md +120 -155
- package/README.md +115 -89
- package/api_server.py +2 -12
- package/docs/PATTERN-LEARNING.md +64 -199
- package/docs/example_graph_usage.py +4 -6
- package/install.ps1 +226 -0
- package/install.sh +59 -0
- package/mcp_server.py +83 -7
- package/package.json +3 -10
- package/scripts/generate-thumbnails.py +3 -5
- package/skills/slm-build-graph/SKILL.md +1 -1
- package/skills/slm-list-recent/SKILL.md +1 -1
- package/skills/slm-recall/SKILL.md +1 -1
- package/skills/slm-remember/SKILL.md +1 -1
- package/skills/slm-show-patterns/SKILL.md +1 -1
- package/skills/slm-status/SKILL.md +1 -1
- package/skills/slm-switch-profile/SKILL.md +1 -1
- package/src/agent_registry.py +7 -18
- package/src/auth_middleware.py +3 -5
- package/src/auto_backup.py +3 -7
- package/src/behavioral/__init__.py +49 -0
- package/src/behavioral/behavioral_listener.py +203 -0
- package/src/behavioral/behavioral_patterns.py +275 -0
- package/src/behavioral/cross_project_transfer.py +206 -0
- package/src/behavioral/outcome_inference.py +194 -0
- package/src/behavioral/outcome_tracker.py +193 -0
- package/src/behavioral/tests/__init__.py +4 -0
- package/src/behavioral/tests/test_behavioral_integration.py +108 -0
- package/src/behavioral/tests/test_behavioral_patterns.py +150 -0
- package/src/behavioral/tests/test_cross_project_transfer.py +142 -0
- package/src/behavioral/tests/test_mcp_behavioral.py +139 -0
- package/src/behavioral/tests/test_mcp_report_outcome.py +117 -0
- package/src/behavioral/tests/test_outcome_inference.py +107 -0
- package/src/behavioral/tests/test_outcome_tracker.py +96 -0
- package/src/cache_manager.py +4 -6
- package/src/compliance/__init__.py +48 -0
- package/src/compliance/abac_engine.py +149 -0
- package/src/compliance/abac_middleware.py +116 -0
- package/src/compliance/audit_db.py +215 -0
- package/src/compliance/audit_logger.py +148 -0
- package/src/compliance/retention_manager.py +289 -0
- package/src/compliance/retention_scheduler.py +186 -0
- package/src/compliance/tests/__init__.py +4 -0
- package/src/compliance/tests/test_abac_enforcement.py +95 -0
- package/src/compliance/tests/test_abac_engine.py +124 -0
- package/src/compliance/tests/test_abac_mcp_integration.py +118 -0
- package/src/compliance/tests/test_audit_db.py +123 -0
- package/src/compliance/tests/test_audit_logger.py +98 -0
- package/src/compliance/tests/test_mcp_audit.py +128 -0
- package/src/compliance/tests/test_mcp_retention_policy.py +125 -0
- package/src/compliance/tests/test_retention_manager.py +131 -0
- package/src/compliance/tests/test_retention_scheduler.py +99 -0
- package/src/db_connection_manager.py +2 -12
- package/src/embedding_engine.py +61 -669
- package/src/embeddings/__init__.py +47 -0
- package/src/embeddings/cache.py +70 -0
- package/src/embeddings/cli.py +113 -0
- package/src/embeddings/constants.py +47 -0
- package/src/embeddings/database.py +91 -0
- package/src/embeddings/engine.py +247 -0
- package/src/embeddings/model_loader.py +145 -0
- package/src/event_bus.py +3 -13
- package/src/graph/__init__.py +36 -0
- package/src/graph/build_helpers.py +74 -0
- package/src/graph/cli.py +87 -0
- package/src/graph/cluster_builder.py +188 -0
- package/src/graph/cluster_summary.py +148 -0
- package/src/graph/constants.py +47 -0
- package/src/graph/edge_builder.py +162 -0
- package/src/graph/entity_extractor.py +95 -0
- package/src/graph/graph_core.py +226 -0
- package/src/graph/graph_search.py +231 -0
- package/src/graph/hierarchical.py +207 -0
- package/src/graph/schema.py +99 -0
- package/src/graph_engine.py +45 -1451
- package/src/hnsw_index.py +3 -7
- package/src/hybrid_search.py +36 -683
- package/src/learning/__init__.py +27 -12
- package/src/learning/adaptive_ranker.py +50 -12
- package/src/learning/cross_project_aggregator.py +2 -12
- package/src/learning/engagement_tracker.py +2 -12
- package/src/learning/feature_extractor.py +175 -43
- package/src/learning/feedback_collector.py +7 -12
- package/src/learning/learning_db.py +180 -12
- package/src/learning/project_context_manager.py +2 -12
- package/src/learning/source_quality_scorer.py +2 -12
- package/src/learning/synthetic_bootstrap.py +2 -12
- package/src/learning/tests/__init__.py +2 -0
- package/src/learning/tests/test_adaptive_ranker.py +2 -6
- package/src/learning/tests/test_adaptive_ranker_v28.py +60 -0
- package/src/learning/tests/test_aggregator.py +2 -6
- package/src/learning/tests/test_auto_retrain_v28.py +35 -0
- package/src/learning/tests/test_e2e_ranking_v28.py +82 -0
- package/src/learning/tests/test_feature_extractor_v28.py +93 -0
- package/src/learning/tests/test_feedback_collector.py +2 -6
- package/src/learning/tests/test_learning_db.py +2 -6
- package/src/learning/tests/test_learning_db_v28.py +110 -0
- package/src/learning/tests/test_learning_init_v28.py +48 -0
- package/src/learning/tests/test_outcome_signals.py +48 -0
- package/src/learning/tests/test_project_context.py +2 -6
- package/src/learning/tests/test_schema_migration.py +319 -0
- package/src/learning/tests/test_signal_inference.py +11 -13
- package/src/learning/tests/test_source_quality.py +2 -6
- package/src/learning/tests/test_synthetic_bootstrap.py +3 -7
- package/src/learning/tests/test_workflow_miner.py +2 -6
- package/src/learning/workflow_pattern_miner.py +2 -12
- package/src/lifecycle/__init__.py +54 -0
- package/src/lifecycle/bounded_growth.py +239 -0
- package/src/lifecycle/compaction_engine.py +226 -0
- package/src/lifecycle/lifecycle_engine.py +302 -0
- package/src/lifecycle/lifecycle_evaluator.py +225 -0
- package/src/lifecycle/lifecycle_scheduler.py +130 -0
- package/src/lifecycle/retention_policy.py +285 -0
- package/src/lifecycle/tests/__init__.py +4 -0
- package/src/lifecycle/tests/test_bounded_growth.py +193 -0
- package/src/lifecycle/tests/test_compaction.py +179 -0
- package/src/lifecycle/tests/test_lifecycle_engine.py +137 -0
- package/src/lifecycle/tests/test_lifecycle_evaluation.py +177 -0
- package/src/lifecycle/tests/test_lifecycle_scheduler.py +127 -0
- package/src/lifecycle/tests/test_lifecycle_search.py +109 -0
- package/src/lifecycle/tests/test_mcp_compact.py +149 -0
- package/src/lifecycle/tests/test_mcp_lifecycle_status.py +114 -0
- package/src/lifecycle/tests/test_retention_policy.py +162 -0
- package/src/mcp_tools_v28.py +280 -0
- package/src/memory-profiles.py +2 -12
- package/src/memory-reset.py +2 -12
- package/src/memory_compression.py +2 -12
- package/src/memory_store_v2.py +76 -20
- package/src/migrate_v1_to_v2.py +2 -12
- package/src/pattern_learner.py +29 -975
- package/src/patterns/__init__.py +24 -0
- package/src/patterns/analyzers.py +247 -0
- package/src/patterns/learner.py +267 -0
- package/src/patterns/scoring.py +167 -0
- package/src/patterns/store.py +223 -0
- package/src/patterns/terminology.py +138 -0
- package/src/provenance_tracker.py +4 -14
- package/src/query_optimizer.py +4 -6
- package/src/rate_limiter.py +2 -6
- package/src/search/__init__.py +20 -0
- package/src/search/cli.py +77 -0
- package/src/search/constants.py +26 -0
- package/src/search/engine.py +239 -0
- package/src/search/fusion.py +122 -0
- package/src/search/index_loader.py +112 -0
- package/src/search/methods.py +162 -0
- package/src/search_engine_v2.py +4 -6
- package/src/setup_validator.py +7 -13
- package/src/subscription_manager.py +2 -12
- package/src/tree/__init__.py +59 -0
- package/src/tree/builder.py +183 -0
- package/src/tree/nodes.py +196 -0
- package/src/tree/queries.py +252 -0
- package/src/tree/schema.py +76 -0
- package/src/tree_manager.py +10 -711
- package/src/trust/__init__.py +45 -0
- package/src/trust/constants.py +66 -0
- package/src/trust/queries.py +157 -0
- package/src/trust/schema.py +95 -0
- package/src/trust/scorer.py +299 -0
- package/src/trust/signals.py +95 -0
- package/src/trust_scorer.py +39 -697
- package/src/webhook_dispatcher.py +2 -12
- package/ui/app.js +1 -1
- package/ui/index.html +3 -0
- package/ui/js/agents.js +1 -1
- package/ui/js/core.js +21 -5
- package/ui/js/profiles.js +29 -7
- package/ui_server.py +2 -14
- package/ATTRIBUTION.md +0 -140
- package/docs/ARCHITECTURE-V2.5.md +0 -190
- package/docs/GRAPH-ENGINE.md +0 -503
- package/docs/architecture-diagram.drawio +0 -405
- package/docs/plans/2026-02-13-benchmark-suite.md +0 -1349
package/install.sh
CHANGED
|
@@ -164,6 +164,27 @@ if [ -d "${REPO_DIR}/src/learning" ]; then
|
|
|
164
164
|
echo "✓ Learning modules copied"
|
|
165
165
|
fi
|
|
166
166
|
|
|
167
|
+
# Copy lifecycle modules (v2.8+)
|
|
168
|
+
if [ -d "${REPO_DIR}/src/lifecycle" ]; then
|
|
169
|
+
mkdir -p "${INSTALL_DIR}/lifecycle"
|
|
170
|
+
cp -r "${REPO_DIR}/src/lifecycle/"* "${INSTALL_DIR}/lifecycle/"
|
|
171
|
+
echo "✓ Lifecycle modules copied"
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
# Copy behavioral modules (v2.8+)
|
|
175
|
+
if [ -d "${REPO_DIR}/src/behavioral" ]; then
|
|
176
|
+
mkdir -p "${INSTALL_DIR}/behavioral"
|
|
177
|
+
cp -r "${REPO_DIR}/src/behavioral/"* "${INSTALL_DIR}/behavioral/"
|
|
178
|
+
echo "✓ Behavioral modules copied"
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
# Copy compliance modules (v2.8+)
|
|
182
|
+
if [ -d "${REPO_DIR}/src/compliance" ]; then
|
|
183
|
+
mkdir -p "${INSTALL_DIR}/compliance"
|
|
184
|
+
cp -r "${REPO_DIR}/src/compliance/"* "${INSTALL_DIR}/compliance/"
|
|
185
|
+
echo "✓ Compliance modules copied"
|
|
186
|
+
fi
|
|
187
|
+
|
|
167
188
|
# Copy hooks
|
|
168
189
|
echo "Copying hooks..."
|
|
169
190
|
mkdir -p "${INSTALL_DIR}/hooks"
|
|
@@ -230,8 +251,41 @@ mkdir -p "${INSTALL_DIR}/profiles"
|
|
|
230
251
|
mkdir -p "${INSTALL_DIR}/vectors"
|
|
231
252
|
mkdir -p "${INSTALL_DIR}/cold-storage"
|
|
232
253
|
mkdir -p "${INSTALL_DIR}/jobs"
|
|
254
|
+
mkdir -p "${INSTALL_DIR}/policies"
|
|
233
255
|
echo "✓ Directories created"
|
|
234
256
|
|
|
257
|
+
# Initialize audit database (v2.8+ — compliance engine)
|
|
258
|
+
if [ ! -f "${INSTALL_DIR}/audit.db" ]; then
|
|
259
|
+
python3 -c "
|
|
260
|
+
import sqlite3
|
|
261
|
+
from pathlib import Path
|
|
262
|
+
audit_path = Path.home() / '.claude-memory' / 'audit.db'
|
|
263
|
+
conn = sqlite3.connect(audit_path)
|
|
264
|
+
cursor = conn.cursor()
|
|
265
|
+
cursor.execute('''CREATE TABLE IF NOT EXISTS audit_events (
|
|
266
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
267
|
+
event_type TEXT NOT NULL,
|
|
268
|
+
actor TEXT,
|
|
269
|
+
target TEXT,
|
|
270
|
+
action TEXT,
|
|
271
|
+
detail TEXT,
|
|
272
|
+
hash TEXT,
|
|
273
|
+
prev_hash TEXT,
|
|
274
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
275
|
+
)''')
|
|
276
|
+
cursor.execute('''CREATE TABLE IF NOT EXISTS retention_policies (
|
|
277
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
278
|
+
policy_name TEXT UNIQUE NOT NULL,
|
|
279
|
+
retention_days INTEGER,
|
|
280
|
+
auto_delete INTEGER DEFAULT 0,
|
|
281
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
282
|
+
)''')
|
|
283
|
+
conn.commit()
|
|
284
|
+
conn.close()
|
|
285
|
+
print('Audit database ready')
|
|
286
|
+
" 2>/dev/null && echo "✓ Audit database initialized (v2.8)" || echo "○ Audit database skipped (optional)"
|
|
287
|
+
fi
|
|
288
|
+
|
|
235
289
|
# Make Python scripts executable
|
|
236
290
|
chmod +x "${INSTALL_DIR}/"*.py 2>/dev/null || true
|
|
237
291
|
|
|
@@ -799,6 +853,11 @@ echo "Learning System (v2.7+):"
|
|
|
799
853
|
echo " slm learning status - Check learning system"
|
|
800
854
|
echo " slm engagement - View engagement metrics"
|
|
801
855
|
echo ""
|
|
856
|
+
echo "Lifecycle & Compliance (v2.8+):"
|
|
857
|
+
echo " slm lifecycle-status - View memory lifecycle states"
|
|
858
|
+
echo " slm compact --dry-run - Preview lifecycle transitions"
|
|
859
|
+
echo " slm behavioral-patterns - View learned patterns"
|
|
860
|
+
echo ""
|
|
802
861
|
# Optional: Offer to install optional features
|
|
803
862
|
if [ "$NON_INTERACTIVE" = true ]; then
|
|
804
863
|
INSTALL_CHOICE="N"
|
package/mcp_server.py
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
@@ -1349,6 +1345,79 @@ async def fetch(id: str) -> dict:
|
|
|
1349
1345
|
raise ValueError(f"Failed to fetch memory {id}: {_sanitize_error(e)}")
|
|
1350
1346
|
|
|
1351
1347
|
|
|
1348
|
+
# ============================================================================
|
|
1349
|
+
# v2.8 MCP TOOLS — Lifecycle, Behavioral Learning, Compliance
|
|
1350
|
+
# ============================================================================
|
|
1351
|
+
|
|
1352
|
+
try:
|
|
1353
|
+
from mcp_tools_v28 import (
|
|
1354
|
+
report_outcome as _report_outcome,
|
|
1355
|
+
get_lifecycle_status as _get_lifecycle_status,
|
|
1356
|
+
set_retention_policy as _set_retention_policy,
|
|
1357
|
+
compact_memories as _compact_memories,
|
|
1358
|
+
get_behavioral_patterns as _get_behavioral_patterns,
|
|
1359
|
+
audit_trail as _audit_trail,
|
|
1360
|
+
)
|
|
1361
|
+
|
|
1362
|
+
V28_AVAILABLE = True
|
|
1363
|
+
|
|
1364
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
|
|
1365
|
+
async def report_outcome(
|
|
1366
|
+
memory_ids: list,
|
|
1367
|
+
outcome: str,
|
|
1368
|
+
action_type: str = "other",
|
|
1369
|
+
context: str = None,
|
|
1370
|
+
agent_id: str = "user",
|
|
1371
|
+
project: str = None,
|
|
1372
|
+
) -> dict:
|
|
1373
|
+
"""Record action outcome for behavioral learning. Outcomes: success/failure/partial."""
|
|
1374
|
+
return await _report_outcome(memory_ids, outcome, action_type, context, agent_id, project)
|
|
1375
|
+
|
|
1376
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
|
|
1377
|
+
async def get_lifecycle_status(memory_id: int = None) -> dict:
|
|
1378
|
+
"""Get memory lifecycle status — state distribution or single memory state."""
|
|
1379
|
+
return await _get_lifecycle_status(memory_id)
|
|
1380
|
+
|
|
1381
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
|
|
1382
|
+
async def set_retention_policy(
|
|
1383
|
+
name: str,
|
|
1384
|
+
framework: str,
|
|
1385
|
+
retention_days: int,
|
|
1386
|
+
action: str = "retain",
|
|
1387
|
+
applies_to_tags: list = None,
|
|
1388
|
+
applies_to_project: str = None,
|
|
1389
|
+
) -> dict:
|
|
1390
|
+
"""Create a retention policy (GDPR, HIPAA, EU AI Act)."""
|
|
1391
|
+
return await _set_retention_policy(
|
|
1392
|
+
name, framework, retention_days, action, applies_to_tags, applies_to_project
|
|
1393
|
+
)
|
|
1394
|
+
|
|
1395
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=False, destructiveHint=False))
|
|
1396
|
+
async def compact_memories(dry_run: bool = True, profile: str = None) -> dict:
|
|
1397
|
+
"""Evaluate and compact stale memories through lifecycle transitions. dry_run=True by default."""
|
|
1398
|
+
return await _compact_memories(dry_run, profile)
|
|
1399
|
+
|
|
1400
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
|
|
1401
|
+
async def get_behavioral_patterns(
|
|
1402
|
+
min_confidence: float = 0.0, project: str = None
|
|
1403
|
+
) -> dict:
|
|
1404
|
+
"""Get learned behavioral patterns from outcome analysis."""
|
|
1405
|
+
return await _get_behavioral_patterns(min_confidence, project)
|
|
1406
|
+
|
|
1407
|
+
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False))
|
|
1408
|
+
async def audit_trail(
|
|
1409
|
+
event_type: str = None,
|
|
1410
|
+
actor: str = None,
|
|
1411
|
+
limit: int = 50,
|
|
1412
|
+
verify_chain: bool = False,
|
|
1413
|
+
) -> dict:
|
|
1414
|
+
"""Query compliance audit trail with optional hash chain verification."""
|
|
1415
|
+
return await _audit_trail(event_type, actor, limit, verify_chain)
|
|
1416
|
+
|
|
1417
|
+
except ImportError:
|
|
1418
|
+
V28_AVAILABLE = False # v2.8 tools unavailable — graceful degradation
|
|
1419
|
+
|
|
1420
|
+
|
|
1352
1421
|
# ============================================================================
|
|
1353
1422
|
# MCP RESOURCES (Data endpoints)
|
|
1354
1423
|
# ============================================================================
|
|
@@ -1586,6 +1655,13 @@ if __name__ == "__main__":
|
|
|
1586
1655
|
print(" - memory_used(memory_id, query, usefulness) [v2.7 Learning]", file=sys.stderr)
|
|
1587
1656
|
print(" - get_learned_patterns(min_confidence, category) [v2.7 Learning]", file=sys.stderr)
|
|
1588
1657
|
print(" - correct_pattern(pattern_id, correct_value) [v2.7 Learning]", file=sys.stderr)
|
|
1658
|
+
if V28_AVAILABLE:
|
|
1659
|
+
print(" - report_outcome(memory_ids, outcome) [v2.8 Behavioral]", file=sys.stderr)
|
|
1660
|
+
print(" - get_lifecycle_status(memory_id) [v2.8 Lifecycle]", file=sys.stderr)
|
|
1661
|
+
print(" - set_retention_policy(name, framework, days) [v2.8 Compliance]", file=sys.stderr)
|
|
1662
|
+
print(" - compact_memories(dry_run) [v2.8 Lifecycle]", file=sys.stderr)
|
|
1663
|
+
print(" - get_behavioral_patterns(min_confidence) [v2.8 Behavioral]", file=sys.stderr)
|
|
1664
|
+
print(" - audit_trail(event_type, verify_chain) [v2.8 Compliance]", file=sys.stderr)
|
|
1589
1665
|
print("", file=sys.stderr)
|
|
1590
1666
|
print("MCP Resources Available:", file=sys.stderr)
|
|
1591
1667
|
print(" - memory://recent/{limit}", file=sys.stderr)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superlocalmemory",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"author": {
|
|
28
28
|
"name": "Varun Pratap Bhardwaj",
|
|
29
|
-
"email": "
|
|
29
|
+
"email": "admin@superlocalmemory.com",
|
|
30
30
|
"url": "https://github.com/varun369"
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
@@ -90,17 +90,10 @@
|
|
|
90
90
|
"maintainers": [
|
|
91
91
|
{
|
|
92
92
|
"name": "Varun Pratap Bhardwaj",
|
|
93
|
-
"email": "
|
|
93
|
+
"email": "admin@superlocalmemory.com",
|
|
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
|
-
|
|
4
|
-
|
|
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
|
|
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.*
|
|
@@ -342,7 +342,7 @@ date
|
|
|
342
342
|
|
|
343
343
|
**Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
|
|
344
344
|
**Project:** SuperLocalMemory V2
|
|
345
|
-
**License:** MIT
|
|
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
|
|
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.*
|
|
@@ -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
|
|
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
|
|
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.*
|
|
@@ -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
|
|
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.*
|
|
@@ -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
|
|
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.*
|
package/src/agent_registry.py
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
|
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"
|
|
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
|
|
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
|
|
package/src/auth_middleware.py
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
package/src/auto_backup.py
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
}
|