superlocalmemory 4.0.10 → 4.1.2

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 (145) hide show
  1. package/.claude-plugin/marketplace.json +12 -2
  2. package/CHANGELOG.md +244 -0
  3. package/README.md +40 -75
  4. package/package.json +6 -3
  5. package/plugin/.claude-plugin/plugin.json +2 -2
  6. package/plugin/CLAUDE.md +3 -3
  7. package/plugin/agents/slm-governance-advisor.md +1 -1
  8. package/plugin/agents/slm-loop-runner.md +4 -4
  9. package/plugin/agents/slm-memory-advisor.md +1 -1
  10. package/plugin/agents/slm-optimize-advisor.md +1 -1
  11. package/plugin/requirements.txt +1 -1
  12. package/plugin/skills/slm-cache/SKILL.md +1 -1
  13. package/plugin/skills/slm-compress/SKILL.md +1 -1
  14. package/plugin/skills/slm-governance/SKILL.md +1 -1
  15. package/plugin/skills/slm-graph/SKILL.md +1 -1
  16. package/plugin/skills/slm-loop/SKILL.md +2 -2
  17. package/plugin/skills/slm-mesh/SKILL.md +1 -1
  18. package/plugin/skills/slm-profile/SKILL.md +5 -5
  19. package/plugin/skills/slm-recall/SKILL.md +102 -15
  20. package/plugin/skills/slm-remember/SKILL.md +35 -3
  21. package/plugin/skills/slm-scope/SKILL.md +1 -1
  22. package/plugin/skills/slm-session/SKILL.md +29 -3
  23. package/plugin/skills/slm-status/SKILL.md +1 -1
  24. package/plugin-src/rules/AGENTS.md +16 -8
  25. package/plugin-src/skills/slm-cache/SKILL.md +1 -1
  26. package/plugin-src/skills/slm-compress/SKILL.md +1 -1
  27. package/plugin-src/skills/slm-governance/SKILL.md +1 -1
  28. package/plugin-src/skills/slm-graph/SKILL.md +1 -1
  29. package/plugin-src/skills/slm-loop/SKILL.md +2 -2
  30. package/plugin-src/skills/slm-mesh/SKILL.md +1 -1
  31. package/plugin-src/skills/slm-profile/SKILL.md +5 -5
  32. package/plugin-src/skills/slm-recall/SKILL.md +102 -15
  33. package/plugin-src/skills/slm-remember/SKILL.md +35 -3
  34. package/plugin-src/skills/slm-scope/SKILL.md +1 -1
  35. package/plugin-src/skills/slm-session/SKILL.md +29 -3
  36. package/plugin-src/skills/slm-status/SKILL.md +1 -1
  37. package/pyproject.toml +1 -1
  38. package/src/superlocalmemory/__init__.py +1 -1
  39. package/src/superlocalmemory/cli/commands.py +357 -18
  40. package/src/superlocalmemory/cli/daemon.py +30 -0
  41. package/src/superlocalmemory/cli/db_migrate.py +71 -1
  42. package/src/superlocalmemory/cli/gdpr_cmd.py +15 -2
  43. package/src/superlocalmemory/cli/main.py +24 -2
  44. package/src/superlocalmemory/code_graph/database.py +44 -0
  45. package/src/superlocalmemory/compliance/gdpr.py +449 -39
  46. package/src/superlocalmemory/core/admission.py +231 -11
  47. package/src/superlocalmemory/core/backend_orchestrator.py +190 -84
  48. package/src/superlocalmemory/core/config.py +90 -11
  49. package/src/superlocalmemory/core/consolidation_engine.py +34 -0
  50. package/src/superlocalmemory/core/engine.py +140 -11
  51. package/src/superlocalmemory/core/graph_analyzer.py +76 -112
  52. package/src/superlocalmemory/core/graph_metrics.py +597 -0
  53. package/src/superlocalmemory/core/graph_pruner.py +121 -0
  54. package/src/superlocalmemory/core/maintenance_scheduler.py +205 -0
  55. package/src/superlocalmemory/core/mode_capability.py +111 -0
  56. package/src/superlocalmemory/core/ollama_validator.py +315 -0
  57. package/src/superlocalmemory/core/projection_drain.py +380 -0
  58. package/src/superlocalmemory/core/recall_pipeline.py +390 -3
  59. package/src/superlocalmemory/core/recall_worker.py +6 -3
  60. package/src/superlocalmemory/core/scale_autopromote.py +196 -0
  61. package/src/superlocalmemory/core/scale_engine.py +16 -2
  62. package/src/superlocalmemory/core/score_contract.py +21 -1
  63. package/src/superlocalmemory/core/session_identity.py +85 -0
  64. package/src/superlocalmemory/core/status_contract.py +108 -0
  65. package/src/superlocalmemory/core/worker_pool.py +4 -4
  66. package/src/superlocalmemory/core/working_memory.py +288 -0
  67. package/src/superlocalmemory/encoding/cognitive_consolidator.py +36 -6
  68. package/src/superlocalmemory/encoding/context_generator.py +1 -1
  69. package/src/superlocalmemory/encoding/entity_resolver.py +38 -0
  70. package/src/superlocalmemory/encoding/fact_extractor.py +18 -14
  71. package/src/superlocalmemory/encoding/prospective_markers.py +262 -0
  72. package/src/superlocalmemory/encoding/type_router.py +12 -12
  73. package/src/superlocalmemory/evolution/mutation_generator.py +30 -4
  74. package/src/superlocalmemory/graph/cozo_adjacency.py +122 -0
  75. package/src/superlocalmemory/graph/cozo_backend.py +103 -138
  76. package/src/superlocalmemory/hooks/portable_kit.py +10 -2
  77. package/src/superlocalmemory/learning/bandit.py +43 -0
  78. package/src/superlocalmemory/learning/consolidation_worker.py +54 -0
  79. package/src/superlocalmemory/learning/database.py +60 -3
  80. package/src/superlocalmemory/learning/entity_compiler.py +21 -58
  81. package/src/superlocalmemory/learning/feedback.py +3 -1
  82. package/src/superlocalmemory/learning/outcomes.py +47 -16
  83. package/src/superlocalmemory/learning/pattern_miner.py +28 -3
  84. package/src/superlocalmemory/learning/pattern_miner_constants.py +43 -0
  85. package/src/superlocalmemory/learning/pcos.py +291 -0
  86. package/src/superlocalmemory/learning/reward_from_outcomes.py +365 -0
  87. package/src/superlocalmemory/learning/reward_proxy.py +100 -10
  88. package/src/superlocalmemory/learning/signal_kinds.py +79 -0
  89. package/src/superlocalmemory/mcp/profiles.py +14 -2
  90. package/src/superlocalmemory/mcp/tools_active.py +2 -1
  91. package/src/superlocalmemory/mcp/tools_core.py +31 -3
  92. package/src/superlocalmemory/mcp/tools_v28.py +20 -1
  93. package/src/superlocalmemory/parameterization/pattern_extractor.py +14 -1
  94. package/src/superlocalmemory/parameterization/soft_prompt_generator.py +98 -0
  95. package/src/superlocalmemory/retrieval/bm25_channel.py +64 -3
  96. package/src/superlocalmemory/retrieval/channel_status.py +117 -0
  97. package/src/superlocalmemory/retrieval/engine.py +106 -11
  98. package/src/superlocalmemory/retrieval/entity_channel.py +210 -256
  99. package/src/superlocalmemory/retrieval/graph_adjacency.py +219 -0
  100. package/src/superlocalmemory/retrieval/scope_policy.py +20 -0
  101. package/src/superlocalmemory/retrieval/semantic_channel.py +47 -5
  102. package/src/superlocalmemory/retrieval/spreading.py +288 -0
  103. package/src/superlocalmemory/server/api.py +24 -5
  104. package/src/superlocalmemory/server/bandit_loops.py +17 -1
  105. package/src/superlocalmemory/server/rbac_enforce.py +26 -6
  106. package/src/superlocalmemory/server/recall_health.py +87 -10
  107. package/src/superlocalmemory/server/recall_serializer.py +9 -0
  108. package/src/superlocalmemory/server/routes/behavioral.py +75 -10
  109. package/src/superlocalmemory/server/routes/compliance.py +98 -18
  110. package/src/superlocalmemory/server/routes/config_api.py +186 -4
  111. package/src/superlocalmemory/server/routes/evolution.py +178 -0
  112. package/src/superlocalmemory/server/routes/ingest.py +8 -0
  113. package/src/superlocalmemory/server/routes/learning_telemetry.py +2 -1
  114. package/src/superlocalmemory/server/routes/memories.py +49 -7
  115. package/src/superlocalmemory/server/routes/timeline.py +4 -0
  116. package/src/superlocalmemory/server/routes/v3_api.py +191 -15
  117. package/src/superlocalmemory/server/ui.py +20 -4
  118. package/src/superlocalmemory/server/unified_daemon.py +241 -7
  119. package/src/superlocalmemory/storage/_migration_internals.py +54 -2
  120. package/src/superlocalmemory/storage/_schema_version.py +24 -3
  121. package/src/superlocalmemory/storage/database.py +477 -59
  122. package/src/superlocalmemory/storage/embedding_codec.py +71 -0
  123. package/src/superlocalmemory/storage/lineage_retention.py +236 -0
  124. package/src/superlocalmemory/storage/logical_edges.py +43 -2
  125. package/src/superlocalmemory/storage/migration_runner.py +119 -0
  126. package/src/superlocalmemory/storage/migrations/M043_quarantine_display_summaries.py +60 -36
  127. package/src/superlocalmemory/storage/migrations/M044_play_carries_its_own_evidence.py +127 -0
  128. package/src/superlocalmemory/storage/migrations/M045_fact_outcome_score.py +158 -0
  129. package/src/superlocalmemory/storage/migrations/M046_prospective_memory_has_its_own_name.py +620 -0
  130. package/src/superlocalmemory/storage/migrations/M047_fisher_vectors_are_stored_like_every_other_vector.py +306 -0
  131. package/src/superlocalmemory/storage/migrations/M048_upcoming_holds_only_what_is_upcoming.py +207 -0
  132. package/src/superlocalmemory/storage/migrations/M049_a_schema_version_marker_is_one_row.py +201 -0
  133. package/src/superlocalmemory/storage/migrations.py +18 -2
  134. package/src/superlocalmemory/storage/models.py +40 -1
  135. package/src/superlocalmemory/storage/projection_outbox.py +346 -0
  136. package/src/superlocalmemory/storage/retention_policy.py +860 -0
  137. package/src/superlocalmemory/storage/schema.py +35 -1
  138. package/src/superlocalmemory/storage/write_coordinator.py +19 -2
  139. package/src/superlocalmemory/trust/scorer.py +43 -1
  140. package/src/superlocalmemory/ui/index.html +9 -18
  141. package/src/superlocalmemory/ui/js/event-delegation.js +12 -1
  142. package/src/superlocalmemory/ui/js/od-health.js +28 -6
  143. package/src/superlocalmemory/ui/js/od-memories.js +19 -0
  144. package/src/superlocalmemory/ui/js/od-settings.js +87 -1
  145. package/src/superlocalmemory/ui/js/recall-lab.js +78 -3
@@ -103,8 +103,10 @@ remember(
103
103
  project: str = "", # project scope, e.g. "superlocalmemory"
104
104
  importance: int = 5,# 1–10; see scale below
105
105
  session_id: str = "",# from session_init; attributes the write to this session
106
+ session_date: str = "",# when the memory is ABOUT, if not today
106
107
  scope: str = None, # v3.6.15 multi-scope: "personal" (default) | "shared" | "global"
107
108
  shared_with: str = "",# comma-separated profile_ids for scope="shared"
109
+ idempotency_key: str = "",# replaying the same key will not store a second copy
108
110
  )
109
111
  ```
110
112
 
@@ -121,14 +123,44 @@ remember(
121
123
 
122
124
  Use 7–10 only for facts that would cause real damage if forgotten.
123
125
 
124
- ### 4. One fact per call
126
+ ### 4. Date a memory to when it happened
127
+
128
+ `session_date` says **when the memory is about**, as distinct from when you
129
+ wrote it. Omit it and the memory is dated today.
130
+
131
+ ```
132
+ remember(
133
+ content="The outage on the payments queue was caused by a stale DNS entry",
134
+ tags="incident,payments,postmortem",
135
+ project="platform",
136
+ session_date="2026-08-14", # YYYY-MM-DD, or a full ISO 8601 timestamp
137
+ session_id="<sid>",
138
+ )
139
+ ```
140
+
141
+ Use it whenever you are writing something down after the fact — a postmortem, a
142
+ decision taken in a meeting last week, a migration that ran on a known date.
143
+ Time-filtered recall (`window="7d"`, `window="2026-07-01..2026-07-31"`) reads
144
+ event time, so a mis-dated memory is one a time-scoped question cannot find.
145
+
146
+ `session_date` does not change what **kind** of memory it is. A memory that
147
+ describes something planned — "the migration is scheduled for Tuesday", "the
148
+ certificate expires on 2026-09-01" — is stored as a **prospective** memory, and
149
+ recall reports it as `"fact_type": "prospective"`. That is inferred from how the
150
+ content reads, not from the date you pass. Stores written before 4.1.0 spelled
151
+ this type `"temporal"`; that value still reads correctly and needs nothing from
152
+ you.
153
+
154
+ ---
155
+
156
+ ### 5. One fact per call
125
157
 
126
158
  Store one atomic fact per `remember` call. Do not concatenate multiple unrelated
127
159
  points into a single content string — they will be hard to update individually
128
160
  and harder to retrieve cleanly. If you have three separate decisions, make three
129
161
  calls.
130
162
 
131
- ### 5. Always set tags and project
163
+ ### 6. Always set tags and project
132
164
 
133
165
  Untagged, unscoped facts are harder to retrieve and harder to manage. Minimum:
134
166
  set `tags` to one or two relevant terms and `project` to the repo/product name.
@@ -238,4 +270,4 @@ different workspace, use `switch_profile` first. See `slm-profile`.
238
270
 
239
271
  ---
240
272
 
241
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
273
+ *SuperLocalMemory v4.1.2 · Qualixar · AGPL-3.0-or-later*
@@ -173,4 +173,4 @@ to review the impact. See `slm-remember` for the full deletion discipline.
173
173
 
174
174
  ---
175
175
 
176
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
176
+ *SuperLocalMemory v4.1.2 · Qualixar · AGPL-3.0-or-later*
@@ -121,7 +121,14 @@ remember(content="...", session_id=session_id, tags="auth,decision", project="my
121
121
  ```
122
122
 
123
123
  This attribution is what allows the ranker to learn which recalls led to useful
124
- outcomes for this project.
124
+ outcomes for this project. It also gives the session a small working set, so
125
+ successive recalls in one conversation build on what the earlier ones surfaced
126
+ instead of each starting cold.
127
+
128
+ **Do not synthesise a session id.** An id beginning `http:`, `mcp:`, `cli:` or
129
+ `probe:` is read as a synthetic per-request label rather than a conversation and
130
+ is deliberately excluded from that working set. Use the one `session_init`
131
+ returned, unchanged, for the whole session.
125
132
 
126
133
  ---
127
134
 
@@ -177,6 +184,23 @@ never attributed to a project or agent. Over many sessions this compounds:
177
184
  projects where lifecycle is respected have measurably better retrieval quality
178
185
  than projects where session_init is skipped.
179
186
 
187
+ Within a single session it compounds faster. The session's working set holds the
188
+ memories its recalls have already surfaced, and later recalls rank those higher,
189
+ so a long conversation converges on the material it is actually about.
190
+
191
+ ### Closing the loop explicitly
192
+
193
+ Engagement signals say a memory was *shown*. `report_outcome` says it was
194
+ *right*:
195
+
196
+ ```
197
+ report_outcome(memory_ids="<ids you actually used>", outcome="success")
198
+ ```
199
+
200
+ Send it when a recalled memory changed what you did, and send `failure` when a
201
+ confidently-returned memory turned out to be wrong — that is the only signal
202
+ that stops a stale memory from being promoted. See the `slm-recall` skill.
203
+
180
204
  ---
181
205
 
182
206
  ## CLI fallback (when MCP is unavailable)
@@ -198,7 +222,9 @@ slm doctor [--json] # preflight check including daemon and embedding worker
198
222
  | Mistake | Consequence | Fix |
199
223
  |---------|-------------|-----|
200
224
  | Calling `session_init` twice in one session | Two session IDs; signals split across them | Call once; store the returned ID |
201
- | Omitting `session_id` from `recall` / `remember` | No learning attribution | Always pass the stored `session_id` |
225
+ | Omitting `session_id` from `recall` / `remember` | No learning attribution, and every turn starts cold | Always pass the stored `session_id` |
226
+ | Inventing a `session_id` such as `mcp:agent` or `http:1234` | Read as synthetic, excluded from the working set | Use the id `session_init` returned |
227
+ | Never reporting an outcome | Ranking cannot tell a useful memory from a merely returned one | `report_outcome` after a recall that changed what you did |
202
228
  | Never calling `close_session` | Temporal summaries not written | Call at end of each meaningful work unit |
203
229
  | Calling `close_session` without a `session_id` when no prior writes exist | Returns error "No session_id found" | Pass the explicit `session_id` from `session_init` |
204
230
 
@@ -227,4 +253,4 @@ explicitly and call `recall` with `include_global`/`include_shared` after
227
253
 
228
254
  ---
229
255
 
230
- *SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later*
256
+ *SuperLocalMemory v4.1.2 · Qualixar · AGPL-3.0-or-later*
@@ -163,4 +163,4 @@ multi-profile setup. To switch the active profile, see `slm-profile`.
163
163
 
164
164
  ---
165
165
 
166
- SuperLocalMemory v4.0.4 · Qualixar · AGPL-3.0-or-later
166
+ SuperLocalMemory v4.1.2 · Qualixar · AGPL-3.0-or-later
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "superlocalmemory"
3
- version = "4.0.10"
3
+ version = "4.1.2"
4
4
  description = "Local-first agent memory with auditable hybrid retrieval"
5
5
  readme = "README.md"
6
6
  license = "AGPL-3.0-or-later"
@@ -32,7 +32,7 @@ if "OMP_NUM_THREADS" not in os.environ:
32
32
  os.environ["OMP_NUM_THREADS"] = "2"
33
33
  # ---------------------------------------------------------------------------
34
34
 
35
- __version__ = "4.0.10"
35
+ __version__ = "4.1.2"
36
36
 
37
37
  _REQUIRED_VERSIONS = {
38
38
  "sentence_transformers": "5.3.0",