superlocalmemory 2.3.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/ATTRIBUTION.md +140 -0
- package/CHANGELOG.md +1749 -0
- package/LICENSE +21 -0
- package/README.md +600 -0
- package/bin/aider-smart +72 -0
- package/bin/slm +202 -0
- package/bin/slm-npm +73 -0
- package/bin/slm.bat +195 -0
- package/bin/slm.cmd +10 -0
- package/bin/superlocalmemoryv2:list +3 -0
- package/bin/superlocalmemoryv2:profile +3 -0
- package/bin/superlocalmemoryv2:recall +3 -0
- package/bin/superlocalmemoryv2:remember +3 -0
- package/bin/superlocalmemoryv2:reset +3 -0
- package/bin/superlocalmemoryv2:status +3 -0
- package/completions/slm.bash +58 -0
- package/completions/slm.zsh +76 -0
- package/configs/antigravity-mcp.json +13 -0
- package/configs/chatgpt-desktop-mcp.json +7 -0
- package/configs/claude-desktop-mcp.json +15 -0
- package/configs/codex-mcp.toml +13 -0
- package/configs/cody-commands.json +29 -0
- package/configs/continue-mcp.yaml +14 -0
- package/configs/continue-skills.yaml +26 -0
- package/configs/cursor-mcp.json +15 -0
- package/configs/gemini-cli-mcp.json +11 -0
- package/configs/jetbrains-mcp.json +11 -0
- package/configs/opencode-mcp.json +12 -0
- package/configs/perplexity-mcp.json +9 -0
- package/configs/vscode-copilot-mcp.json +12 -0
- package/configs/windsurf-mcp.json +16 -0
- package/configs/zed-mcp.json +12 -0
- package/docs/ARCHITECTURE.md +877 -0
- package/docs/CLI-COMMANDS-REFERENCE.md +425 -0
- package/docs/COMPETITIVE-ANALYSIS.md +210 -0
- package/docs/COMPRESSION-README.md +390 -0
- package/docs/GRAPH-ENGINE.md +503 -0
- package/docs/MCP-MANUAL-SETUP.md +720 -0
- package/docs/MCP-TROUBLESHOOTING.md +787 -0
- package/docs/PATTERN-LEARNING.md +363 -0
- package/docs/PROFILES-GUIDE.md +453 -0
- package/docs/RESET-GUIDE.md +353 -0
- package/docs/SEARCH-ENGINE-V2.2.0.md +748 -0
- package/docs/SEARCH-INTEGRATION-GUIDE.md +502 -0
- package/docs/UI-SERVER.md +254 -0
- package/docs/UNIVERSAL-INTEGRATION.md +432 -0
- package/docs/V2.2.0-OPTIONAL-SEARCH.md +666 -0
- package/docs/WINDOWS-INSTALL-README.txt +34 -0
- package/docs/WINDOWS-POST-INSTALL.txt +45 -0
- package/docs/example_graph_usage.py +148 -0
- package/hooks/memory-list-skill.js +130 -0
- package/hooks/memory-profile-skill.js +284 -0
- package/hooks/memory-recall-skill.js +109 -0
- package/hooks/memory-remember-skill.js +127 -0
- package/hooks/memory-reset-skill.js +274 -0
- package/install-skills.sh +436 -0
- package/install.ps1 +417 -0
- package/install.sh +755 -0
- package/mcp_server.py +585 -0
- package/package.json +94 -0
- package/requirements-core.txt +24 -0
- package/requirements.txt +10 -0
- package/scripts/postinstall.js +126 -0
- package/scripts/preuninstall.js +57 -0
- package/skills/slm-build-graph/SKILL.md +423 -0
- package/skills/slm-list-recent/SKILL.md +348 -0
- package/skills/slm-recall/SKILL.md +325 -0
- package/skills/slm-remember/SKILL.md +194 -0
- package/skills/slm-status/SKILL.md +363 -0
- package/skills/slm-switch-profile/SKILL.md +442 -0
- package/src/__pycache__/cache_manager.cpython-312.pyc +0 -0
- package/src/__pycache__/embedding_engine.cpython-312.pyc +0 -0
- package/src/__pycache__/graph_engine.cpython-312.pyc +0 -0
- package/src/__pycache__/hnsw_index.cpython-312.pyc +0 -0
- package/src/__pycache__/hybrid_search.cpython-312.pyc +0 -0
- package/src/__pycache__/memory-profiles.cpython-312.pyc +0 -0
- package/src/__pycache__/memory-reset.cpython-312.pyc +0 -0
- package/src/__pycache__/memory_compression.cpython-312.pyc +0 -0
- package/src/__pycache__/memory_store_v2.cpython-312.pyc +0 -0
- package/src/__pycache__/migrate_v1_to_v2.cpython-312.pyc +0 -0
- package/src/__pycache__/pattern_learner.cpython-312.pyc +0 -0
- package/src/__pycache__/query_optimizer.cpython-312.pyc +0 -0
- package/src/__pycache__/search_engine_v2.cpython-312.pyc +0 -0
- package/src/__pycache__/setup_validator.cpython-312.pyc +0 -0
- package/src/__pycache__/tree_manager.cpython-312.pyc +0 -0
- package/src/cache_manager.py +520 -0
- package/src/embedding_engine.py +671 -0
- package/src/graph_engine.py +970 -0
- package/src/hnsw_index.py +626 -0
- package/src/hybrid_search.py +693 -0
- package/src/memory-profiles.py +518 -0
- package/src/memory-reset.py +485 -0
- package/src/memory_compression.py +999 -0
- package/src/memory_store_v2.py +1088 -0
- package/src/migrate_v1_to_v2.py +638 -0
- package/src/pattern_learner.py +898 -0
- package/src/query_optimizer.py +513 -0
- package/src/search_engine_v2.py +403 -0
- package/src/setup_validator.py +479 -0
- package/src/tree_manager.py +720 -0
|
@@ -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: "2.1.0"
|
|
5
|
+
license: MIT
|
|
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 project's memories
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
**Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
|
|
344
|
+
**Project:** SuperLocalMemory V2
|
|
345
|
+
**License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
|
|
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,325 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slm-recall
|
|
3
|
+
description: Search and retrieve memories using semantic similarity, knowledge graph relationships, and full-text search. Use when the user asks to recall information, search memories, find past decisions, or query stored knowledge. Returns ranked results with relevance scores.
|
|
4
|
+
version: "2.1.0"
|
|
5
|
+
license: MIT
|
|
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: 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
|
+
|
|
146
|
+
## Advanced Usage
|
|
147
|
+
|
|
148
|
+
### Natural Language (in AI chat)
|
|
149
|
+
|
|
150
|
+
Most AI assistants automatically invoke this skill when you ask:
|
|
151
|
+
- "What did we decide about..."
|
|
152
|
+
- "Recall information about..."
|
|
153
|
+
- "Search for..."
|
|
154
|
+
- "What do we know about..."
|
|
155
|
+
|
|
156
|
+
**Example in Cursor/Claude:**
|
|
157
|
+
```
|
|
158
|
+
You: "What did we decide about authentication?"
|
|
159
|
+
AI: [Automatically invokes slm-recall skill]
|
|
160
|
+
Found 3 memories about JWT tokens and OAuth...
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Combined with Other Skills
|
|
164
|
+
|
|
165
|
+
**1. Recall then remember:**
|
|
166
|
+
```bash
|
|
167
|
+
# Find existing memories
|
|
168
|
+
slm recall "API design"
|
|
169
|
+
|
|
170
|
+
# Add new related memory
|
|
171
|
+
slm remember "New API versioning strategy: use /v2/ prefix" --tags api,versioning
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**2. Recall then build graph:**
|
|
175
|
+
```bash
|
|
176
|
+
# Find memories
|
|
177
|
+
slm recall "performance"
|
|
178
|
+
|
|
179
|
+
# Rebuild graph to discover new connections
|
|
180
|
+
slm build-graph
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Scripting & Automation
|
|
184
|
+
|
|
185
|
+
**Find and export:**
|
|
186
|
+
```bash
|
|
187
|
+
# Search and save to file
|
|
188
|
+
slm recall "security" --min-score 0.7 > security-notes.txt
|
|
189
|
+
|
|
190
|
+
# Count memories matching query
|
|
191
|
+
slm recall "python" --limit 999 | grep "^\\[ID:" | wc -l
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Regular reminders:**
|
|
195
|
+
```bash
|
|
196
|
+
# Daily standup helper (cron job)
|
|
197
|
+
#!/bin/bash
|
|
198
|
+
echo "Yesterday's decisions:"
|
|
199
|
+
slm recall "decided" --limit 5
|
|
200
|
+
|
|
201
|
+
echo -e "\nCurrent blockers:"
|
|
202
|
+
slm recall "blocked" --tags critical --limit 3
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Troubleshooting
|
|
206
|
+
|
|
207
|
+
### "No memories found"
|
|
208
|
+
|
|
209
|
+
**Causes:**
|
|
210
|
+
1. No memories matching query
|
|
211
|
+
2. Min-score too high
|
|
212
|
+
3. Wrong project filter
|
|
213
|
+
|
|
214
|
+
**Solutions:**
|
|
215
|
+
```bash
|
|
216
|
+
# Lower minimum score
|
|
217
|
+
slm recall "query" --min-score 0.1
|
|
218
|
+
|
|
219
|
+
# Remove filters
|
|
220
|
+
slm recall "query" # No project/tag filters
|
|
221
|
+
|
|
222
|
+
# Check what memories exist
|
|
223
|
+
slm list --limit 20
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### "Search too slow"
|
|
227
|
+
|
|
228
|
+
**Causes:**
|
|
229
|
+
- Large database (10,000+ memories)
|
|
230
|
+
- Complex query
|
|
231
|
+
- Knowledge graph not optimized
|
|
232
|
+
|
|
233
|
+
**Solutions:**
|
|
234
|
+
```bash
|
|
235
|
+
# Rebuild indexes
|
|
236
|
+
slm build-graph
|
|
237
|
+
|
|
238
|
+
# Use filters to narrow search
|
|
239
|
+
slm recall "query" --project myapp --tags specific-tag
|
|
240
|
+
|
|
241
|
+
# Increase min-score (fewer results = faster)
|
|
242
|
+
slm recall "query" --min-score 0.7
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### "Results not relevant"
|
|
246
|
+
|
|
247
|
+
**Causes:**
|
|
248
|
+
- Query too vague
|
|
249
|
+
- Need to add more context
|
|
250
|
+
|
|
251
|
+
**Solutions:**
|
|
252
|
+
```bash
|
|
253
|
+
# Be more specific
|
|
254
|
+
❌ slm recall "it"
|
|
255
|
+
✅ slm recall "authentication system"
|
|
256
|
+
|
|
257
|
+
# Use multiple keywords
|
|
258
|
+
✅ slm recall "FastAPI JWT authentication"
|
|
259
|
+
|
|
260
|
+
# Use tags to filter
|
|
261
|
+
✅ slm recall "performance" --tags database
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Output Formats
|
|
265
|
+
|
|
266
|
+
### Standard Format (Default)
|
|
267
|
+
```
|
|
268
|
+
🔍 Search Results (3 found)
|
|
269
|
+
|
|
270
|
+
[ID: 42] Score: 0.85
|
|
271
|
+
Content preview...
|
|
272
|
+
Tags: tag1, tag2
|
|
273
|
+
Project: myapp
|
|
274
|
+
Created: 2026-02-05
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Programmatic Use
|
|
278
|
+
```bash
|
|
279
|
+
# JSON output (for scripts)
|
|
280
|
+
slm recall "query" --format json
|
|
281
|
+
# {"results": [{"id": 42, "content": "...", "score": 0.85}, ...]}
|
|
282
|
+
|
|
283
|
+
# CSV output
|
|
284
|
+
slm recall "query" --format csv
|
|
285
|
+
# id,content,score,tags,project,created_at
|
|
286
|
+
# 42,"Content...",0.85,"tag1,tag2",myapp,2026-02-05
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Performance Benchmarks
|
|
290
|
+
|
|
291
|
+
| Database Size | Search Time | Notes |
|
|
292
|
+
|--------------|-------------|-------|
|
|
293
|
+
| 100 memories | ~100ms | Instant |
|
|
294
|
+
| 1,000 memories | ~500ms | Fast |
|
|
295
|
+
| 10,000 memories | ~1.5s | Acceptable |
|
|
296
|
+
| 50,000 memories | ~5s | Consider filtering |
|
|
297
|
+
|
|
298
|
+
**Optimization tips:**
|
|
299
|
+
- Use `--min-score` to filter early
|
|
300
|
+
- Use `--tags` or `--project` to narrow search
|
|
301
|
+
- Rebuild graph periodically: `slm build-graph`
|
|
302
|
+
|
|
303
|
+
## Notes
|
|
304
|
+
|
|
305
|
+
- **Multi-method:** Combines semantic, graph, and keyword search
|
|
306
|
+
- **Ranked results:** Best matches first
|
|
307
|
+
- **Cross-tool:** Same results in Cursor, ChatGPT, Claude, etc.
|
|
308
|
+
- **Privacy:** All search happens locally
|
|
309
|
+
- **Real-time:** Database updates reflected immediately
|
|
310
|
+
|
|
311
|
+
## Related Commands
|
|
312
|
+
|
|
313
|
+
- `slm remember "<content>"` - Save a new memory
|
|
314
|
+
- `slm list` - List recent memories (no search)
|
|
315
|
+
- `slm status` - Check memory count and graph stats
|
|
316
|
+
- `slm build-graph` - Optimize search performance
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
**Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
|
|
321
|
+
**Project:** SuperLocalMemory V2
|
|
322
|
+
**License:** MIT with attribution requirements (see [ATTRIBUTION.md](../../ATTRIBUTION.md))
|
|
323
|
+
**Repository:** https://github.com/varun369/SuperLocalMemoryV2
|
|
324
|
+
|
|
325
|
+
*Open source doesn't mean removing credit. Attribution must be preserved per MIT License terms.*
|