superlocalmemory 2.8.5 → 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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +9 -1
- package/NOTICE +63 -0
- package/README.md +165 -480
- package/bin/slm +17 -449
- package/bin/slm-npm +2 -2
- package/bin/slm.bat +4 -2
- package/conftest.py +5 -0
- package/docs/api-reference.md +284 -0
- package/docs/architecture.md +149 -0
- package/docs/auto-memory.md +150 -0
- package/docs/cli-reference.md +276 -0
- package/docs/compliance.md +191 -0
- package/docs/configuration.md +182 -0
- package/docs/getting-started.md +102 -0
- package/docs/ide-setup.md +261 -0
- package/docs/mcp-tools.md +220 -0
- package/docs/migration-from-v2.md +170 -0
- package/docs/profiles.md +173 -0
- package/docs/troubleshooting.md +310 -0
- package/{configs → ide/configs}/antigravity-mcp.json +3 -3
- package/ide/configs/chatgpt-desktop-mcp.json +16 -0
- package/{configs → ide/configs}/claude-desktop-mcp.json +3 -3
- package/{configs → ide/configs}/codex-mcp.toml +4 -4
- package/{configs → ide/configs}/continue-mcp.yaml +4 -3
- package/{configs → ide/configs}/continue-skills.yaml +6 -6
- package/ide/configs/cursor-mcp.json +15 -0
- package/{configs → ide/configs}/gemini-cli-mcp.json +2 -2
- package/{configs → ide/configs}/jetbrains-mcp.json +2 -2
- package/{configs → ide/configs}/opencode-mcp.json +2 -2
- package/{configs → ide/configs}/perplexity-mcp.json +2 -2
- package/{configs → ide/configs}/vscode-copilot-mcp.json +2 -2
- package/{configs → ide/configs}/windsurf-mcp.json +3 -3
- package/{configs → ide/configs}/zed-mcp.json +2 -2
- package/{hooks → ide/hooks}/context-hook.js +9 -20
- package/ide/hooks/memory-list-skill.js +70 -0
- package/ide/hooks/memory-profile-skill.js +101 -0
- package/ide/hooks/memory-recall-skill.js +62 -0
- package/ide/hooks/memory-remember-skill.js +68 -0
- package/ide/hooks/memory-reset-skill.js +160 -0
- package/{hooks → ide/hooks}/post-recall-hook.js +2 -2
- package/ide/integrations/langchain/README.md +106 -0
- package/ide/integrations/langchain/langchain_superlocalmemory/__init__.py +9 -0
- package/ide/integrations/langchain/langchain_superlocalmemory/chat_message_history.py +201 -0
- package/ide/integrations/langchain/pyproject.toml +38 -0
- package/{src/learning → ide/integrations/langchain}/tests/__init__.py +1 -0
- package/ide/integrations/langchain/tests/test_chat_message_history.py +215 -0
- package/ide/integrations/langchain/tests/test_security.py +117 -0
- package/ide/integrations/llamaindex/README.md +81 -0
- package/ide/integrations/llamaindex/llama_index/storage/chat_store/superlocalmemory/__init__.py +9 -0
- package/ide/integrations/llamaindex/llama_index/storage/chat_store/superlocalmemory/base.py +316 -0
- package/ide/integrations/llamaindex/pyproject.toml +43 -0
- package/{src/lifecycle → ide/integrations/llamaindex}/tests/__init__.py +1 -2
- package/ide/integrations/llamaindex/tests/test_chat_store.py +294 -0
- package/ide/integrations/llamaindex/tests/test_security.py +241 -0
- package/{skills → ide/skills}/slm-build-graph/SKILL.md +6 -6
- package/{skills → ide/skills}/slm-list-recent/SKILL.md +5 -5
- package/{skills → ide/skills}/slm-recall/SKILL.md +5 -5
- package/{skills → ide/skills}/slm-remember/SKILL.md +6 -6
- package/{skills → ide/skills}/slm-show-patterns/SKILL.md +7 -7
- package/{skills → ide/skills}/slm-status/SKILL.md +9 -9
- package/{skills → ide/skills}/slm-switch-profile/SKILL.md +9 -9
- package/package.json +13 -22
- package/pyproject.toml +85 -0
- package/scripts/build-dmg.sh +417 -0
- package/scripts/install-skills.ps1 +334 -0
- package/{install.ps1 → scripts/install.ps1} +36 -4
- package/{install.sh → scripts/install.sh} +14 -13
- package/scripts/postinstall.js +2 -2
- package/scripts/start-dashboard.ps1 +52 -0
- package/scripts/start-dashboard.sh +41 -0
- package/scripts/sync-wiki.ps1 +127 -0
- package/scripts/sync-wiki.sh +82 -0
- package/scripts/test-dmg.sh +161 -0
- package/scripts/test-npm-package.ps1 +252 -0
- package/scripts/test-npm-package.sh +207 -0
- package/scripts/verify-install.ps1 +294 -0
- package/scripts/verify-install.sh +266 -0
- package/src/superlocalmemory/__init__.py +0 -0
- package/src/superlocalmemory/attribution/__init__.py +9 -0
- package/src/superlocalmemory/attribution/mathematical_dna.py +235 -0
- package/src/superlocalmemory/attribution/signer.py +153 -0
- package/src/superlocalmemory/attribution/watermark.py +189 -0
- package/src/superlocalmemory/cli/__init__.py +5 -0
- package/src/superlocalmemory/cli/commands.py +245 -0
- package/src/superlocalmemory/cli/main.py +89 -0
- package/src/superlocalmemory/cli/migrate_cmd.py +55 -0
- package/src/superlocalmemory/cli/post_install.py +99 -0
- package/src/superlocalmemory/cli/setup_wizard.py +129 -0
- package/src/superlocalmemory/compliance/__init__.py +0 -0
- package/src/superlocalmemory/compliance/abac.py +204 -0
- package/src/superlocalmemory/compliance/audit.py +314 -0
- package/src/superlocalmemory/compliance/eu_ai_act.py +131 -0
- package/src/superlocalmemory/compliance/gdpr.py +294 -0
- package/src/superlocalmemory/compliance/lifecycle.py +158 -0
- package/src/superlocalmemory/compliance/retention.py +232 -0
- package/src/superlocalmemory/compliance/scheduler.py +148 -0
- package/src/superlocalmemory/core/__init__.py +0 -0
- package/src/superlocalmemory/core/config.py +391 -0
- package/src/superlocalmemory/core/embeddings.py +293 -0
- package/src/superlocalmemory/core/engine.py +701 -0
- package/src/superlocalmemory/core/hooks.py +65 -0
- package/src/superlocalmemory/core/maintenance.py +172 -0
- package/src/superlocalmemory/core/modes.py +140 -0
- package/src/superlocalmemory/core/profiles.py +234 -0
- package/src/superlocalmemory/core/registry.py +117 -0
- package/src/superlocalmemory/dynamics/__init__.py +0 -0
- package/src/superlocalmemory/dynamics/fisher_langevin_coupling.py +223 -0
- package/src/superlocalmemory/encoding/__init__.py +0 -0
- package/src/superlocalmemory/encoding/consolidator.py +485 -0
- package/src/superlocalmemory/encoding/emotional.py +125 -0
- package/src/superlocalmemory/encoding/entity_resolver.py +525 -0
- package/src/superlocalmemory/encoding/entropy_gate.py +104 -0
- package/src/superlocalmemory/encoding/fact_extractor.py +775 -0
- package/src/superlocalmemory/encoding/foresight.py +91 -0
- package/src/superlocalmemory/encoding/graph_builder.py +302 -0
- package/src/superlocalmemory/encoding/observation_builder.py +160 -0
- package/src/superlocalmemory/encoding/scene_builder.py +183 -0
- package/src/superlocalmemory/encoding/signal_inference.py +90 -0
- package/src/superlocalmemory/encoding/temporal_parser.py +426 -0
- package/src/superlocalmemory/encoding/type_router.py +235 -0
- package/src/superlocalmemory/hooks/__init__.py +3 -0
- package/src/superlocalmemory/hooks/auto_capture.py +111 -0
- package/src/superlocalmemory/hooks/auto_recall.py +93 -0
- package/src/superlocalmemory/hooks/ide_connector.py +204 -0
- package/src/superlocalmemory/hooks/rules_engine.py +99 -0
- package/src/superlocalmemory/infra/__init__.py +3 -0
- package/src/superlocalmemory/infra/auth_middleware.py +82 -0
- package/src/superlocalmemory/infra/backup.py +317 -0
- package/src/superlocalmemory/infra/cache_manager.py +267 -0
- package/src/superlocalmemory/infra/event_bus.py +381 -0
- package/src/superlocalmemory/infra/rate_limiter.py +135 -0
- package/src/{webhook_dispatcher.py → superlocalmemory/infra/webhook_dispatcher.py} +104 -101
- package/src/superlocalmemory/learning/__init__.py +0 -0
- package/src/superlocalmemory/learning/adaptive.py +172 -0
- package/src/superlocalmemory/learning/behavioral.py +490 -0
- package/src/superlocalmemory/learning/behavioral_listener.py +94 -0
- package/src/superlocalmemory/learning/bootstrap.py +298 -0
- package/src/superlocalmemory/learning/cross_project.py +399 -0
- package/src/superlocalmemory/learning/database.py +376 -0
- package/src/superlocalmemory/learning/engagement.py +323 -0
- package/src/superlocalmemory/learning/features.py +138 -0
- package/src/superlocalmemory/learning/feedback.py +316 -0
- package/src/superlocalmemory/learning/outcomes.py +255 -0
- package/src/superlocalmemory/learning/project_context.py +366 -0
- package/src/superlocalmemory/learning/ranker.py +155 -0
- package/src/superlocalmemory/learning/source_quality.py +303 -0
- package/src/superlocalmemory/learning/workflows.py +309 -0
- package/src/superlocalmemory/llm/__init__.py +0 -0
- package/src/superlocalmemory/llm/backbone.py +316 -0
- package/src/superlocalmemory/math/__init__.py +0 -0
- package/src/superlocalmemory/math/fisher.py +356 -0
- package/src/superlocalmemory/math/langevin.py +398 -0
- package/src/superlocalmemory/math/sheaf.py +257 -0
- package/src/superlocalmemory/mcp/__init__.py +0 -0
- package/src/superlocalmemory/mcp/resources.py +245 -0
- package/src/superlocalmemory/mcp/server.py +61 -0
- package/src/superlocalmemory/mcp/tools.py +18 -0
- package/src/superlocalmemory/mcp/tools_core.py +305 -0
- package/src/superlocalmemory/mcp/tools_v28.py +223 -0
- package/src/superlocalmemory/mcp/tools_v3.py +286 -0
- package/src/superlocalmemory/retrieval/__init__.py +0 -0
- package/src/superlocalmemory/retrieval/agentic.py +295 -0
- package/src/superlocalmemory/retrieval/ann_index.py +223 -0
- package/src/superlocalmemory/retrieval/bm25_channel.py +185 -0
- package/src/superlocalmemory/retrieval/bridge_discovery.py +170 -0
- package/src/superlocalmemory/retrieval/engine.py +390 -0
- package/src/superlocalmemory/retrieval/entity_channel.py +179 -0
- package/src/superlocalmemory/retrieval/fusion.py +78 -0
- package/src/superlocalmemory/retrieval/profile_channel.py +105 -0
- package/src/superlocalmemory/retrieval/reranker.py +154 -0
- package/src/superlocalmemory/retrieval/semantic_channel.py +232 -0
- package/src/superlocalmemory/retrieval/strategy.py +96 -0
- package/src/superlocalmemory/retrieval/temporal_channel.py +175 -0
- package/src/superlocalmemory/server/__init__.py +1 -0
- package/src/superlocalmemory/server/api.py +248 -0
- package/src/superlocalmemory/server/routes/__init__.py +4 -0
- package/src/superlocalmemory/server/routes/agents.py +107 -0
- package/src/superlocalmemory/server/routes/backup.py +91 -0
- package/src/superlocalmemory/server/routes/behavioral.py +127 -0
- package/src/superlocalmemory/server/routes/compliance.py +160 -0
- package/src/superlocalmemory/server/routes/data_io.py +188 -0
- package/src/superlocalmemory/server/routes/events.py +183 -0
- package/src/superlocalmemory/server/routes/helpers.py +85 -0
- package/src/superlocalmemory/server/routes/learning.py +273 -0
- package/src/superlocalmemory/server/routes/lifecycle.py +116 -0
- package/src/superlocalmemory/server/routes/memories.py +399 -0
- package/src/superlocalmemory/server/routes/profiles.py +219 -0
- package/src/superlocalmemory/server/routes/stats.py +346 -0
- package/src/superlocalmemory/server/routes/v3_api.py +365 -0
- package/src/superlocalmemory/server/routes/ws.py +82 -0
- package/src/superlocalmemory/server/security_middleware.py +57 -0
- package/src/superlocalmemory/server/ui.py +245 -0
- package/src/superlocalmemory/storage/__init__.py +0 -0
- package/src/superlocalmemory/storage/access_control.py +182 -0
- package/src/superlocalmemory/storage/database.py +594 -0
- package/src/superlocalmemory/storage/migrations.py +303 -0
- package/src/superlocalmemory/storage/models.py +406 -0
- package/src/superlocalmemory/storage/schema.py +726 -0
- package/src/superlocalmemory/storage/v2_migrator.py +317 -0
- package/src/superlocalmemory/trust/__init__.py +0 -0
- package/src/superlocalmemory/trust/gate.py +130 -0
- package/src/superlocalmemory/trust/provenance.py +124 -0
- package/src/superlocalmemory/trust/scorer.py +347 -0
- package/src/superlocalmemory/trust/signals.py +153 -0
- package/ui/index.html +278 -5
- package/ui/js/auto-settings.js +70 -0
- package/ui/js/dashboard.js +90 -0
- package/ui/js/fact-detail.js +92 -0
- package/ui/js/feedback.js +2 -2
- package/ui/js/ide-status.js +102 -0
- package/ui/js/math-health.js +98 -0
- package/ui/js/recall-lab.js +127 -0
- package/ui/js/settings.js +2 -2
- package/ui/js/trust-dashboard.js +73 -0
- package/api_server.py +0 -724
- package/bin/aider-smart +0 -72
- package/bin/superlocalmemoryv2-learning +0 -4
- package/bin/superlocalmemoryv2-list +0 -3
- package/bin/superlocalmemoryv2-patterns +0 -4
- package/bin/superlocalmemoryv2-profile +0 -3
- package/bin/superlocalmemoryv2-recall +0 -3
- package/bin/superlocalmemoryv2-remember +0 -3
- package/bin/superlocalmemoryv2-reset +0 -3
- package/bin/superlocalmemoryv2-status +0 -3
- package/configs/chatgpt-desktop-mcp.json +0 -16
- package/configs/cursor-mcp.json +0 -15
- package/docs/SECURITY-QUICK-REFERENCE.md +0 -214
- package/hooks/memory-list-skill.js +0 -139
- package/hooks/memory-profile-skill.js +0 -273
- package/hooks/memory-recall-skill.js +0 -114
- package/hooks/memory-remember-skill.js +0 -127
- package/hooks/memory-reset-skill.js +0 -274
- package/mcp_server.py +0 -1800
- package/requirements-core.txt +0 -22
- package/requirements-learning.txt +0 -12
- package/requirements.txt +0 -12
- package/src/agent_registry.py +0 -411
- package/src/auth_middleware.py +0 -61
- package/src/auto_backup.py +0 -459
- package/src/behavioral/__init__.py +0 -49
- package/src/behavioral/behavioral_listener.py +0 -203
- package/src/behavioral/behavioral_patterns.py +0 -275
- package/src/behavioral/cross_project_transfer.py +0 -206
- package/src/behavioral/outcome_inference.py +0 -194
- package/src/behavioral/outcome_tracker.py +0 -193
- package/src/behavioral/tests/__init__.py +0 -4
- package/src/behavioral/tests/test_behavioral_integration.py +0 -108
- package/src/behavioral/tests/test_behavioral_patterns.py +0 -150
- package/src/behavioral/tests/test_cross_project_transfer.py +0 -142
- package/src/behavioral/tests/test_mcp_behavioral.py +0 -139
- package/src/behavioral/tests/test_mcp_report_outcome.py +0 -117
- package/src/behavioral/tests/test_outcome_inference.py +0 -107
- package/src/behavioral/tests/test_outcome_tracker.py +0 -96
- package/src/cache_manager.py +0 -518
- package/src/compliance/__init__.py +0 -48
- package/src/compliance/abac_engine.py +0 -149
- package/src/compliance/abac_middleware.py +0 -116
- package/src/compliance/audit_db.py +0 -215
- package/src/compliance/audit_logger.py +0 -148
- package/src/compliance/retention_manager.py +0 -289
- package/src/compliance/retention_scheduler.py +0 -186
- package/src/compliance/tests/__init__.py +0 -4
- package/src/compliance/tests/test_abac_enforcement.py +0 -95
- package/src/compliance/tests/test_abac_engine.py +0 -124
- package/src/compliance/tests/test_abac_mcp_integration.py +0 -118
- package/src/compliance/tests/test_audit_db.py +0 -123
- package/src/compliance/tests/test_audit_logger.py +0 -98
- package/src/compliance/tests/test_mcp_audit.py +0 -128
- package/src/compliance/tests/test_mcp_retention_policy.py +0 -125
- package/src/compliance/tests/test_retention_manager.py +0 -131
- package/src/compliance/tests/test_retention_scheduler.py +0 -99
- package/src/compression/__init__.py +0 -25
- package/src/compression/cli.py +0 -150
- package/src/compression/cold_storage.py +0 -217
- package/src/compression/config.py +0 -72
- package/src/compression/orchestrator.py +0 -133
- package/src/compression/tier2_compressor.py +0 -228
- package/src/compression/tier3_compressor.py +0 -153
- package/src/compression/tier_classifier.py +0 -148
- package/src/db_connection_manager.py +0 -536
- package/src/embedding_engine.py +0 -63
- package/src/embeddings/__init__.py +0 -47
- package/src/embeddings/cache.py +0 -70
- package/src/embeddings/cli.py +0 -113
- package/src/embeddings/constants.py +0 -47
- package/src/embeddings/database.py +0 -91
- package/src/embeddings/engine.py +0 -247
- package/src/embeddings/model_loader.py +0 -145
- package/src/event_bus.py +0 -562
- package/src/graph/__init__.py +0 -36
- package/src/graph/build_helpers.py +0 -74
- package/src/graph/cli.py +0 -87
- package/src/graph/cluster_builder.py +0 -188
- package/src/graph/cluster_summary.py +0 -148
- package/src/graph/constants.py +0 -47
- package/src/graph/edge_builder.py +0 -162
- package/src/graph/entity_extractor.py +0 -95
- package/src/graph/graph_core.py +0 -226
- package/src/graph/graph_search.py +0 -231
- package/src/graph/hierarchical.py +0 -207
- package/src/graph/schema.py +0 -99
- package/src/graph_engine.py +0 -52
- package/src/hnsw_index.py +0 -628
- package/src/hybrid_search.py +0 -46
- package/src/learning/__init__.py +0 -217
- package/src/learning/adaptive_ranker.py +0 -682
- package/src/learning/bootstrap/__init__.py +0 -69
- package/src/learning/bootstrap/constants.py +0 -93
- package/src/learning/bootstrap/db_queries.py +0 -316
- package/src/learning/bootstrap/sampling.py +0 -82
- package/src/learning/bootstrap/text_utils.py +0 -71
- package/src/learning/cross_project_aggregator.py +0 -857
- package/src/learning/db/__init__.py +0 -40
- package/src/learning/db/constants.py +0 -44
- package/src/learning/db/schema.py +0 -279
- package/src/learning/engagement_tracker.py +0 -628
- package/src/learning/feature_extractor.py +0 -708
- package/src/learning/feedback_collector.py +0 -806
- package/src/learning/learning_db.py +0 -915
- package/src/learning/project_context_manager.py +0 -572
- package/src/learning/ranking/__init__.py +0 -33
- package/src/learning/ranking/constants.py +0 -84
- package/src/learning/ranking/helpers.py +0 -278
- package/src/learning/source_quality_scorer.py +0 -676
- package/src/learning/synthetic_bootstrap.py +0 -755
- package/src/learning/tests/test_adaptive_ranker.py +0 -325
- package/src/learning/tests/test_adaptive_ranker_v28.py +0 -60
- package/src/learning/tests/test_aggregator.py +0 -306
- package/src/learning/tests/test_auto_retrain_v28.py +0 -35
- package/src/learning/tests/test_e2e_ranking_v28.py +0 -82
- package/src/learning/tests/test_feature_extractor_v28.py +0 -93
- package/src/learning/tests/test_feedback_collector.py +0 -294
- package/src/learning/tests/test_learning_db.py +0 -602
- package/src/learning/tests/test_learning_db_v28.py +0 -110
- package/src/learning/tests/test_learning_init_v28.py +0 -48
- package/src/learning/tests/test_outcome_signals.py +0 -48
- package/src/learning/tests/test_project_context.py +0 -292
- package/src/learning/tests/test_schema_migration.py +0 -319
- package/src/learning/tests/test_signal_inference.py +0 -397
- package/src/learning/tests/test_source_quality.py +0 -351
- package/src/learning/tests/test_synthetic_bootstrap.py +0 -429
- package/src/learning/tests/test_workflow_miner.py +0 -318
- package/src/learning/workflow_pattern_miner.py +0 -655
- package/src/lifecycle/__init__.py +0 -54
- package/src/lifecycle/bounded_growth.py +0 -239
- package/src/lifecycle/compaction_engine.py +0 -226
- package/src/lifecycle/lifecycle_engine.py +0 -355
- package/src/lifecycle/lifecycle_evaluator.py +0 -257
- package/src/lifecycle/lifecycle_scheduler.py +0 -130
- package/src/lifecycle/retention_policy.py +0 -285
- package/src/lifecycle/tests/test_bounded_growth.py +0 -193
- package/src/lifecycle/tests/test_compaction.py +0 -179
- package/src/lifecycle/tests/test_lifecycle_engine.py +0 -137
- package/src/lifecycle/tests/test_lifecycle_evaluation.py +0 -177
- package/src/lifecycle/tests/test_lifecycle_scheduler.py +0 -127
- package/src/lifecycle/tests/test_lifecycle_search.py +0 -109
- package/src/lifecycle/tests/test_mcp_compact.py +0 -149
- package/src/lifecycle/tests/test_mcp_lifecycle_status.py +0 -114
- package/src/lifecycle/tests/test_retention_policy.py +0 -162
- package/src/mcp_tools_v28.py +0 -281
- package/src/memory/__init__.py +0 -36
- package/src/memory/cli.py +0 -205
- package/src/memory/constants.py +0 -39
- package/src/memory/helpers.py +0 -28
- package/src/memory/schema.py +0 -166
- package/src/memory-profiles.py +0 -595
- package/src/memory-reset.py +0 -491
- package/src/memory_compression.py +0 -989
- package/src/memory_store_v2.py +0 -1155
- package/src/migrate_v1_to_v2.py +0 -629
- package/src/pattern_learner.py +0 -34
- package/src/patterns/__init__.py +0 -24
- package/src/patterns/analyzers.py +0 -251
- package/src/patterns/learner.py +0 -271
- package/src/patterns/scoring.py +0 -171
- package/src/patterns/store.py +0 -225
- package/src/patterns/terminology.py +0 -140
- package/src/provenance_tracker.py +0 -312
- package/src/qualixar_attribution.py +0 -139
- package/src/qualixar_watermark.py +0 -78
- package/src/query_optimizer.py +0 -511
- package/src/rate_limiter.py +0 -83
- package/src/search/__init__.py +0 -20
- package/src/search/cli.py +0 -77
- package/src/search/constants.py +0 -26
- package/src/search/engine.py +0 -241
- package/src/search/fusion.py +0 -122
- package/src/search/index_loader.py +0 -114
- package/src/search/methods.py +0 -162
- package/src/search_engine_v2.py +0 -401
- package/src/setup_validator.py +0 -482
- package/src/subscription_manager.py +0 -391
- package/src/tree/__init__.py +0 -59
- package/src/tree/builder.py +0 -185
- package/src/tree/nodes.py +0 -202
- package/src/tree/queries.py +0 -257
- package/src/tree/schema.py +0 -80
- package/src/tree_manager.py +0 -19
- package/src/trust/__init__.py +0 -45
- package/src/trust/constants.py +0 -66
- package/src/trust/queries.py +0 -157
- package/src/trust/schema.py +0 -95
- package/src/trust/scorer.py +0 -299
- package/src/trust/signals.py +0 -95
- package/src/trust_scorer.py +0 -44
- package/ui/app.js +0 -1588
- package/ui/js/graph-cytoscape-monolithic-backup.js +0 -1168
- package/ui/js/graph-cytoscape.js +0 -1168
- package/ui/js/graph-d3-backup.js +0 -32
- package/ui/js/graph.js +0 -32
- package/ui_server.py +0 -266
- /package/docs/{ACCESSIBILITY.md → v2-archive/ACCESSIBILITY.md} +0 -0
- /package/docs/{ARCHITECTURE.md → v2-archive/ARCHITECTURE.md} +0 -0
- /package/docs/{CLI-COMMANDS-REFERENCE.md → v2-archive/CLI-COMMANDS-REFERENCE.md} +0 -0
- /package/docs/{COMPRESSION-README.md → v2-archive/COMPRESSION-README.md} +0 -0
- /package/docs/{FRAMEWORK-INTEGRATIONS.md → v2-archive/FRAMEWORK-INTEGRATIONS.md} +0 -0
- /package/docs/{MCP-MANUAL-SETUP.md → v2-archive/MCP-MANUAL-SETUP.md} +0 -0
- /package/docs/{MCP-TROUBLESHOOTING.md → v2-archive/MCP-TROUBLESHOOTING.md} +0 -0
- /package/docs/{PATTERN-LEARNING.md → v2-archive/PATTERN-LEARNING.md} +0 -0
- /package/docs/{PROFILES-GUIDE.md → v2-archive/PROFILES-GUIDE.md} +0 -0
- /package/docs/{RESET-GUIDE.md → v2-archive/RESET-GUIDE.md} +0 -0
- /package/docs/{SEARCH-ENGINE-V2.2.0.md → v2-archive/SEARCH-ENGINE-V2.2.0.md} +0 -0
- /package/docs/{SEARCH-INTEGRATION-GUIDE.md → v2-archive/SEARCH-INTEGRATION-GUIDE.md} +0 -0
- /package/docs/{UI-SERVER.md → v2-archive/UI-SERVER.md} +0 -0
- /package/docs/{UNIVERSAL-INTEGRATION.md → v2-archive/UNIVERSAL-INTEGRATION.md} +0 -0
- /package/docs/{V2.2.0-OPTIONAL-SEARCH.md → v2-archive/V2.2.0-OPTIONAL-SEARCH.md} +0 -0
- /package/docs/{WINDOWS-INSTALL-README.txt → v2-archive/WINDOWS-INSTALL-README.txt} +0 -0
- /package/docs/{WINDOWS-POST-INSTALL.txt → v2-archive/WINDOWS-POST-INSTALL.txt} +0 -0
- /package/docs/{example_graph_usage.py → v2-archive/example_graph_usage.py} +0 -0
- /package/{completions → ide/completions}/slm.bash +0 -0
- /package/{completions → ide/completions}/slm.zsh +0 -0
- /package/{configs → ide/configs}/cody-commands.json +0 -0
- /package/{install-skills.sh → scripts/install-skills.sh} +0 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
> SuperLocalMemory V3 Documentation
|
|
3
|
+
> https://superlocalmemory.com | Part of Qualixar
|
|
4
|
+
|
|
5
|
+
Use SuperLocalMemory programmatically from Python. This is for developers building integrations, custom workflows, or framework adapters.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install superlocalmemory
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or, if you installed via npm, the Python package is available at:
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import sys
|
|
19
|
+
sys.path.insert(0, "/path/to/superlocalmemory/python")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from superlocalmemory.core.engine import MemoryEngine
|
|
26
|
+
from superlocalmemory.core.config import SLMConfig
|
|
27
|
+
|
|
28
|
+
# Initialize with default config (Mode A, default profile)
|
|
29
|
+
config = SLMConfig()
|
|
30
|
+
engine = MemoryEngine(config)
|
|
31
|
+
|
|
32
|
+
# Store a memory
|
|
33
|
+
engine.store("The API uses OAuth 2.0 with PKCE for mobile clients")
|
|
34
|
+
|
|
35
|
+
# Recall memories
|
|
36
|
+
results = engine.recall("authentication method for mobile")
|
|
37
|
+
for result in results:
|
|
38
|
+
print(f"[{result.score:.2f}] {result.content}")
|
|
39
|
+
|
|
40
|
+
# Clean up
|
|
41
|
+
engine.close()
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
### SLMConfig
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from superlocalmemory.core.config import SLMConfig
|
|
50
|
+
|
|
51
|
+
# Default configuration
|
|
52
|
+
config = SLMConfig()
|
|
53
|
+
|
|
54
|
+
# Custom configuration
|
|
55
|
+
config = SLMConfig(
|
|
56
|
+
mode="a", # "a", "b", or "c"
|
|
57
|
+
profile="work", # Active profile name
|
|
58
|
+
data_dir="~/.superlocalmemory", # Database location
|
|
59
|
+
embedding_model="all-MiniLM-L6-v2",
|
|
60
|
+
max_results=10,
|
|
61
|
+
)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Parameter | Type | Default | Description |
|
|
65
|
+
|-----------|------|---------|-------------|
|
|
66
|
+
| `mode` | str | `"a"` | Operating mode |
|
|
67
|
+
| `profile` | str | `"default"` | Active profile |
|
|
68
|
+
| `data_dir` | str | `"~/.superlocalmemory"` | Data directory |
|
|
69
|
+
| `embedding_model` | str | `"all-MiniLM-L6-v2"` | Sentence transformer model |
|
|
70
|
+
| `max_results` | int | `10` | Default max results for recall |
|
|
71
|
+
|
|
72
|
+
## Core Operations
|
|
73
|
+
|
|
74
|
+
### Store
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
# Basic store
|
|
78
|
+
memory_id = engine.store("React 19 uses the new compiler by default")
|
|
79
|
+
|
|
80
|
+
# Store with tags
|
|
81
|
+
memory_id = engine.store(
|
|
82
|
+
"Deploy to staging before 2pm on Fridays",
|
|
83
|
+
tags=["process", "deployment"]
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Store with metadata
|
|
87
|
+
memory_id = engine.store(
|
|
88
|
+
"Maria approved the new database schema",
|
|
89
|
+
metadata={"source": "slack", "channel": "#backend"}
|
|
90
|
+
)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Returns:** `int` — the ID of the stored memory.
|
|
94
|
+
|
|
95
|
+
### Recall
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# Basic recall
|
|
99
|
+
results = engine.recall("database schema approval")
|
|
100
|
+
|
|
101
|
+
# With limit
|
|
102
|
+
results = engine.recall("deployment schedule", limit=5)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Returns:** `list[RecallResult]`
|
|
106
|
+
|
|
107
|
+
Each `RecallResult` has:
|
|
108
|
+
|
|
109
|
+
| Attribute | Type | Description |
|
|
110
|
+
|-----------|------|-------------|
|
|
111
|
+
| `id` | int | Memory ID |
|
|
112
|
+
| `content` | str | Memory text |
|
|
113
|
+
| `score` | float | Relevance score (0.0 to 1.0) |
|
|
114
|
+
| `timestamp` | datetime | When the memory was stored |
|
|
115
|
+
| `tags` | list[str] | Tags attached to the memory |
|
|
116
|
+
| `metadata` | dict | Additional metadata |
|
|
117
|
+
|
|
118
|
+
### Recall with Trace
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
# Get channel-by-channel breakdown
|
|
122
|
+
results = engine.recall_trace("who approved the schema")
|
|
123
|
+
|
|
124
|
+
for result in results:
|
|
125
|
+
print(f"[{result.score:.2f}] {result.content}")
|
|
126
|
+
print(f" Semantic: {result.trace.semantic:.2f}")
|
|
127
|
+
print(f" BM25: {result.trace.bm25:.2f}")
|
|
128
|
+
print(f" Entity: {result.trace.entity:.2f}")
|
|
129
|
+
print(f" Temporal: {result.trace.temporal:.2f}")
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Delete
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
# Delete by ID
|
|
136
|
+
engine.delete(memory_id=42)
|
|
137
|
+
|
|
138
|
+
# Delete by query (deletes best match)
|
|
139
|
+
engine.delete(query="old staging credentials")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### List Recent
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
memories = engine.list_recent(limit=20)
|
|
146
|
+
for m in memories:
|
|
147
|
+
print(f"[{m.id}] {m.content[:80]}...")
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Profile Management
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
# List profiles
|
|
154
|
+
profiles = engine.list_profiles()
|
|
155
|
+
|
|
156
|
+
# Switch profile
|
|
157
|
+
engine.switch_profile("client-acme")
|
|
158
|
+
|
|
159
|
+
# Create profile
|
|
160
|
+
engine.create_profile("new-project")
|
|
161
|
+
|
|
162
|
+
# Delete profile
|
|
163
|
+
engine.delete_profile("old-project")
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Health and Diagnostics
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
# System status
|
|
170
|
+
status = engine.status()
|
|
171
|
+
print(f"Mode: {status.mode}")
|
|
172
|
+
print(f"Profile: {status.profile}")
|
|
173
|
+
print(f"Memories: {status.memory_count}")
|
|
174
|
+
|
|
175
|
+
# Health check
|
|
176
|
+
health = engine.health()
|
|
177
|
+
print(f"Fisher-Rao: {health.fisher}")
|
|
178
|
+
print(f"Sheaf: {health.sheaf}")
|
|
179
|
+
print(f"Langevin: {health.langevin}")
|
|
180
|
+
|
|
181
|
+
# Consistency check
|
|
182
|
+
contradictions = engine.consistency_check()
|
|
183
|
+
for c in contradictions:
|
|
184
|
+
print(f"Conflict: '{c.memory_a}' vs '{c.memory_b}'")
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Framework Integrations
|
|
188
|
+
|
|
189
|
+
### LangChain
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from superlocalmemory.integrations.langchain import SLMMemory
|
|
193
|
+
|
|
194
|
+
memory = SLMMemory(mode="a", profile="langchain-app")
|
|
195
|
+
|
|
196
|
+
# Use as LangChain memory
|
|
197
|
+
from langchain.chains import ConversationChain
|
|
198
|
+
from langchain.llms import OpenAI
|
|
199
|
+
|
|
200
|
+
chain = ConversationChain(
|
|
201
|
+
llm=OpenAI(),
|
|
202
|
+
memory=memory,
|
|
203
|
+
)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### LlamaIndex
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
from superlocalmemory.integrations.llamaindex import SLMMemoryStore
|
|
210
|
+
|
|
211
|
+
store = SLMMemoryStore(mode="a", profile="llamaindex-app")
|
|
212
|
+
|
|
213
|
+
# Use as a LlamaIndex document store
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Direct MCP Integration
|
|
217
|
+
|
|
218
|
+
If you are building an MCP-compatible tool and want to add SLM as a backend:
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
from superlocalmemory.mcp import create_mcp_server
|
|
222
|
+
|
|
223
|
+
server = create_mcp_server(
|
|
224
|
+
mode="a",
|
|
225
|
+
profile="my-tool",
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
# The server exposes all 24 tools and 6 resources
|
|
229
|
+
server.run()
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Context Manager
|
|
233
|
+
|
|
234
|
+
For scripts that need clean resource management:
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
from superlocalmemory.core.engine import MemoryEngine
|
|
238
|
+
from superlocalmemory.core.config import SLMConfig
|
|
239
|
+
|
|
240
|
+
with MemoryEngine(SLMConfig()) as engine:
|
|
241
|
+
engine.store("Ephemeral context for this script run")
|
|
242
|
+
results = engine.recall("context")
|
|
243
|
+
# engine.close() called automatically
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Error Handling
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from superlocalmemory.core.exceptions import (
|
|
250
|
+
SLMError, # Base exception
|
|
251
|
+
ProfileNotFoundError,
|
|
252
|
+
MemoryNotFoundError,
|
|
253
|
+
ConfigError,
|
|
254
|
+
DatabaseError,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
try:
|
|
258
|
+
engine.switch_profile("nonexistent")
|
|
259
|
+
except ProfileNotFoundError:
|
|
260
|
+
print("Profile does not exist. Create it first.")
|
|
261
|
+
|
|
262
|
+
try:
|
|
263
|
+
engine.delete(memory_id=99999)
|
|
264
|
+
except MemoryNotFoundError:
|
|
265
|
+
print("Memory not found.")
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Thread Safety
|
|
269
|
+
|
|
270
|
+
The `MemoryEngine` uses SQLite WAL mode and is safe for concurrent reads from multiple threads. Writes are serialized at the database level.
|
|
271
|
+
|
|
272
|
+
For multi-threaded applications, create one engine instance and share it:
|
|
273
|
+
|
|
274
|
+
```python
|
|
275
|
+
# Safe: one engine, multiple threads reading
|
|
276
|
+
engine = MemoryEngine(SLMConfig())
|
|
277
|
+
|
|
278
|
+
# Each thread can call engine.recall() concurrently
|
|
279
|
+
# Writes (engine.store()) are automatically serialized
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
*SuperLocalMemory V3 — Copyright 2026 Varun Pratap Bhardwaj. MIT License. Part of Qualixar.*
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
> SuperLocalMemory V3 Documentation
|
|
3
|
+
> https://superlocalmemory.com | Part of Qualixar
|
|
4
|
+
|
|
5
|
+
A high-level overview of how SuperLocalMemory V3 stores, organizes, and retrieves your memories.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Design Principles
|
|
10
|
+
|
|
11
|
+
1. **Local-first.** Your data stays on your machine by default. Cloud is opt-in.
|
|
12
|
+
2. **Zero-configuration.** Install and forget. Memory capture and recall happen automatically.
|
|
13
|
+
3. **Multi-channel retrieval.** No single search method is best for every query. V3 combines four channels and picks the best results.
|
|
14
|
+
4. **Mathematically grounded.** Retrieval quality, consistency, and lifecycle management are backed by information geometry rather than heuristics.
|
|
15
|
+
|
|
16
|
+
## System Overview
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Your IDE (Claude, Cursor, VS Code, ...)
|
|
20
|
+
|
|
|
21
|
+
| MCP Protocol
|
|
22
|
+
v
|
|
23
|
+
+------------------+
|
|
24
|
+
| MCP Server | 24 tools, 6 resources
|
|
25
|
+
+------------------+
|
|
26
|
+
|
|
|
27
|
+
v
|
|
28
|
+
+------------------+
|
|
29
|
+
| Memory Engine | Ingestion + Retrieval + Lifecycle
|
|
30
|
+
+------------------+
|
|
31
|
+
|
|
|
32
|
+
v
|
|
33
|
+
+------------------+
|
|
34
|
+
| SQLite Database | ~/.superlocalmemory/memory.db
|
|
35
|
+
+------------------+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## How Memories Are Stored (Ingestion)
|
|
39
|
+
|
|
40
|
+
When you store a memory (or one is auto-captured), it passes through an 11-step pipeline:
|
|
41
|
+
|
|
42
|
+
| Step | What it does |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| 1. Metadata extraction | Timestamps, session context, source identification |
|
|
45
|
+
| 2. Entity extraction | People, projects, technologies, organizations mentioned |
|
|
46
|
+
| 3. Fact extraction | Discrete facts pulled from the text |
|
|
47
|
+
| 4. Emotion detection | Sentiment and emotional tone (frustration, confidence, etc.) |
|
|
48
|
+
| 5. Belief extraction | Opinions, preferences, and stated beliefs |
|
|
49
|
+
| 6. Entity resolution | Links mentions to canonical entities (e.g., "React" and "ReactJS" become one) |
|
|
50
|
+
| 7. Graph wiring | Connects entities and facts into a relationship graph |
|
|
51
|
+
| 8. Foresight tagging | Predicts what future queries this memory might answer |
|
|
52
|
+
| 9. Observation building | Creates structured observations for pattern learning |
|
|
53
|
+
| 10. Entropy gating | Filters out redundant or low-value information |
|
|
54
|
+
| 11. Storage | Writes to all indexes: semantic vectors, BM25 tokens, graph edges, temporal events |
|
|
55
|
+
|
|
56
|
+
In Mode A, all steps run locally without any LLM calls. In Modes B and C, the LLM enhances entity extraction and fact decomposition.
|
|
57
|
+
|
|
58
|
+
## How Memories Are Retrieved (Recall)
|
|
59
|
+
|
|
60
|
+
Every recall query runs through four independent retrieval channels, then fuses the results:
|
|
61
|
+
|
|
62
|
+
### The Four Channels
|
|
63
|
+
|
|
64
|
+
| Channel | How it works | Best for |
|
|
65
|
+
|---------|-------------|----------|
|
|
66
|
+
| **Semantic** | Vector similarity using sentence embeddings, enhanced by Fisher-Rao geometry | "Queries that mean the same thing but use different words" |
|
|
67
|
+
| **BM25** | Classic keyword matching with term frequency scoring | "Queries with specific names, codes, or exact terms" |
|
|
68
|
+
| **Entity Graph** | Traverses the relationship graph via spreading activation | "Who works with Maria?" or "What connects service A to service B?" |
|
|
69
|
+
| **Temporal** | Matches based on time references and event ordering | "What did we decide last Friday?" or "Changes since the sprint started" |
|
|
70
|
+
|
|
71
|
+
### Fusion and Ranking
|
|
72
|
+
|
|
73
|
+
1. Each channel returns its top candidates with scores
|
|
74
|
+
2. **Reciprocal Rank Fusion** (RRF) combines the four ranked lists into one
|
|
75
|
+
3. In Mode C, a **cross-encoder** reranks the top results for final precision
|
|
76
|
+
4. The top results are returned to your AI assistant
|
|
77
|
+
|
|
78
|
+
This multi-channel approach means V3 finds memories that any single search method would miss. A keyword search alone might miss paraphrased content. A vector search alone might miss exact names. The combination catches both.
|
|
79
|
+
|
|
80
|
+
## Three Operating Modes
|
|
81
|
+
|
|
82
|
+
| Mode | Retrieval | LLM Usage | Data Location |
|
|
83
|
+
|------|-----------|-----------|---------------|
|
|
84
|
+
| **A: Zero-Cloud** | 4-channel + math scoring | None | 100% local |
|
|
85
|
+
| **B: Local LLM** | 4-channel + local LLM reranking | Ollama (local) | 100% local |
|
|
86
|
+
| **C: Cloud LLM** | 4-channel + cross-encoder + agentic retrieval | Cloud provider | Queries sent to cloud |
|
|
87
|
+
|
|
88
|
+
Mode A is the default. It delivers strong recall quality using mathematical scoring without any network calls.
|
|
89
|
+
|
|
90
|
+
## Mathematical Foundations
|
|
91
|
+
|
|
92
|
+
V3 uses three mathematical layers. These are not academic additions — they solve specific practical problems.
|
|
93
|
+
|
|
94
|
+
### Fisher-Rao Similarity
|
|
95
|
+
|
|
96
|
+
**Problem:** Standard vector similarity treats all memories equally, regardless of how much evidence backs them.
|
|
97
|
+
|
|
98
|
+
**Solution:** Fisher-Rao geometry accounts for the statistical confidence of each memory's embedding. A memory accessed and confirmed many times gets a tighter confidence region. A memory stored once and never validated has wider uncertainty. Similarity scoring respects this difference.
|
|
99
|
+
|
|
100
|
+
**Effect:** Frequently validated memories rank higher. Uncertain memories are flagged for verification.
|
|
101
|
+
|
|
102
|
+
### Sheaf Consistency
|
|
103
|
+
|
|
104
|
+
**Problem:** Over time, you store contradictory memories. "We use PostgreSQL" and later "We migrated to MySQL." Simple retrieval returns both without flagging the conflict.
|
|
105
|
+
|
|
106
|
+
**Solution:** Sheaf cohomology detects when memories attached to the same entity or topic contradict each other. When a contradiction is found, the system marks the older memory as superseded and surfaces the newer one.
|
|
107
|
+
|
|
108
|
+
**Effect:** Recall returns consistent information. Contradictions are flagged for your review.
|
|
109
|
+
|
|
110
|
+
### Langevin Lifecycle
|
|
111
|
+
|
|
112
|
+
**Problem:** Memory databases grow endlessly. Old memories dilute retrieval quality.
|
|
113
|
+
|
|
114
|
+
**Solution:** Langevin dynamics models each memory's lifecycle — from Active (frequently accessed) through Warm, Cold, and eventually Archived. The transition is not based on simple time rules but on a self-organizing dynamic that balances recency, access frequency, and information value.
|
|
115
|
+
|
|
116
|
+
**Effect:** Active memories stay prominent. Stale memories fade gracefully. Storage stays efficient.
|
|
117
|
+
|
|
118
|
+
## EU AI Act Compliance
|
|
119
|
+
|
|
120
|
+
Mode A satisfies data sovereignty requirements under the EU AI Act by design:
|
|
121
|
+
|
|
122
|
+
- **No cloud dependency.** All memory operations run locally. No data leaves your machine.
|
|
123
|
+
- **Right to erasure.** `slm forget` deletes data locally. No cloud logs to purge.
|
|
124
|
+
- **Transparency.** The retrieval pipeline is auditable. No black-box LLM decisions in Mode A.
|
|
125
|
+
- **Risk classification.** A local retrieval system with no AI decision-making qualifies as minimal risk.
|
|
126
|
+
|
|
127
|
+
Mode C sends queries to a cloud LLM provider. In that mode, the cloud provider's compliance posture applies to those queries.
|
|
128
|
+
|
|
129
|
+
## Database
|
|
130
|
+
|
|
131
|
+
All data is stored in a single SQLite database:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
~/.superlocalmemory/memory.db
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The database uses WAL (Write-Ahead Logging) mode for safe concurrent access from multiple IDE connections.
|
|
138
|
+
|
|
139
|
+
Key table groups:
|
|
140
|
+
|
|
141
|
+
- **Core:** memories, sessions, profiles
|
|
142
|
+
- **Knowledge:** semantic_facts, kg_nodes, memory_edges, canonical_entities
|
|
143
|
+
- **Retrieval indexes:** bm25_tokens, memory_metadata, temporal_events
|
|
144
|
+
- **Math layers:** fisher_state, sheaf_sections, langevin_state
|
|
145
|
+
- **Compliance:** trust_scores, provenance, audit_trail, retention_policies
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
*SuperLocalMemory V3 — Copyright 2026 Varun Pratap Bhardwaj. MIT License. Part of Qualixar.*
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Auto-Memory
|
|
2
|
+
> SuperLocalMemory V3 Documentation
|
|
3
|
+
> https://superlocalmemory.com | Part of Qualixar
|
|
4
|
+
|
|
5
|
+
SuperLocalMemory captures and recalls context automatically. Install it once, then forget about it — your AI assistant gets smarter over time without any manual effort.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## How Auto-Capture Works
|
|
10
|
+
|
|
11
|
+
When you work with an AI assistant that has SLM connected, certain types of information are automatically stored as memories:
|
|
12
|
+
|
|
13
|
+
| What gets captured | Example |
|
|
14
|
+
|-------------------|---------|
|
|
15
|
+
| **Decisions** | "Let's use WebSocket instead of SSE" |
|
|
16
|
+
| **Bug fixes** | "The crash was caused by a null pointer in the auth middleware" |
|
|
17
|
+
| **Architecture choices** | "We're going with a microservices approach for the payment system" |
|
|
18
|
+
| **Preferences** | "I prefer functional components over class components" |
|
|
19
|
+
| **Project context** | "The staging server is at 10.0.1.50, port 8080" |
|
|
20
|
+
| **People and roles** | "Sarah is the lead on the mobile team" |
|
|
21
|
+
| **Corrections** | "Actually, the deadline is March 20, not March 15" |
|
|
22
|
+
|
|
23
|
+
### What does NOT get captured
|
|
24
|
+
|
|
25
|
+
- Raw code blocks (too noisy, changes too fast)
|
|
26
|
+
- Casual conversation ("thanks", "sounds good")
|
|
27
|
+
- Repeated information already in memory
|
|
28
|
+
- Content filtered by the entropy gate (redundant or low-value)
|
|
29
|
+
|
|
30
|
+
### How the system decides what to capture
|
|
31
|
+
|
|
32
|
+
The ingestion pipeline scores each candidate memory on:
|
|
33
|
+
|
|
34
|
+
1. **Information value** — Does this add new knowledge not already stored?
|
|
35
|
+
2. **Specificity** — Is this a concrete fact or a vague statement?
|
|
36
|
+
3. **Reusability** — Is this likely to be useful in a future session?
|
|
37
|
+
|
|
38
|
+
Memories that score below the threshold are discarded. This keeps your database focused and retrieval quality high.
|
|
39
|
+
|
|
40
|
+
## How Auto-Recall Works
|
|
41
|
+
|
|
42
|
+
Before your AI assistant responds to a question, SLM automatically searches for relevant memories and injects them as context.
|
|
43
|
+
|
|
44
|
+
### The flow
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
You ask a question
|
|
48
|
+
|
|
|
49
|
+
v
|
|
50
|
+
SLM runs a recall query using your question as the search input
|
|
51
|
+
|
|
|
52
|
+
v
|
|
53
|
+
Relevant memories are injected into the AI's context window
|
|
54
|
+
|
|
|
55
|
+
v
|
|
56
|
+
The AI responds with awareness of your past decisions, preferences, and project context
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### What this looks like in practice
|
|
60
|
+
|
|
61
|
+
**Without SLM:**
|
|
62
|
+
> You: "What database should I use for the new service?"
|
|
63
|
+
> AI: Generic advice about PostgreSQL vs MySQL vs MongoDB...
|
|
64
|
+
|
|
65
|
+
**With SLM:**
|
|
66
|
+
> You: "What database should I use for the new service?"
|
|
67
|
+
> AI: "Based on your previous decision to standardize on PostgreSQL 16 (stored March 5), and your preference for managed services on AWS (stored February 20), I'd recommend Amazon RDS for PostgreSQL. Your auth service and payment service already use PostgreSQL, so this keeps the stack consistent."
|
|
68
|
+
|
|
69
|
+
The AI did not "remember" this on its own. SLM injected the relevant memories before the AI generated its response.
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
### Toggle auto-capture and auto-recall
|
|
74
|
+
|
|
75
|
+
In `~/.superlocalmemory/config.json`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"auto_capture": true,
|
|
80
|
+
"auto_recall": true
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Set either to `false` to disable. When disabled, you can still use `slm remember` and `slm recall` manually.
|
|
85
|
+
|
|
86
|
+
### Adjust recall sensitivity
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"max_recall_results": 10,
|
|
91
|
+
"recall_threshold": 0.3
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Setting | Default | Description |
|
|
96
|
+
|---------|---------|-------------|
|
|
97
|
+
| `max_recall_results` | `10` | Maximum memories injected per query |
|
|
98
|
+
| `recall_threshold` | `0.3` | Minimum relevance score (0.0 to 1.0). Lower = more memories, possibly less relevant. Higher = fewer but more precise. |
|
|
99
|
+
|
|
100
|
+
### Adjust capture sensitivity
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"capture_threshold": 0.5
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Setting | Default | Description |
|
|
109
|
+
|---------|---------|-------------|
|
|
110
|
+
| `capture_threshold` | `0.5` | Minimum information value to auto-capture. Lower = capture more. Higher = capture only high-value statements. |
|
|
111
|
+
|
|
112
|
+
## Manual Override
|
|
113
|
+
|
|
114
|
+
You always have full control:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Explicitly store something
|
|
118
|
+
slm remember "The API rate limit on production is 500 req/min, staging is 100 req/min"
|
|
119
|
+
|
|
120
|
+
# Explicitly recall
|
|
121
|
+
slm recall "rate limits"
|
|
122
|
+
|
|
123
|
+
# Delete a memory
|
|
124
|
+
slm forget --id 42
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Manual operations work regardless of auto-capture/auto-recall settings.
|
|
128
|
+
|
|
129
|
+
## Learning Over Time
|
|
130
|
+
|
|
131
|
+
SLM's adaptive learning system observes which memories are recalled frequently, which are marked helpful or outdated, and adjusts its behavior:
|
|
132
|
+
|
|
133
|
+
- **Frequently helpful memories** get higher ranking in future recalls
|
|
134
|
+
- **Memories marked "outdated"** are deprioritized or flagged for review
|
|
135
|
+
- **Usage patterns** inform what types of information to prioritize for capture
|
|
136
|
+
|
|
137
|
+
You can see what the system has learned:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
slm patterns # Show learned patterns
|
|
141
|
+
slm patterns correct 5 # Correct pattern #5 if it's wrong
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Privacy
|
|
145
|
+
|
|
146
|
+
Auto-capture and auto-recall happen entirely within SLM on your machine. In Mode A, no data leaves your device at any point. In Mode C, recall queries are sent to your configured LLM provider, but the memories themselves remain local.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
*SuperLocalMemory V3 — Copyright 2026 Varun Pratap Bhardwaj. MIT License. Part of Qualixar.*
|