superlocalmemory 3.4.19 → 3.4.21

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 (170) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +42 -34
  3. package/bin/slm +11 -0
  4. package/bin/slm.bat +12 -0
  5. package/package.json +4 -3
  6. package/pyproject.toml +3 -2
  7. package/scripts/build-slm-hook.ps1 +40 -0
  8. package/scripts/build-slm-hook.sh +45 -0
  9. package/scripts/build_entry.py +452 -0
  10. package/scripts/ci/stage5b_gate.sh +50 -0
  11. package/scripts/postinstall/validation.js +187 -0
  12. package/scripts/postinstall-interactive.js +756 -0
  13. package/scripts/postinstall_binary.js +287 -0
  14. package/scripts/release_manifest.py +273 -0
  15. package/scripts/slm-hook.spec +56 -0
  16. package/skills/slm-build-graph/SKILL.md +423 -0
  17. package/skills/slm-list-recent/SKILL.md +348 -0
  18. package/skills/slm-recall/SKILL.md +343 -0
  19. package/skills/slm-remember/SKILL.md +194 -0
  20. package/skills/slm-show-patterns/SKILL.md +224 -0
  21. package/skills/slm-status/SKILL.md +363 -0
  22. package/skills/slm-switch-profile/SKILL.md +442 -0
  23. package/src/superlocalmemory/cli/commands.py +219 -79
  24. package/src/superlocalmemory/cli/context_commands.py +192 -0
  25. package/src/superlocalmemory/cli/daemon.py +15 -1
  26. package/src/superlocalmemory/cli/db_migrate.py +80 -0
  27. package/src/superlocalmemory/cli/escape_hatch.py +220 -0
  28. package/src/superlocalmemory/cli/main.py +72 -1
  29. package/src/superlocalmemory/core/context_cache.py +397 -0
  30. package/src/superlocalmemory/core/engine.py +38 -2
  31. package/src/superlocalmemory/core/engine_wiring.py +1 -1
  32. package/src/superlocalmemory/core/ram_lock.py +111 -0
  33. package/src/superlocalmemory/core/recall_pipeline.py +433 -3
  34. package/src/superlocalmemory/core/recall_worker.py +8 -3
  35. package/src/superlocalmemory/core/security_primitives.py +635 -0
  36. package/src/superlocalmemory/core/shadow_router.py +319 -0
  37. package/src/superlocalmemory/core/slm_disabled.py +87 -0
  38. package/src/superlocalmemory/core/slmignore.py +125 -0
  39. package/src/superlocalmemory/core/topic_signature.py +143 -0
  40. package/src/superlocalmemory/core/worker_pool.py +14 -3
  41. package/src/superlocalmemory/encoding/cognitive_consolidator.py +2 -2
  42. package/src/superlocalmemory/evolution/budget.py +321 -0
  43. package/src/superlocalmemory/evolution/llm_dispatch.py +508 -0
  44. package/src/superlocalmemory/evolution/skill_evolver.py +144 -94
  45. package/src/superlocalmemory/hooks/_outcome_common.py +506 -0
  46. package/src/superlocalmemory/hooks/adapter_base.py +317 -0
  47. package/src/superlocalmemory/hooks/antigravity_adapter.py +192 -0
  48. package/src/superlocalmemory/hooks/claude_code_hooks.py +33 -1
  49. package/src/superlocalmemory/hooks/context_payload.py +312 -0
  50. package/src/superlocalmemory/hooks/copilot_adapter.py +154 -0
  51. package/src/superlocalmemory/hooks/cross_platform_connector.py +90 -0
  52. package/src/superlocalmemory/hooks/cursor_adapter.py +195 -0
  53. package/src/superlocalmemory/hooks/hook_handlers.py +109 -8
  54. package/src/superlocalmemory/hooks/ide_connector.py +25 -2
  55. package/src/superlocalmemory/hooks/post_tool_async_hook.py +165 -0
  56. package/src/superlocalmemory/hooks/post_tool_outcome_hook.py +223 -0
  57. package/src/superlocalmemory/hooks/prewarm_auth.py +170 -0
  58. package/src/superlocalmemory/hooks/session_registry.py +186 -0
  59. package/src/superlocalmemory/hooks/stop_outcome_hook.py +134 -0
  60. package/src/superlocalmemory/hooks/sync_loop.py +114 -0
  61. package/src/superlocalmemory/hooks/user_prompt_hook.py +128 -0
  62. package/src/superlocalmemory/hooks/user_prompt_rehash_hook.py +202 -0
  63. package/src/superlocalmemory/infra/backup.py +3 -3
  64. package/src/superlocalmemory/infra/cloud_backup.py +2 -2
  65. package/src/superlocalmemory/infra/event_bus.py +2 -2
  66. package/src/superlocalmemory/infra/webhook_dispatcher.py +3 -3
  67. package/src/superlocalmemory/learning/arm_catalog.py +99 -0
  68. package/src/superlocalmemory/learning/bandit.py +526 -0
  69. package/src/superlocalmemory/learning/bandit_cache.py +133 -0
  70. package/src/superlocalmemory/learning/behavioral.py +53 -1
  71. package/src/superlocalmemory/learning/consolidation_cycle.py +381 -0
  72. package/src/superlocalmemory/learning/consolidation_worker.py +188 -520
  73. package/src/superlocalmemory/learning/database.py +256 -0
  74. package/src/superlocalmemory/learning/dedup_hnsw.py +413 -0
  75. package/src/superlocalmemory/learning/ensemble.py +300 -0
  76. package/src/superlocalmemory/learning/fact_outcome_joins.py +207 -0
  77. package/src/superlocalmemory/learning/forgetting_scheduler.py +55 -0
  78. package/src/superlocalmemory/learning/hnsw_dedup.py +69 -0
  79. package/src/superlocalmemory/learning/labeler.py +87 -0
  80. package/src/superlocalmemory/learning/legacy_migration.py +277 -0
  81. package/src/superlocalmemory/learning/memory_merge.py +160 -0
  82. package/src/superlocalmemory/learning/model_cache.py +269 -0
  83. package/src/superlocalmemory/learning/model_rollback.py +278 -0
  84. package/src/superlocalmemory/learning/outcome_queue.py +284 -0
  85. package/src/superlocalmemory/learning/pattern_miner.py +415 -0
  86. package/src/superlocalmemory/learning/pattern_miner_constants.py +47 -0
  87. package/src/superlocalmemory/learning/ranker.py +225 -81
  88. package/src/superlocalmemory/learning/ranker_common.py +163 -0
  89. package/src/superlocalmemory/learning/ranker_retrain_legacy.py +202 -0
  90. package/src/superlocalmemory/learning/ranker_retrain_online.py +411 -0
  91. package/src/superlocalmemory/learning/reward.py +777 -0
  92. package/src/superlocalmemory/learning/reward_archive.py +210 -0
  93. package/src/superlocalmemory/learning/reward_boost.py +201 -0
  94. package/src/superlocalmemory/learning/reward_proxy.py +326 -0
  95. package/src/superlocalmemory/learning/shadow_test.py +524 -0
  96. package/src/superlocalmemory/learning/signal_worker.py +270 -0
  97. package/src/superlocalmemory/learning/signals.py +314 -0
  98. package/src/superlocalmemory/learning/trigram_index.py +547 -0
  99. package/src/superlocalmemory/mcp/server.py +5 -5
  100. package/src/superlocalmemory/mcp/tools_context.py +183 -0
  101. package/src/superlocalmemory/mcp/tools_core.py +92 -27
  102. package/src/superlocalmemory/parameterization/soft_prompt_generator.py +13 -0
  103. package/src/superlocalmemory/retrieval/engine.py +52 -0
  104. package/src/superlocalmemory/server/api.py +2 -2
  105. package/src/superlocalmemory/server/bandit_loops.py +140 -0
  106. package/src/superlocalmemory/server/middleware/__init__.py +11 -0
  107. package/src/superlocalmemory/server/middleware/security_headers.py +144 -0
  108. package/src/superlocalmemory/server/routes/backup.py +36 -13
  109. package/src/superlocalmemory/server/routes/behavioral.py +50 -19
  110. package/src/superlocalmemory/server/routes/brain.py +1234 -0
  111. package/src/superlocalmemory/server/routes/data_io.py +4 -4
  112. package/src/superlocalmemory/server/routes/events.py +2 -2
  113. package/src/superlocalmemory/server/routes/helpers.py +1 -1
  114. package/src/superlocalmemory/server/routes/learning.py +192 -7
  115. package/src/superlocalmemory/server/routes/memories.py +189 -1
  116. package/src/superlocalmemory/server/routes/prewarm.py +171 -0
  117. package/src/superlocalmemory/server/routes/profiles.py +3 -3
  118. package/src/superlocalmemory/server/routes/token.py +88 -0
  119. package/src/superlocalmemory/server/routes/ws.py +5 -5
  120. package/src/superlocalmemory/server/security_middleware.py +13 -7
  121. package/src/superlocalmemory/server/ui.py +2 -2
  122. package/src/superlocalmemory/server/unified_daemon.py +335 -3
  123. package/src/superlocalmemory/storage/migration_runner.py +545 -0
  124. package/src/superlocalmemory/storage/migrations/M001_add_signal_features_columns.py +67 -0
  125. package/src/superlocalmemory/storage/migrations/M002_model_state_history.py +132 -0
  126. package/src/superlocalmemory/storage/migrations/M003_migration_log.py +38 -0
  127. package/src/superlocalmemory/storage/migrations/M004_cross_platform_sync_log.py +46 -0
  128. package/src/superlocalmemory/storage/migrations/M005_bandit_tables.py +75 -0
  129. package/src/superlocalmemory/storage/migrations/M006_action_outcomes_reward.py +75 -0
  130. package/src/superlocalmemory/storage/migrations/M007_pending_outcomes.py +63 -0
  131. package/src/superlocalmemory/storage/migrations/M009_model_lineage.py +54 -0
  132. package/src/superlocalmemory/storage/migrations/M010_evolution_config.py +75 -0
  133. package/src/superlocalmemory/storage/migrations/M011_archive_and_merge.py +87 -0
  134. package/src/superlocalmemory/storage/migrations/M012_shadow_observations.py +72 -0
  135. package/src/superlocalmemory/storage/migrations/M013_bi_temporal_columns.py +55 -0
  136. package/src/superlocalmemory/storage/migrations/__init__.py +81 -0
  137. package/src/superlocalmemory/storage/models.py +4 -0
  138. package/src/superlocalmemory/ui/css/brain.css +409 -0
  139. package/src/superlocalmemory/ui/css/legacy-dashboard.css +645 -0
  140. package/src/superlocalmemory/ui/index.html +459 -1345
  141. package/src/superlocalmemory/ui/js/brain.js +1321 -0
  142. package/src/superlocalmemory/ui/js/clusters.js +123 -4
  143. package/src/superlocalmemory/ui/js/init.js +48 -39
  144. package/src/superlocalmemory/ui/js/memories.js +88 -2
  145. package/src/superlocalmemory/ui/js/modal.js +71 -1
  146. package/src/superlocalmemory/ui/js/ng-shell.js +101 -88
  147. package/src/superlocalmemory/ui/js/trust-dashboard.js +168 -25
  148. package/src/superlocalmemory/ui/vendor/bootstrap-icons/bootstrap-icons.css +2018 -0
  149. package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
  150. package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
  151. package/src/superlocalmemory/ui/vendor/bootstrap.bundle.min.js +7 -0
  152. package/src/superlocalmemory/ui/vendor/bootstrap.min.css +6 -0
  153. package/src/superlocalmemory/ui/vendor/d3.v7.min.js +2 -0
  154. package/src/superlocalmemory/ui/vendor/graphology-library.min.js +2 -0
  155. package/src/superlocalmemory/ui/vendor/graphology.umd.min.js +2 -0
  156. package/src/superlocalmemory/ui/vendor/inter-ui/inter-variable.min.css +8 -0
  157. package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable-Italic.woff2 +0 -0
  158. package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable.woff2 +0 -0
  159. package/src/superlocalmemory/ui/vendor/sigma.min.js +1 -0
  160. package/src/superlocalmemory/ui/js/behavioral.js +0 -447
  161. package/src/superlocalmemory/ui/js/graph-core.js +0 -447
  162. package/src/superlocalmemory/ui/js/graph-interactions.js +0 -351
  163. package/src/superlocalmemory/ui/js/learning.js +0 -435
  164. package/src/superlocalmemory/ui/js/patterns.js +0 -93
  165. package/src/superlocalmemory.egg-info/PKG-INFO +0 -647
  166. package/src/superlocalmemory.egg-info/SOURCES.txt +0 -335
  167. package/src/superlocalmemory.egg-info/dependency_links.txt +0 -1
  168. package/src/superlocalmemory.egg-info/entry_points.txt +0 -2
  169. package/src/superlocalmemory.egg-info/requires.txt +0 -58
  170. package/src/superlocalmemory.egg-info/top_level.txt +0 -1
@@ -0,0 +1,348 @@
1
+ ---
2
+ name: slm-list-recent
3
+ description: List most recent memories in chronological order. Use when the user wants to see what was recently saved, review recent conversations, check what they worked on today, or browse memory history. Shows memories sorted by creation time (newest first).
4
+ version: "3.4.21"
5
+ license: AGPL-3.0-or-later
6
+ compatibility: "Requires SuperLocalMemory V2 installed at ~/.claude-memory/"
7
+ attribution:
8
+ creator: Varun Pratap Bhardwaj
9
+ role: Solution Architect & Original Creator
10
+ project: SuperLocalMemory V2
11
+ ---
12
+
13
+ # SuperLocalMemory: List Recent
14
+
15
+ List most recent memories in chronological order (newest first).
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ slm list [--limit N] [--project name] [--tags tag1,tag2] [--today|--week|--month]
21
+ ```
22
+
23
+ ## Examples
24
+
25
+ ### Example 1: Last 10 Memories (Default)
26
+ ```bash
27
+ $ slm list
28
+ ```
29
+
30
+ **Output:**
31
+ ```
32
+ 📝 Recent Memories (10 most recent)
33
+
34
+ [ID: 1247] 5 minutes ago
35
+ Fixed JWT token refresh bug - tokens were expiring too fast
36
+ Tags: bug-fix, jwt, auth
37
+ Project: myapp
38
+ Importance: 8
39
+
40
+ [ID: 1246] 2 hours ago
41
+ React hooks best practices: useCallback for memoization
42
+ Tags: react, performance, hooks
43
+ Project: frontend-app
44
+ Importance: 6
45
+
46
+ [ID: 1245] 4 hours ago
47
+ Database migration strategy: use Alembic for versioning
48
+ Tags: database, postgresql, migration
49
+ Project: myapp
50
+ Importance: 7
51
+
52
+ [ID: 1244] Yesterday 18:42
53
+ Decided to use FastAPI over Flask for new microservice
54
+ Tags: python, backend, api, decision
55
+ Project: myapp
56
+ Importance: 9
57
+
58
+ [ID: 1243] Yesterday 15:30
59
+ Code review feedback: add more error handling to API endpoints
60
+ Tags: code-review, api, error-handling
61
+ Project: myapp
62
+ Importance: 6
63
+
64
+ ...
65
+ ```
66
+
67
+ ### Example 2: Last 5 Memories
68
+ ```bash
69
+ $ slm list --limit 5
70
+ ```
71
+
72
+ ### Example 3: Today's Memories
73
+ ```bash
74
+ $ slm list --today
75
+ ```
76
+
77
+ **Shows only memories created today**
78
+
79
+ ### Example 4: This Week
80
+ ```bash
81
+ $ slm list --week
82
+ ```
83
+
84
+ **Shows memories from last 7 days**
85
+
86
+ ### Example 5: Filter by Project
87
+ ```bash
88
+ $ slm list --project myapp --limit 20
89
+ ```
90
+
91
+ **Shows 20 most recent memories from "myapp" project**
92
+
93
+ ### Example 6: Filter by Tags
94
+ ```bash
95
+ $ slm list --tags security,auth --limit 15
96
+ ```
97
+
98
+ **Shows 15 most recent memories tagged with security AND auth**
99
+
100
+ ## Arguments
101
+
102
+ | Argument | Type | Required | Default | Description |
103
+ |----------|------|----------|---------|-------------|
104
+ | `--limit` | integer | No | 10 | Number of memories to show |
105
+ | `--project` | string | No | All | Filter by project |
106
+ | `--tags` | string | No | All | Filter by tags (comma-separated) |
107
+ | `--today` | flag | No | - | Show only today's memories |
108
+ | `--week` | flag | No | - | Show last 7 days |
109
+ | `--month` | flag | No | - | Show last 30 days |
110
+
111
+ ## Sorting & Display
112
+
113
+ ### Chronological Order
114
+ Memories are always shown **newest first** (reverse chronological).
115
+
116
+ **Rationale:** Recent context is usually most relevant.
117
+
118
+ ### Timestamps
119
+ - **"5 minutes ago"** - Within last hour
120
+ - **"2 hours ago"** - Within last 24 hours
121
+ - **"Yesterday 18:42"** - Yesterday with time
122
+ - **"Feb 05 14:23"** - Older than yesterday
123
+
124
+ ### Content Preview
125
+ - First 200 characters shown
126
+ - Ellipsis (...) if truncated
127
+ - Use `slm recall --id <ID>` for full content
128
+
129
+ ## Use Cases
130
+
131
+ ### 1. Daily Standup Prep
132
+ ```bash
133
+ # What did I work on yesterday?
134
+ slm list --yesterday
135
+ ```
136
+
137
+ ### 2. Resume Context
138
+ ```bash
139
+ # What was I working on before lunch?
140
+ slm list --today --limit 5
141
+ ```
142
+
143
+ ### 3. Weekly Review
144
+ ```bash
145
+ # What decisions did I make this week?
146
+ slm list --week --tags decision
147
+ ```
148
+
149
+ ### 4. Project Check-In
150
+ ```bash
151
+ # Recent memories for current project
152
+ slm list --project myapp --limit 20
153
+ ```
154
+
155
+ ### 5. Security Audit
156
+ ```bash
157
+ # All security-related memories
158
+ slm list --tags security --limit 100
159
+ ```
160
+
161
+ ## Advanced Usage
162
+
163
+ ### Pagination
164
+ ```bash
165
+ # First page
166
+ slm list --limit 10
167
+
168
+ # Next page (note IDs, then use recall)
169
+ slm recall --before-id 1237 --limit 10
170
+ ```
171
+
172
+ ### Export to File
173
+ ```bash
174
+ # Save recent work to file
175
+ slm list --week > this-week.txt
176
+
177
+ # JSON export (for processing)
178
+ slm list --format json --limit 100 > memories.json
179
+ ```
180
+
181
+ ### Pipe to Other Commands
182
+ ```bash
183
+ # Count memories per project
184
+ slm list --limit 1000 | grep "Project:" | sort | uniq -c
185
+
186
+ # Find common tags
187
+ slm list --limit 500 | grep "Tags:" | tr ',' '\n' | sort | uniq -c | sort -rn
188
+ ```
189
+
190
+ ### Combined with Other Skills
191
+ ```bash
192
+ # 1. List recent memories
193
+ slm list --today
194
+
195
+ # 2. Notice interesting pattern
196
+
197
+ # 3. Search for related memories
198
+ slm recall "FastAPI performance"
199
+
200
+ # 4. Add new related memory
201
+ slm remember "FastAPI async endpoints improve throughput by 3x" --tags performance,fastapi
202
+ ```
203
+
204
+ ## Output Formats
205
+
206
+ ### Standard Format (Default)
207
+ ```
208
+ [ID: 42] Timestamp
209
+ Content preview...
210
+ Tags: tag1, tag2
211
+ Project: name
212
+ Importance: 7
213
+ ```
214
+
215
+ ### Compact Format
216
+ ```bash
217
+ slm list --format compact
218
+ ```
219
+ ```
220
+ 42 | 5m ago | Content preview... | myapp
221
+ 43 | 2h ago | Another memory... | default
222
+ ```
223
+
224
+ ### JSON Format
225
+ ```bash
226
+ slm list --format json
227
+ ```
228
+ ```json
229
+ {
230
+ "memories": [
231
+ {
232
+ "id": 42,
233
+ "content": "Full content here",
234
+ "tags": ["tag1", "tag2"],
235
+ "project": "myapp",
236
+ "importance": 7,
237
+ "created_at": "2026-02-07T14:23:00Z"
238
+ }
239
+ ],
240
+ "count": 10,
241
+ "total": 1247
242
+ }
243
+ ```
244
+
245
+ ### CSV Format
246
+ ```bash
247
+ slm list --format csv
248
+ ```
249
+ ```csv
250
+ id,content,tags,project,importance,created_at
251
+ 42,"Content here","tag1,tag2",myapp,7,2026-02-07T14:23:00Z
252
+ 43,"Another memory","tag3",default,5,2026-02-07T12:15:00Z
253
+ ```
254
+
255
+ ## Performance
256
+
257
+ | Memory Count | List Time | Notes |
258
+ |--------------|-----------|-------|
259
+ | 10 | ~50ms | Instant |
260
+ | 100 | ~200ms | Fast |
261
+ | 1,000 | ~500ms | Acceptable |
262
+ | 10,000+ | ~1s | Use filters |
263
+
264
+ **Optimization tips:**
265
+ - Use `--limit` to reduce results
266
+ - Use `--project` or `--tags` filters
267
+ - Use time filters (`--today`, `--week`)
268
+
269
+ ## Troubleshooting
270
+
271
+ ### "No memories found"
272
+ **Cause:** Empty database or filters too restrictive
273
+
274
+ **Solution:**
275
+ ```bash
276
+ # Check total memory count
277
+ slm status | grep "Total Memories"
278
+
279
+ # Remove filters
280
+ slm list # No filters
281
+
282
+ # Try different project
283
+ slm list --project default
284
+ ```
285
+
286
+ ### "List takes too long"
287
+ **Cause:** Large database, no filters
288
+
289
+ **Solution:**
290
+ ```bash
291
+ # Use smaller limit
292
+ slm list --limit 5
293
+
294
+ # Add filters
295
+ slm list --today --project myapp
296
+
297
+ # Rebuild indexes
298
+ slm build-graph
299
+ ```
300
+
301
+ ### "Timestamps wrong"
302
+ **Cause:** System timezone changed
303
+
304
+ **Solution:**
305
+ ```bash
306
+ # Check system timezone
307
+ date
308
+
309
+ # Timestamps are stored in UTC, displayed in local time
310
+ # No action needed usually
311
+ ```
312
+
313
+ ## Comparison with Search
314
+
315
+ | Feature | `slm list` | `slm recall` |
316
+ |---------|------------|--------------|
317
+ | **Sorting** | Chronological | Relevance |
318
+ | **Use case** | Browse recent | Find specific |
319
+ | **Speed** | Fast | Slower |
320
+ | **Filters** | Basic | Advanced |
321
+ | **Scoring** | No | Yes (relevance) |
322
+
323
+ **Rule of thumb:**
324
+ - Use `list` when you want to see **what you worked on recently**
325
+ - Use `recall` when you want to **find specific information**
326
+
327
+ ## Notes
328
+
329
+ - **Read-only:** Never modifies data
330
+ - **Real-time:** Shows latest state
331
+ - **Cross-tool:** Same list from Cursor, ChatGPT, Claude, etc.
332
+ - **Privacy:** All local, no external calls
333
+
334
+ ## Related Commands
335
+
336
+ - `slm remember` - Save a new memory
337
+ - `slm recall` - Search memories by relevance
338
+ - `slm status` - Check memory count and stats
339
+ - `slm switch-profile` - View different profile's memories
340
+
341
+ ---
342
+
343
+ **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
344
+ **Project:** SuperLocalMemory V2
345
+ **License:** MIT (see [LICENSE](../../LICENSE))
346
+ **Repository:** https://github.com/varun369/SuperLocalMemoryV2
347
+
348
+ *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
@@ -0,0 +1,343 @@
1
+ ---
2
+ name: slm-recall
3
+ description: Search SuperLocalMemory for relevant facts, decisions, and past context. Use when the user asks to recall, search, find, or retrieve stored information. Invokes 5-channel retrieval with LightGBM reranking via MCP.
4
+ version: "3.4.21"
5
+ license: AGPL-3.0-or-later
6
+ compatibility: "SuperLocalMemory v3.4.21 — MCP (preferred) or CLI fallback"
7
+ attribution:
8
+ creator: Varun Pratap Bhardwaj
9
+ role: Solution Architect & Creator
10
+ project: SuperLocalMemory v3
11
+ ---
12
+
13
+ # SuperLocalMemory: Recall
14
+
15
+ Search and retrieve memories using semantic similarity, knowledge graph relationships, and full-text search.
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ slm recall "<query>" [--limit N] [--min-score 0.0-1.0] [--tags tag1,tag2] [--project name]
21
+ ```
22
+
23
+ ## Examples
24
+
25
+ ### Example 1: Basic Search
26
+ ```bash
27
+ slm recall "FastAPI"
28
+ ```
29
+
30
+ **Output:**
31
+ ```
32
+ 🔍 Search Results (3 found)
33
+
34
+ [ID: 42] Score: 0.85
35
+ We use FastAPI for REST APIs
36
+ Tags: python, backend, api
37
+ Project: myapp
38
+ Created: 2026-02-05 14:23
39
+
40
+ [ID: 38] Score: 0.72
41
+ FastAPI is faster than Flask for high-throughput APIs
42
+ Tags: performance, python
43
+ Project: default
44
+ Created: 2026-02-01 09:15
45
+
46
+ [ID: 29] Score: 0.68
47
+ Async endpoints in FastAPI improve concurrency
48
+ Tags: async, fastapi, python
49
+ Project: myapp
50
+ Created: 2026-01-28 11:42
51
+ ```
52
+
53
+ ### Example 2: Limited Results
54
+ ```bash
55
+ slm recall "authentication" --limit 3
56
+ ```
57
+
58
+ **Returns:** Top 3 most relevant results
59
+
60
+ ### Example 3: Minimum Relevance Score
61
+ ```bash
62
+ slm recall "React hooks" --min-score 0.7
63
+ ```
64
+
65
+ **Only returns results with relevance score ≥ 0.7**
66
+
67
+ ### Example 4: Filter by Tags
68
+ ```bash
69
+ slm recall "database" --tags postgresql,performance
70
+ ```
71
+
72
+ **Only searches memories tagged with specified tags**
73
+
74
+ ### Example 5: Filter by Project
75
+ ```bash
76
+ slm recall "API design" --project myapp
77
+ ```
78
+
79
+ **Only searches memories in specified project**
80
+
81
+ ## Arguments
82
+
83
+ | Argument | Type | Required | Default | Description |
84
+ |----------|------|----------|---------|-------------|
85
+ | `<query>` | string | Yes | - | Search query |
86
+ | `--limit` | integer | No | 10 | Max results to return |
87
+ | `--min-score` | float | No | 0.3 | Minimum relevance (0.0-1-tags` | string | No | None | Filter by tags (comma-separated) |
88
+ | `--project` | string | No | None | Filter by project |
89
+
90
+ ## Search Methods Used
91
+
92
+ SuperLocalMemory uses **3 search methods simultaneously** and merges results:
93
+
94
+ ### 1. Semantic Search (TF-IDF)
95
+ - Converts query to vector
96
+ - Finds similar content vectors
97
+ - Best for: Conceptual matches
98
+
99
+ **Example:**
100
+ ```
101
+ Query: "authentication patterns"
102
+ Matches: "JWT tokens", "OAuth flow", "session management"
103
+ ```
104
+
105
+ ### 2. Knowledge Graph Traversal
106
+ - Finds related memories via graph edges
107
+ - Discovers connected concepts
108
+ - Best for: Related information
109
+
110
+ **Example:**
111
+ ```
112
+ Query: "FastAPI"
113
+ Graph finds: "REST API" → "JWT auth" → "token refresh"
114
+ ```
115
+
116
+ ### 3. Full-Text Search (FTS5)
117
+ - Exact keyword matching
118
+ - Fast for known terms
119
+ - Best for: Specific phrases
120
+
121
+ **Example:**
122
+ ```
123
+ Query: "PostgreSQL 15"
124
+ Finds: Exact mentions of "PostgreSQL 15"
125
+ ```
126
+
127
+ ## Relevance Scores
128
+
129
+ **Score range:** 0.0 - 1.0
130
+
131
+ | Score | Meaning |
132
+ |-------|---------|
133
+ | **0.9 - 1.0** | Excellent match (almost exact) |
134
+ | **0.7 - 0.9** | Strong match (very relevant) |
135
+ | **0.5 - 0.7** | Good match (related) |
136
+ | **0.3 - 0.5** | Weak match (loosely related) |
137
+ | **< 0.3** | Poor match (filtered out by default) |
138
+
139
+ **Factors affecting score:**
140
+ - Keyword overlap
141
+ - Semantic similarity
142
+ - Graph distance
143
+ - Recency (newer = slight boost)
144
+ - Importance level
145
+ - Your usage patterns (results improve automatically over time)
146
+
147
+ ## Advanced Usage
148
+
149
+ ### Natural Language (in AI chat)
150
+
151
+ Most AI assistants automatically invoke this skill when you ask:
152
+ - "What did we decide about..."
153
+ - "Recall information about..."
154
+ - "Search for..."
155
+ - "What do we know about..."
156
+
157
+ **Example in Cursor/Claude:**
158
+ ```
159
+ You: "What did we decide about authentication?"
160
+ AI: [Automatically invokes slm-recall skill]
161
+ Found 3 memories about JWT tokens and OAuth...
162
+ ```
163
+
164
+ ### Combined with Other Skills
165
+
166
+ **1. Recall then remember:**
167
+ ```bash
168
+ # Find existing memories
169
+ slm recall "API design"
170
+
171
+ # Add new related memory
172
+ slm remember "New API versioning strategy: use /v2/ prefix" --tags api,versioning
173
+ ```
174
+
175
+ **2. Recall then build graph:**
176
+ ```bash
177
+ # Find memories
178
+ slm recall "performance"
179
+
180
+ # Rebuild graph to discover new connections
181
+ slm build-graph
182
+ ```
183
+
184
+ ### Scripting & Automation
185
+
186
+ **Find and export:**
187
+ ```bash
188
+ # Search and save to file
189
+ slm recall "security" --min-score 0.7 > security-notes.txt
190
+
191
+ # Count memories matching query
192
+ slm recall "python" --limit 999 | grep "^\\[ID:" | wc -l
193
+ ```
194
+
195
+ **Regular reminders:**
196
+ ```bash
197
+ # Daily standup helper (cron job)
198
+ #!/bin/bash
199
+ echo "Yesterday's decisions:"
200
+ slm recall "decided" --limit 5
201
+
202
+ echo -e "\nCurrent blockers:"
203
+ slm recall "blocked" --tags critical --limit 3
204
+ ```
205
+
206
+ ## Troubleshooting
207
+
208
+ ### "No memories found"
209
+
210
+ **Causes:**
211
+ 1. No memories matching query
212
+ 2. Min-score too high
213
+ 3. Wrong project filter
214
+
215
+ **Solutions:**
216
+ ```bash
217
+ # Lower minimum score
218
+ slm recall "query" --min-score 0.1
219
+
220
+ # Remove filters
221
+ slm recall "query" # No project/tag filters
222
+
223
+ # Check what memories exist
224
+ slm list --limit 20
225
+ ```
226
+
227
+ ### "Search too slow"
228
+
229
+ **Causes:**
230
+ - Large database (10,000+ memories)
231
+ - Complex query
232
+ - Knowledge graph not optimized
233
+
234
+ **Solutions:**
235
+ ```bash
236
+ # Rebuild indexes
237
+ slm build-graph
238
+
239
+ # Use filters to narrow search
240
+ slm recall "query" --project myapp --tags specific-tag
241
+
242
+ # Increase min-score (fewer results = faster)
243
+ slm recall "query" --min-score 0.7
244
+ ```
245
+
246
+ ### "Results not relevant"
247
+
248
+ **Causes:**
249
+ - Query too vague
250
+ - Need to add more context
251
+
252
+ **Solutions:**
253
+ ```bash
254
+ # Be more specific
255
+ ❌ slm recall "it"
256
+ ✅ slm recall "authentication system"
257
+
258
+ # Use multiple keywords
259
+ ✅ slm recall "FastAPI JWT authentication"
260
+
261
+ # Use tags to filter
262
+ ✅ slm recall "performance" --tags database
263
+ ```
264
+
265
+ ## Output Formats
266
+
267
+ ### Standard Format (Default)
268
+ ```
269
+ 🔍 Search Results (3 found)
270
+
271
+ [ID: 42] Score: 0.85
272
+ Content preview...
273
+ Tags: tag1, tag2
274
+ Project: myapp
275
+ Created: 2026-02-05
276
+ ```
277
+
278
+ ### Programmatic Use
279
+ ```bash
280
+ # JSON output (for scripts)
281
+ slm recall "query" --format json
282
+ # {"results": [{"id": 42, "content": "...", "score": 0.85}, ...]}
283
+
284
+ # CSV output
285
+ slm recall "query" --format csv
286
+ # id,content,score,tags,project,created_at
287
+ # 42,"Content...",0.85,"tag1,tag2",myapp,2026-02-05
288
+ ```
289
+
290
+ ## Performance Benchmarks
291
+
292
+ | Database Size | Search Time | Notes |
293
+ |--------------|-------------|-------|
294
+ | 100 memories | ~100ms | Instant |
295
+ | 1,000 memories | ~500ms | Fast |
296
+ | 10,000 memories | ~1.5s | Acceptable |
297
+ | 50,000 memories | ~5s | Consider filtering |
298
+
299
+ **Optimization tips:**
300
+ - Use `--min-score` to filter early
301
+ - Use `--tags` or `--project` to narrow search
302
+ - Rebuild graph periodically: `slm build-graph`
303
+
304
+ ## Notes
305
+
306
+ - **Multi-method:** Combines semantic, graph, and keyword search
307
+ - **Ranked results:** Best matches first
308
+ - **Cross-tool:** Same results in Cursor, ChatGPT, Claude, etc.
309
+ - **Privacy:** All search happens locally
310
+ - **Real-time:** Database updates reflected immediately
311
+
312
+ ## Related Commands
313
+
314
+ - `slm remember "<content>"` - Save a new memory
315
+ - `slm list` - List recent memories (no search)
316
+ - `slm status` - Check memory count and graph stats
317
+ - `slm build-graph` - Optimize search performance
318
+
319
+ ---
320
+
321
+ **Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
322
+ **Project:** SuperLocalMemory V2
323
+ **License:** MIT (see [LICENSE](../../LICENSE))
324
+ **Repository:** https://github.com/varun369/SuperLocalMemoryV2
325
+
326
+ *Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
327
+
328
+ ## V3 Update (v3.4.21)
329
+
330
+ **Preferred**: Use the `recall` MCP tool directly — it uses 5-channel retrieval
331
+ (semantic, BM25, entity-graph, temporal, Hopfield) with LightGBM reranking
332
+ and feeds the learning loop.
333
+
334
+ ```
335
+ recall(query="your query", limit=10, session_id="<current_session>")
336
+ ```
337
+
338
+ **CLI fallback** (also valid, no MCP required):
339
+ ```bash
340
+ slm recall "<query>" [--limit N]
341
+ ```
342
+
343
+ Always pass `session_id` when using MCP so engagement signals feed the ranker.