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,353 @@
|
|
|
1
|
+
# SuperLocalMemory V2 - Reset & Reinitialize Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The reset utility provides safe ways to clear and restart your memory system.
|
|
6
|
+
|
|
7
|
+
**Always creates automatic backups before any reset operation.**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Reset Options
|
|
12
|
+
|
|
13
|
+
### 1. **Soft Reset** (Clear Memories, Keep Schema)
|
|
14
|
+
- Deletes all memories, patterns, graph data
|
|
15
|
+
- **Keeps** V2 schema structure intact
|
|
16
|
+
- **Keeps** virtual environment
|
|
17
|
+
- Fast reinitialize - just add new memories
|
|
18
|
+
|
|
19
|
+
**Use when:** You want to start fresh but keep the system installed
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python ~/.claude-memory/memory-reset.py soft
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### 2. **Hard Reset** (Nuclear Option)
|
|
28
|
+
- Deletes entire database file
|
|
29
|
+
- Reinitializes fresh V2 schema
|
|
30
|
+
- **Keeps** Python code and virtual environment
|
|
31
|
+
- **Keeps** all backups
|
|
32
|
+
- Clean slate installation
|
|
33
|
+
|
|
34
|
+
**Use when:** You want completely fresh V2 database
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python ~/.claude-memory/memory-reset.py hard --confirm
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**⚠️ Requires `--confirm` flag for safety**
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### 3. **Layer Reset** (Selective Cleanup)
|
|
45
|
+
- Clear specific layers only
|
|
46
|
+
- Keeps other layers intact
|
|
47
|
+
- Useful for rebuilding graph or patterns without losing memories
|
|
48
|
+
|
|
49
|
+
**Available layers:**
|
|
50
|
+
- `graph` - Clear graph_nodes, graph_edges, graph_clusters
|
|
51
|
+
- `patterns` - Clear identity_patterns, pattern_examples
|
|
52
|
+
- `tree` - Clear memory_tree structure
|
|
53
|
+
- `archive` - Clear memory_archive (compressed memories)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Clear only graph and patterns
|
|
57
|
+
python ~/.claude-memory/memory-reset.py layer --layers graph patterns
|
|
58
|
+
|
|
59
|
+
# Clear only graph
|
|
60
|
+
python ~/.claude-memory/memory-reset.py layer --layers graph
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### 4. **Status Check** (Non-Destructive)
|
|
66
|
+
- Shows current database statistics
|
|
67
|
+
- No changes made
|
|
68
|
+
- View row counts and database size
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python ~/.claude-memory/memory-reset.py status
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Safety Features
|
|
77
|
+
|
|
78
|
+
### Automatic Backups
|
|
79
|
+
Every reset operation creates a timestamped backup:
|
|
80
|
+
```
|
|
81
|
+
~/.claude-memory/backups/pre-reset-YYYYMMDD-HHMMSS.db
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Skip backup** (not recommended):
|
|
85
|
+
```bash
|
|
86
|
+
python ~/.claude-memory/memory-reset.py soft --no-backup
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Confirmation Prompts
|
|
90
|
+
- **Soft reset:** Asks "yes/no" confirmation
|
|
91
|
+
- **Hard reset:** Requires typing "DELETE EVERYTHING"
|
|
92
|
+
- **Layer reset:** Asks "yes/no" confirmation
|
|
93
|
+
|
|
94
|
+
### Rollback
|
|
95
|
+
If you reset by mistake:
|
|
96
|
+
```bash
|
|
97
|
+
# Find latest backup
|
|
98
|
+
ls -lt ~/.claude-memory/backups/
|
|
99
|
+
|
|
100
|
+
# Restore backup
|
|
101
|
+
cp ~/.claude-memory/backups/pre-reset-20260205-143000.db \
|
|
102
|
+
~/.claude-memory/memory.db
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Common Scenarios
|
|
108
|
+
|
|
109
|
+
### Scenario 1: "I want to start completely fresh"
|
|
110
|
+
```bash
|
|
111
|
+
# Check current state
|
|
112
|
+
python ~/.claude-memory/memory-reset.py status
|
|
113
|
+
|
|
114
|
+
# Hard reset (creates backup automatically)
|
|
115
|
+
python ~/.claude-memory/memory-reset.py hard --confirm
|
|
116
|
+
|
|
117
|
+
# Type: DELETE EVERYTHING
|
|
118
|
+
|
|
119
|
+
# Verify clean state
|
|
120
|
+
python ~/.claude-memory/memory-reset.py status
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Result:** Fresh V2 database, ready for new memories
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Scenario 2: "I want to clear memories but keep structure"
|
|
128
|
+
```bash
|
|
129
|
+
# Soft reset
|
|
130
|
+
python ~/.claude-memory/memory-reset.py soft
|
|
131
|
+
|
|
132
|
+
# Type: yes
|
|
133
|
+
|
|
134
|
+
# Add new memories
|
|
135
|
+
python ~/.claude-memory/memory_store.py add "First new memory"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Result:** Empty database with V2 schema intact
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### Scenario 3: "My graph is corrupted, rebuild it"
|
|
143
|
+
```bash
|
|
144
|
+
# Clear only graph layer
|
|
145
|
+
python ~/.claude-memory/memory-reset.py layer --layers graph
|
|
146
|
+
|
|
147
|
+
# Rebuild graph from existing memories
|
|
148
|
+
~/.claude-memory/venv/bin/python ~/.claude-memory/graph_engine.py build
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Result:** Graph rebuilt, memories and patterns untouched
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Scenario 4: "Patterns learned wrong, reset them"
|
|
156
|
+
```bash
|
|
157
|
+
# Clear only patterns layer
|
|
158
|
+
python ~/.claude-memory/memory-reset.py layer --layers patterns
|
|
159
|
+
|
|
160
|
+
# Re-learn patterns
|
|
161
|
+
~/.claude-memory/venv/bin/python ~/.claude-memory/pattern_learner.py update
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Result:** Patterns re-learned, memories and graph untouched
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## What Gets Deleted vs Kept
|
|
169
|
+
|
|
170
|
+
### Soft Reset Deletes:
|
|
171
|
+
- ✅ All memories (memories table cleared)
|
|
172
|
+
- ✅ All graph data (nodes, edges, clusters)
|
|
173
|
+
- ✅ All patterns (identity_patterns cleared)
|
|
174
|
+
- ✅ All tree structure
|
|
175
|
+
- ✅ All archives
|
|
176
|
+
|
|
177
|
+
### Soft Reset Keeps:
|
|
178
|
+
- ✅ V2 schema (all tables and indexes)
|
|
179
|
+
- ✅ Python code (memory_store_v2.py, etc.)
|
|
180
|
+
- ✅ Virtual environment
|
|
181
|
+
- ✅ Documentation
|
|
182
|
+
- ✅ All backups
|
|
183
|
+
|
|
184
|
+
### Hard Reset Deletes:
|
|
185
|
+
- ✅ Entire database file (memory.db)
|
|
186
|
+
|
|
187
|
+
### Hard Reset Keeps:
|
|
188
|
+
- ✅ Python code
|
|
189
|
+
- ✅ Virtual environment
|
|
190
|
+
- ✅ Documentation
|
|
191
|
+
- ✅ All backups
|
|
192
|
+
|
|
193
|
+
### Layer Reset Deletes:
|
|
194
|
+
- ✅ Only specified layers
|
|
195
|
+
|
|
196
|
+
### Layer Reset Keeps:
|
|
197
|
+
- ✅ Everything else
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Complete Uninstall (Not Included)
|
|
202
|
+
|
|
203
|
+
To completely remove SuperLocalMemory V2:
|
|
204
|
+
```bash
|
|
205
|
+
# Manual uninstall (use with caution)
|
|
206
|
+
rm -rf ~/.claude-memory/
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**⚠️ This deletes everything including backups!**
|
|
210
|
+
|
|
211
|
+
Better approach - keep documentation:
|
|
212
|
+
```bash
|
|
213
|
+
# Keep docs, delete data
|
|
214
|
+
rm ~/.claude-memory/memory.db
|
|
215
|
+
rm -rf ~/.claude-memory/venv/
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Verification After Reset
|
|
221
|
+
|
|
222
|
+
### After Soft Reset:
|
|
223
|
+
```bash
|
|
224
|
+
# Check tables exist but are empty
|
|
225
|
+
python ~/.claude-memory/memory-reset.py status
|
|
226
|
+
|
|
227
|
+
# Should show:
|
|
228
|
+
# Memories: 0 rows
|
|
229
|
+
# Tree Nodes: 0 rows (or 1 root)
|
|
230
|
+
# Graph Nodes: 0 rows
|
|
231
|
+
# etc.
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### After Hard Reset:
|
|
235
|
+
```bash
|
|
236
|
+
# Check fresh V2 schema
|
|
237
|
+
python ~/.claude-memory/memory-reset.py status
|
|
238
|
+
|
|
239
|
+
# Should show:
|
|
240
|
+
# All tables present
|
|
241
|
+
# All tables empty (0 rows)
|
|
242
|
+
# Database size: ~50KB (empty schema)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### After Layer Reset:
|
|
246
|
+
```bash
|
|
247
|
+
# Check specific layer cleared
|
|
248
|
+
python ~/.claude-memory/memory-reset.py status
|
|
249
|
+
|
|
250
|
+
# Example after clearing graph:
|
|
251
|
+
# Graph Nodes: 0 rows
|
|
252
|
+
# Graph Edges: 0 rows
|
|
253
|
+
# Graph Clusters: 0 rows
|
|
254
|
+
# Memories: 20 rows (kept)
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Best Practices
|
|
260
|
+
|
|
261
|
+
1. **Always check status first:**
|
|
262
|
+
```bash
|
|
263
|
+
python ~/.claude-memory/memory-reset.py status
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
2. **Use layer reset when possible:**
|
|
267
|
+
- More surgical than soft/hard reset
|
|
268
|
+
- Preserves unaffected data
|
|
269
|
+
|
|
270
|
+
3. **Test with soft reset first:**
|
|
271
|
+
- Less destructive than hard reset
|
|
272
|
+
- Faster recovery if needed
|
|
273
|
+
|
|
274
|
+
4. **Keep backups:**
|
|
275
|
+
- Don't use `--no-backup` unless testing
|
|
276
|
+
- Check backup directory regularly
|
|
277
|
+
|
|
278
|
+
5. **Document why you reset:**
|
|
279
|
+
- Keep notes on what prompted reset
|
|
280
|
+
- Helps avoid repeating issues
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Troubleshooting
|
|
285
|
+
|
|
286
|
+
### "No database found"
|
|
287
|
+
**After soft/hard reset:**
|
|
288
|
+
- Expected after hard reset
|
|
289
|
+
- Run hard reset again to reinitialize
|
|
290
|
+
|
|
291
|
+
**Before any reset:**
|
|
292
|
+
- Check: `ls -la ~/.claude-memory/memory.db`
|
|
293
|
+
- Database may have been moved/deleted
|
|
294
|
+
|
|
295
|
+
### "Permission denied"
|
|
296
|
+
```bash
|
|
297
|
+
# Make script executable
|
|
298
|
+
chmod +x ~/.claude-memory/memory-reset.py
|
|
299
|
+
|
|
300
|
+
# Or run with python
|
|
301
|
+
python ~/.claude-memory/memory-reset.py status
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### "Backup failed"
|
|
305
|
+
- Check disk space: `df -h`
|
|
306
|
+
- Check permissions: `ls -la ~/.claude-memory/`
|
|
307
|
+
- Manually create backup:
|
|
308
|
+
```bash
|
|
309
|
+
cp ~/.claude-memory/memory.db ~/.claude-memory/backups/manual-backup.db
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### "Hard reset didn't reinitialize"
|
|
313
|
+
- Run again (idempotent)
|
|
314
|
+
- Check for errors in output
|
|
315
|
+
- Manually verify schema:
|
|
316
|
+
```bash
|
|
317
|
+
sqlite3 ~/.claude-memory/memory.db ".tables"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Emergency Recovery
|
|
323
|
+
|
|
324
|
+
### If reset went wrong:
|
|
325
|
+
1. **Stop immediately** - Don't run more commands
|
|
326
|
+
2. **Check backups:**
|
|
327
|
+
```bash
|
|
328
|
+
ls -lt ~/.claude-memory/backups/
|
|
329
|
+
```
|
|
330
|
+
3. **Restore latest backup:**
|
|
331
|
+
```bash
|
|
332
|
+
cp ~/.claude-memory/backups/pre-reset-<timestamp>.db \
|
|
333
|
+
~/.claude-memory/memory.db
|
|
334
|
+
```
|
|
335
|
+
4. **Verify restoration:**
|
|
336
|
+
```bash
|
|
337
|
+
python ~/.claude-memory/memory-reset.py status
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Quick Reference
|
|
343
|
+
|
|
344
|
+
| Command | What It Does | Safety Level |
|
|
345
|
+
|---------|-------------|--------------|
|
|
346
|
+
| `status` | Show statistics | 🟢 Safe (read-only) |
|
|
347
|
+
| `soft` | Clear memories, keep schema | 🟡 Destructive (backed up) |
|
|
348
|
+
| `hard --confirm` | Delete everything, reinit | 🔴 Nuclear (backed up) |
|
|
349
|
+
| `layer --layers X` | Clear specific layers | 🟡 Selective (backed up) |
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
**Remember:** All reset operations create automatic backups. You can always recover.
|