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
package/bin/slm
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# slm - Universal CLI wrapper for SuperLocalMemory V2
|
|
3
|
+
# Simple commands that work in any terminal or script
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
6
|
+
# Licensed under MIT License
|
|
7
|
+
#
|
|
8
|
+
# This is a CONVENIENCE wrapper. Original commands still work:
|
|
9
|
+
# superlocalmemoryv2:remember, superlocalmemoryv2:recall, etc.
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
SLM_DIR="${HOME}/.claude-memory"
|
|
14
|
+
|
|
15
|
+
# Check if SuperLocalMemory is installed
|
|
16
|
+
if [ ! -d "$SLM_DIR" ]; then
|
|
17
|
+
echo "Error: SuperLocalMemory V2 not installed at $SLM_DIR"
|
|
18
|
+
echo "Please run: ./install.sh"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Main command dispatcher
|
|
23
|
+
case "$1" in
|
|
24
|
+
remember|save|store)
|
|
25
|
+
shift
|
|
26
|
+
# Calls existing command - no duplicate logic
|
|
27
|
+
"$SLM_DIR/bin/superlocalmemoryv2:remember" "$@"
|
|
28
|
+
;;
|
|
29
|
+
|
|
30
|
+
recall|search|find)
|
|
31
|
+
shift
|
|
32
|
+
# Calls existing command - no duplicate logic
|
|
33
|
+
"$SLM_DIR/bin/superlocalmemoryv2:recall" "$@"
|
|
34
|
+
;;
|
|
35
|
+
|
|
36
|
+
list|ls)
|
|
37
|
+
shift
|
|
38
|
+
# Calls existing command - no duplicate logic
|
|
39
|
+
"$SLM_DIR/bin/superlocalmemoryv2:list" "$@"
|
|
40
|
+
;;
|
|
41
|
+
|
|
42
|
+
status|info|stats)
|
|
43
|
+
# Calls existing command - no duplicate logic
|
|
44
|
+
"$SLM_DIR/bin/superlocalmemoryv2:status"
|
|
45
|
+
;;
|
|
46
|
+
|
|
47
|
+
profile)
|
|
48
|
+
shift
|
|
49
|
+
# Calls existing command - no duplicate logic
|
|
50
|
+
"$SLM_DIR/bin/superlocalmemoryv2:profile" "$@"
|
|
51
|
+
;;
|
|
52
|
+
|
|
53
|
+
reset)
|
|
54
|
+
shift
|
|
55
|
+
# Calls existing command - no duplicate logic
|
|
56
|
+
"$SLM_DIR/bin/superlocalmemoryv2:reset" "$@"
|
|
57
|
+
;;
|
|
58
|
+
|
|
59
|
+
serve|server)
|
|
60
|
+
PORT="${2:-8001}"
|
|
61
|
+
echo "Starting SuperLocalMemory MCP HTTP server..."
|
|
62
|
+
echo "Endpoint: http://localhost:$PORT"
|
|
63
|
+
echo ""
|
|
64
|
+
echo "For ChatGPT/remote access:"
|
|
65
|
+
echo " 1. In another terminal: ngrok http $PORT"
|
|
66
|
+
echo " 2. Copy the HTTPS URL"
|
|
67
|
+
echo " 3. Add to ChatGPT: Settings -> Apps & Connectors -> Developer Mode"
|
|
68
|
+
echo ""
|
|
69
|
+
exec python3 "$SLM_DIR/mcp_server.py" --transport http --port "$PORT"
|
|
70
|
+
;;
|
|
71
|
+
|
|
72
|
+
context)
|
|
73
|
+
# NEW: Get context for current directory/project
|
|
74
|
+
project=$(basename "$PWD")
|
|
75
|
+
"$SLM_DIR/bin/superlocalmemoryv2:recall" "$project" --limit 5
|
|
76
|
+
;;
|
|
77
|
+
|
|
78
|
+
graph)
|
|
79
|
+
shift
|
|
80
|
+
subcommand="$1"
|
|
81
|
+
shift
|
|
82
|
+
case "$subcommand" in
|
|
83
|
+
build)
|
|
84
|
+
python3 "$SLM_DIR/graph_engine.py" build "$@"
|
|
85
|
+
;;
|
|
86
|
+
stats)
|
|
87
|
+
python3 "$SLM_DIR/graph_engine.py" stats "$@"
|
|
88
|
+
;;
|
|
89
|
+
*)
|
|
90
|
+
echo "Usage: slm graph {build|stats}"
|
|
91
|
+
exit 1
|
|
92
|
+
;;
|
|
93
|
+
esac
|
|
94
|
+
;;
|
|
95
|
+
|
|
96
|
+
patterns)
|
|
97
|
+
shift
|
|
98
|
+
subcommand="$1"
|
|
99
|
+
shift
|
|
100
|
+
case "$subcommand" in
|
|
101
|
+
update)
|
|
102
|
+
python3 "$SLM_DIR/pattern_learner.py" update "$@"
|
|
103
|
+
;;
|
|
104
|
+
list)
|
|
105
|
+
python3 "$SLM_DIR/pattern_learner.py" list "$@"
|
|
106
|
+
;;
|
|
107
|
+
context)
|
|
108
|
+
python3 "$SLM_DIR/pattern_learner.py" context "$@"
|
|
109
|
+
;;
|
|
110
|
+
*)
|
|
111
|
+
echo "Usage: slm patterns {update|list|context}"
|
|
112
|
+
exit 1
|
|
113
|
+
;;
|
|
114
|
+
esac
|
|
115
|
+
;;
|
|
116
|
+
|
|
117
|
+
help|--help|-h)
|
|
118
|
+
cat <<EOF
|
|
119
|
+
SuperLocalMemory V2 - Universal CLI
|
|
120
|
+
|
|
121
|
+
SIMPLE COMMANDS:
|
|
122
|
+
slm remember <content> Save to memory
|
|
123
|
+
slm recall <query> Search memories
|
|
124
|
+
slm list [N] List N recent memories (default 10)
|
|
125
|
+
slm status System status and statistics
|
|
126
|
+
slm context Project context for current directory
|
|
127
|
+
|
|
128
|
+
PROFILE MANAGEMENT:
|
|
129
|
+
slm profile list List all profiles
|
|
130
|
+
slm profile create <name> Create new profile
|
|
131
|
+
slm profile switch <name> Switch to profile
|
|
132
|
+
slm profile delete <name> Delete profile
|
|
133
|
+
slm profile current Show current profile
|
|
134
|
+
|
|
135
|
+
KNOWLEDGE GRAPH:
|
|
136
|
+
slm graph build Build/rebuild knowledge graph
|
|
137
|
+
slm graph stats Show graph statistics
|
|
138
|
+
|
|
139
|
+
PATTERN LEARNING:
|
|
140
|
+
slm patterns update Learn patterns from memories
|
|
141
|
+
slm patterns list [threshold] List learned patterns
|
|
142
|
+
slm patterns context [threshold] Get coding identity context
|
|
143
|
+
|
|
144
|
+
HTTP SERVER:
|
|
145
|
+
slm serve [PORT] Start MCP HTTP server (default port 8001)
|
|
146
|
+
For ChatGPT/remote: ngrok http PORT
|
|
147
|
+
|
|
148
|
+
ADVANCED:
|
|
149
|
+
slm reset soft Soft reset (clear memories)
|
|
150
|
+
slm reset hard --confirm Hard reset (nuclear option)
|
|
151
|
+
|
|
152
|
+
ORIGINAL COMMANDS (still work):
|
|
153
|
+
superlocalmemoryv2:remember <content>
|
|
154
|
+
superlocalmemoryv2:recall <query>
|
|
155
|
+
superlocalmemoryv2:list [N]
|
|
156
|
+
superlocalmemoryv2:status
|
|
157
|
+
superlocalmemoryv2:profile <command>
|
|
158
|
+
superlocalmemoryv2:reset <type>
|
|
159
|
+
|
|
160
|
+
EXAMPLES:
|
|
161
|
+
slm remember "Use FastAPI for REST APIs" --tags python,backend
|
|
162
|
+
slm recall "FastAPI patterns" --limit 5
|
|
163
|
+
slm context
|
|
164
|
+
slm graph build
|
|
165
|
+
slm patterns update
|
|
166
|
+
slm status
|
|
167
|
+
|
|
168
|
+
DOCUMENTATION:
|
|
169
|
+
README: https://github.com/varun369/SuperLocalMemoryV2
|
|
170
|
+
Docs: ~/.claude-memory/docs/
|
|
171
|
+
|
|
172
|
+
VERSION: 2.3.0-universal
|
|
173
|
+
EOF
|
|
174
|
+
;;
|
|
175
|
+
|
|
176
|
+
version|--version|-v)
|
|
177
|
+
echo "SuperLocalMemory V2 - Universal CLI"
|
|
178
|
+
echo "Version: 2.3.0-universal"
|
|
179
|
+
echo "Database: $SLM_DIR/memory.db"
|
|
180
|
+
;;
|
|
181
|
+
|
|
182
|
+
*)
|
|
183
|
+
echo "SuperLocalMemory V2 - Universal CLI"
|
|
184
|
+
echo ""
|
|
185
|
+
echo "Usage: slm <command> [args]"
|
|
186
|
+
echo ""
|
|
187
|
+
echo "Commands:"
|
|
188
|
+
echo " remember - Save to memory"
|
|
189
|
+
echo " recall - Search memories"
|
|
190
|
+
echo " list - List recent memories"
|
|
191
|
+
echo " status - System status"
|
|
192
|
+
echo " context - Project context"
|
|
193
|
+
echo " serve - Start MCP HTTP server"
|
|
194
|
+
echo " profile - Manage profiles"
|
|
195
|
+
echo " graph - Knowledge graph operations"
|
|
196
|
+
echo " patterns - Pattern learning"
|
|
197
|
+
echo " help - Show detailed help"
|
|
198
|
+
echo ""
|
|
199
|
+
echo "Run 'slm help' for more information"
|
|
200
|
+
exit 1
|
|
201
|
+
;;
|
|
202
|
+
esac
|
package/bin/slm-npm
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SuperLocalMemory V2 - NPM Global CLI Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
6
|
+
* Solution Architect & Original Creator
|
|
7
|
+
*
|
|
8
|
+
* Licensed under MIT License (see LICENSE file)
|
|
9
|
+
* Repository: https://github.com/varun369/SuperLocalMemoryV2
|
|
10
|
+
*
|
|
11
|
+
* ATTRIBUTION REQUIRED: This notice must be preserved in all copies.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const { spawnSync } = require('child_process');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const os = require('os');
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
|
|
19
|
+
// Installation directory
|
|
20
|
+
const SLM_DIR = path.join(os.homedir(), '.claude-memory');
|
|
21
|
+
|
|
22
|
+
// Check if SuperLocalMemory is installed
|
|
23
|
+
if (!fs.existsSync(SLM_DIR)) {
|
|
24
|
+
console.error('Error: SuperLocalMemory V2 not installed at ' + SLM_DIR);
|
|
25
|
+
console.error('Installation should have run automatically via postinstall script.');
|
|
26
|
+
console.error('Please run manually:');
|
|
27
|
+
|
|
28
|
+
if (os.platform() === 'win32') {
|
|
29
|
+
console.error(' powershell -ExecutionPolicy Bypass -File "' + path.join(__dirname, '..', 'install.ps1') + '"');
|
|
30
|
+
} else {
|
|
31
|
+
console.error(' bash "' + path.join(__dirname, '..', 'install.sh') + '"');
|
|
32
|
+
}
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Platform-specific slm script path
|
|
37
|
+
let slmScript;
|
|
38
|
+
if (os.platform() === 'win32') {
|
|
39
|
+
slmScript = path.join(SLM_DIR, 'bin', 'slm.cmd');
|
|
40
|
+
if (!fs.existsSync(slmScript)) {
|
|
41
|
+
slmScript = path.join(SLM_DIR, 'bin', 'slm');
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
slmScript = path.join(SLM_DIR, 'bin', 'slm');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Check if slm script exists
|
|
48
|
+
if (!fs.existsSync(slmScript)) {
|
|
49
|
+
console.error('Error: SLM CLI not found at ' + slmScript);
|
|
50
|
+
console.error('Installation may be incomplete. Please run install script manually.');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Pass all arguments to the real slm command
|
|
55
|
+
const args = process.argv.slice(2);
|
|
56
|
+
|
|
57
|
+
// Use spawnSync for secure execution (no shell injection risk)
|
|
58
|
+
let result;
|
|
59
|
+
if (os.platform() === 'win32') {
|
|
60
|
+
// Windows: Use cmd or PowerShell
|
|
61
|
+
result = spawnSync(slmScript, args, {
|
|
62
|
+
stdio: 'inherit',
|
|
63
|
+
shell: true
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
// Mac/Linux: Direct bash execution
|
|
67
|
+
result = spawnSync('bash', [slmScript, ...args], {
|
|
68
|
+
stdio: 'inherit'
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Exit with the same code as the child process
|
|
73
|
+
process.exit(result.status || 0);
|
package/bin/slm.bat
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM SuperLocalMemory V2 - Windows CLI Wrapper
|
|
3
|
+
REM Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
4
|
+
REM Licensed under MIT License
|
|
5
|
+
REM Repository: https://github.com/varun369/SuperLocalMemoryV2
|
|
6
|
+
REM
|
|
7
|
+
REM ATTRIBUTION REQUIRED: This notice must be preserved in all copies.
|
|
8
|
+
|
|
9
|
+
setlocal enabledelayedexpansion
|
|
10
|
+
|
|
11
|
+
REM Determine installation location
|
|
12
|
+
if exist "%USERPROFILE%\.claude-memory\memory_store_v2.py" (
|
|
13
|
+
set INSTALL_DIR=%USERPROFILE%\.claude-memory
|
|
14
|
+
) else if exist "%~dp0..\src\memory_store_v2.py" (
|
|
15
|
+
set INSTALL_DIR=%~dp0..\src
|
|
16
|
+
) else (
|
|
17
|
+
echo ERROR: SuperLocalMemory installation not found.
|
|
18
|
+
echo.
|
|
19
|
+
echo Expected locations:
|
|
20
|
+
echo - %USERPROFILE%\.claude-memory\memory_store_v2.py
|
|
21
|
+
echo - %~dp0..\src\memory_store_v2.py
|
|
22
|
+
echo.
|
|
23
|
+
echo Run install.ps1 to install SuperLocalMemory V2.
|
|
24
|
+
exit /b 1
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
REM Check Python availability
|
|
28
|
+
where python >nul 2>&1
|
|
29
|
+
if %ERRORLEVEL% EQU 0 (
|
|
30
|
+
set PYTHON_CMD=python
|
|
31
|
+
goto :python_found
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
where python3 >nul 2>&1
|
|
35
|
+
if %ERRORLEVEL% EQU 0 (
|
|
36
|
+
set PYTHON_CMD=python3
|
|
37
|
+
goto :python_found
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
echo ERROR: Python not found in PATH.
|
|
41
|
+
echo.
|
|
42
|
+
echo Please install Python 3.8 or higher from:
|
|
43
|
+
echo https://www.python.org/downloads/
|
|
44
|
+
echo.
|
|
45
|
+
echo Make sure to check "Add Python to PATH" during installation.
|
|
46
|
+
exit /b 1
|
|
47
|
+
|
|
48
|
+
:python_found
|
|
49
|
+
|
|
50
|
+
REM Parse command
|
|
51
|
+
if "%1"=="" (
|
|
52
|
+
echo SuperLocalMemory V2.1.0 - Universal AI Memory System
|
|
53
|
+
echo.
|
|
54
|
+
echo Usage: slm [command] [options]
|
|
55
|
+
echo.
|
|
56
|
+
echo Commands:
|
|
57
|
+
echo remember [content] Store a new memory
|
|
58
|
+
echo recall [query] Search memories
|
|
59
|
+
echo list-recent [N] List recent memories
|
|
60
|
+
echo status Show system status
|
|
61
|
+
echo build-graph Rebuild knowledge graph
|
|
62
|
+
echo switch-profile [name] Switch memory profile
|
|
63
|
+
echo help Show this help
|
|
64
|
+
echo.
|
|
65
|
+
echo Examples:
|
|
66
|
+
echo slm remember "React hooks for state management" --tags frontend,react
|
|
67
|
+
echo slm recall "authentication patterns"
|
|
68
|
+
echo slm list-recent 20
|
|
69
|
+
echo slm status
|
|
70
|
+
echo.
|
|
71
|
+
echo Documentation: https://github.com/varun369/SuperLocalMemoryV2/wiki
|
|
72
|
+
exit /b 0
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
REM Handle special commands
|
|
76
|
+
if /i "%1"=="help" goto :show_help
|
|
77
|
+
if /i "%1"=="--help" goto :show_help
|
|
78
|
+
if /i "%1"=="-h" goto :show_help
|
|
79
|
+
if /i "%1"=="version" goto :show_version
|
|
80
|
+
if /i "%1"=="--version" goto :show_version
|
|
81
|
+
if /i "%1"=="-v" goto :show_version
|
|
82
|
+
|
|
83
|
+
REM Route commands to appropriate Python module
|
|
84
|
+
if /i "%1"=="remember" goto :remember
|
|
85
|
+
if /i "%1"=="recall" goto :recall
|
|
86
|
+
if /i "%1"=="list-recent" goto :list_recent
|
|
87
|
+
if /i "%1"=="list" goto :list_recent
|
|
88
|
+
if /i "%1"=="status" goto :status
|
|
89
|
+
if /i "%1"=="stats" goto :status
|
|
90
|
+
if /i "%1"=="build-graph" goto :build_graph
|
|
91
|
+
if /i "%1"=="switch-profile" goto :switch_profile
|
|
92
|
+
if /i "%1"=="profile" goto :switch_profile
|
|
93
|
+
|
|
94
|
+
echo ERROR: Unknown command: %1
|
|
95
|
+
echo.
|
|
96
|
+
echo Run "slm help" for usage information.
|
|
97
|
+
exit /b 1
|
|
98
|
+
|
|
99
|
+
:remember
|
|
100
|
+
shift
|
|
101
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory_store_v2.py" add %*
|
|
102
|
+
exit /b %ERRORLEVEL%
|
|
103
|
+
|
|
104
|
+
:recall
|
|
105
|
+
shift
|
|
106
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory_store_v2.py" search %*
|
|
107
|
+
exit /b %ERRORLEVEL%
|
|
108
|
+
|
|
109
|
+
:list_recent
|
|
110
|
+
shift
|
|
111
|
+
if "%1"=="" (
|
|
112
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory_store_v2.py" list 20
|
|
113
|
+
) else (
|
|
114
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory_store_v2.py" list %*
|
|
115
|
+
)
|
|
116
|
+
exit /b %ERRORLEVEL%
|
|
117
|
+
|
|
118
|
+
:status
|
|
119
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory_store_v2.py" stats
|
|
120
|
+
exit /b %ERRORLEVEL%
|
|
121
|
+
|
|
122
|
+
:build_graph
|
|
123
|
+
if exist "%INSTALL_DIR%\graph_engine.py" (
|
|
124
|
+
%PYTHON_CMD% "%INSTALL_DIR%\graph_engine.py" build
|
|
125
|
+
) else (
|
|
126
|
+
echo ERROR: graph_engine.py not found.
|
|
127
|
+
exit /b 1
|
|
128
|
+
)
|
|
129
|
+
exit /b %ERRORLEVEL%
|
|
130
|
+
|
|
131
|
+
:switch_profile
|
|
132
|
+
shift
|
|
133
|
+
if exist "%INSTALL_DIR%\memory-profiles.py" (
|
|
134
|
+
if "%1"=="" (
|
|
135
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory-profiles.py" list
|
|
136
|
+
) else if "%1"=="--list" (
|
|
137
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory-profiles.py" list
|
|
138
|
+
) else (
|
|
139
|
+
%PYTHON_CMD% "%INSTALL_DIR%\memory-profiles.py" switch %*
|
|
140
|
+
)
|
|
141
|
+
) else (
|
|
142
|
+
echo ERROR: memory-profiles.py not found.
|
|
143
|
+
exit /b 1
|
|
144
|
+
)
|
|
145
|
+
exit /b %ERRORLEVEL%
|
|
146
|
+
|
|
147
|
+
:show_help
|
|
148
|
+
echo SuperLocalMemory V2.1.0 - Universal AI Memory System
|
|
149
|
+
echo.
|
|
150
|
+
echo Usage: slm [command] [options]
|
|
151
|
+
echo.
|
|
152
|
+
echo Commands:
|
|
153
|
+
echo remember [content] Store a new memory
|
|
154
|
+
echo Options:
|
|
155
|
+
echo --tags TAG1,TAG2 Add tags
|
|
156
|
+
echo --project NAME Set project
|
|
157
|
+
echo --importance N Set importance (1-10)
|
|
158
|
+
echo.
|
|
159
|
+
echo recall [query] Search memories
|
|
160
|
+
echo Options:
|
|
161
|
+
echo --limit N Limit results (default: 10)
|
|
162
|
+
echo --tags TAG1,TAG2 Filter by tags
|
|
163
|
+
echo --project NAME Filter by project
|
|
164
|
+
echo.
|
|
165
|
+
echo list-recent [N] List N most recent memories
|
|
166
|
+
echo status Show system statistics
|
|
167
|
+
echo build-graph Rebuild knowledge graph
|
|
168
|
+
echo switch-profile [name] Switch memory profile
|
|
169
|
+
echo Options:
|
|
170
|
+
echo --list List all profiles
|
|
171
|
+
echo.
|
|
172
|
+
echo help Show this help
|
|
173
|
+
echo version Show version
|
|
174
|
+
echo.
|
|
175
|
+
echo Examples:
|
|
176
|
+
echo slm remember "React hooks for state management" --tags frontend,react
|
|
177
|
+
echo slm recall "authentication patterns" --limit 5
|
|
178
|
+
echo slm list-recent 20
|
|
179
|
+
echo slm status
|
|
180
|
+
echo slm build-graph
|
|
181
|
+
echo slm switch-profile work
|
|
182
|
+
echo.
|
|
183
|
+
echo Installation: %INSTALL_DIR%
|
|
184
|
+
echo Database: %USERPROFILE%\.claude-memory\memory.db
|
|
185
|
+
echo.
|
|
186
|
+
echo Documentation: https://github.com/varun369/SuperLocalMemoryV2/wiki
|
|
187
|
+
echo Report issues: https://github.com/varun369/SuperLocalMemoryV2/issues
|
|
188
|
+
exit /b 0
|
|
189
|
+
|
|
190
|
+
:show_version
|
|
191
|
+
echo SuperLocalMemory V2.1.0-universal
|
|
192
|
+
echo Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
193
|
+
echo Licensed under MIT License
|
|
194
|
+
echo Repository: https://github.com/varun369/SuperLocalMemoryV2
|
|
195
|
+
exit /b 0
|
package/bin/slm.cmd
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM SuperLocalMemory V2 - Windows CLI Wrapper (CMD variant)
|
|
3
|
+
REM Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
4
|
+
REM Licensed under MIT License
|
|
5
|
+
REM
|
|
6
|
+
REM This is a simplified wrapper that calls slm.bat
|
|
7
|
+
REM Exists for compatibility with systems that prefer .cmd over .bat
|
|
8
|
+
|
|
9
|
+
call "%~dp0slm.bat" %*
|
|
10
|
+
exit /b %ERRORLEVEL%
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Bash completion for slm command
|
|
2
|
+
# Source this file or copy to /usr/local/etc/bash_completion.d/
|
|
3
|
+
|
|
4
|
+
_slm_completions() {
|
|
5
|
+
local cur prev opts
|
|
6
|
+
COMPREPLY=()
|
|
7
|
+
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
8
|
+
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
9
|
+
|
|
10
|
+
# Main commands
|
|
11
|
+
local main_commands="remember recall list status context profile graph patterns reset help version"
|
|
12
|
+
|
|
13
|
+
# Profile subcommands
|
|
14
|
+
local profile_commands="list create switch delete current"
|
|
15
|
+
|
|
16
|
+
# Graph subcommands
|
|
17
|
+
local graph_commands="build stats"
|
|
18
|
+
|
|
19
|
+
# Pattern subcommands
|
|
20
|
+
local pattern_commands="update list context"
|
|
21
|
+
|
|
22
|
+
# Reset subcommands
|
|
23
|
+
local reset_commands="soft hard layer"
|
|
24
|
+
|
|
25
|
+
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
|
26
|
+
COMPREPLY=( $(compgen -W "${main_commands}" -- ${cur}) )
|
|
27
|
+
return 0
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
case "${COMP_WORDS[1]}" in
|
|
31
|
+
profile)
|
|
32
|
+
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
|
33
|
+
COMPREPLY=( $(compgen -W "${profile_commands}" -- ${cur}) )
|
|
34
|
+
fi
|
|
35
|
+
return 0
|
|
36
|
+
;;
|
|
37
|
+
graph)
|
|
38
|
+
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
|
39
|
+
COMPREPLY=( $(compgen -W "${graph_commands}" -- ${cur}) )
|
|
40
|
+
fi
|
|
41
|
+
return 0
|
|
42
|
+
;;
|
|
43
|
+
patterns)
|
|
44
|
+
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
|
45
|
+
COMPREPLY=( $(compgen -W "${pattern_commands}" -- ${cur}) )
|
|
46
|
+
fi
|
|
47
|
+
return 0
|
|
48
|
+
;;
|
|
49
|
+
reset)
|
|
50
|
+
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
|
51
|
+
COMPREPLY=( $(compgen -W "${reset_commands}" -- ${cur}) )
|
|
52
|
+
fi
|
|
53
|
+
return 0
|
|
54
|
+
;;
|
|
55
|
+
esac
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
complete -F _slm_completions slm
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#compdef slm
|
|
2
|
+
# Zsh completion for slm command
|
|
3
|
+
# Copy to a directory in $fpath or source directly
|
|
4
|
+
|
|
5
|
+
_slm() {
|
|
6
|
+
local -a main_commands profile_commands graph_commands pattern_commands reset_commands
|
|
7
|
+
|
|
8
|
+
main_commands=(
|
|
9
|
+
'remember:Save content to memory'
|
|
10
|
+
'recall:Search memories'
|
|
11
|
+
'list:List recent memories'
|
|
12
|
+
'status:System status'
|
|
13
|
+
'context:Project context'
|
|
14
|
+
'profile:Manage profiles'
|
|
15
|
+
'graph:Knowledge graph operations'
|
|
16
|
+
'patterns:Pattern learning'
|
|
17
|
+
'reset:Reset operations'
|
|
18
|
+
'help:Show help'
|
|
19
|
+
'version:Show version'
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
profile_commands=(
|
|
23
|
+
'list:List all profiles'
|
|
24
|
+
'create:Create new profile'
|
|
25
|
+
'switch:Switch to profile'
|
|
26
|
+
'delete:Delete profile'
|
|
27
|
+
'current:Show current profile'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
graph_commands=(
|
|
31
|
+
'build:Build/rebuild knowledge graph'
|
|
32
|
+
'stats:Show graph statistics'
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
pattern_commands=(
|
|
36
|
+
'update:Learn patterns from memories'
|
|
37
|
+
'list:List learned patterns'
|
|
38
|
+
'context:Get coding identity context'
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
reset_commands=(
|
|
42
|
+
'soft:Soft reset (clear memories)'
|
|
43
|
+
'hard:Hard reset (nuclear option)'
|
|
44
|
+
'layer:Layer-specific reset'
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
if (( CURRENT == 2 )); then
|
|
48
|
+
_describe 'slm commands' main_commands
|
|
49
|
+
return
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
case "$words[2]" in
|
|
53
|
+
profile)
|
|
54
|
+
if (( CURRENT == 3 )); then
|
|
55
|
+
_describe 'profile commands' profile_commands
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
graph)
|
|
59
|
+
if (( CURRENT == 3 )); then
|
|
60
|
+
_describe 'graph commands' graph_commands
|
|
61
|
+
fi
|
|
62
|
+
;;
|
|
63
|
+
patterns)
|
|
64
|
+
if (( CURRENT == 3 )); then
|
|
65
|
+
_describe 'pattern commands' pattern_commands
|
|
66
|
+
fi
|
|
67
|
+
;;
|
|
68
|
+
reset)
|
|
69
|
+
if (( CURRENT == 3 )); then
|
|
70
|
+
_describe 'reset commands' reset_commands
|
|
71
|
+
fi
|
|
72
|
+
;;
|
|
73
|
+
esac
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_slm "$@"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"superlocalmemory-v2": {
|
|
4
|
+
"command": "python3",
|
|
5
|
+
"args": ["{{INSTALL_DIR}}/mcp_server.py"],
|
|
6
|
+
"env": {
|
|
7
|
+
"PYTHONPATH": "{{INSTALL_DIR}}"
|
|
8
|
+
},
|
|
9
|
+
"cwd": "{{INSTALL_DIR}}",
|
|
10
|
+
"description": "SuperLocalMemory V2 - 100% local memory system"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_README": "ChatGPT requires HTTP transport, not stdio. See docs/MCP-MANUAL-SETUP.md#chatgpt-desktop-app",
|
|
3
|
+
"_step1": "Run: slm serve --port 8001",
|
|
4
|
+
"_step2": "Expose via: ngrok http 8001 (or cloudflared tunnel)",
|
|
5
|
+
"_step3": "Add the HTTPS URL to ChatGPT -> Settings -> Apps & Connectors -> Developer Mode",
|
|
6
|
+
"_note": "100% local - your MCP server runs on YOUR machine. The tunnel just makes it reachable."
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"superlocalmemory-v2": {
|
|
4
|
+
"command": "python3",
|
|
5
|
+
"args": [
|
|
6
|
+
"{{INSTALL_DIR}}/mcp_server.py"
|
|
7
|
+
],
|
|
8
|
+
"cwd": "{{INSTALL_DIR}}",
|
|
9
|
+
"env": {
|
|
10
|
+
"PYTHONPATH": "{{INSTALL_DIR}}"
|
|
11
|
+
},
|
|
12
|
+
"description": "SuperLocalMemory V2 - 100% local memory system for AI assistants"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|