-
-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration
Configuration options, environment variables, and performance tuning for SuperLocalMemory - Customize behavior, optimize performance, and adjust settings for your workflow.
SuperLocalMemory uses multiple configuration files:
Location: ~/.claude-memory/config.json
Purpose: System-wide settings affecting all profiles
Default:
{
"version": "2.1.0",
"default_profile": "default",
"mcp_server_enabled": true,
"shell_integration": true,
"auto_build_graph": false,
"pattern_learning_enabled": true,
"telemetry": false
}Location: ~/.claude-memory/profiles/<profile>/config.json
Purpose: Profile-specific settings
Default:
{
"profile_name": "default",
"description": "Default profile",
"created_at": "2026-02-07T14:23:00",
"settings": {
"default_importance": 5,
"auto_build_graph": false,
"pattern_learning_threshold": 0.5,
"search_min_score": 0.3,
"compression_enabled": false
}
}Location: IDE-specific (see Quick Start Tutorial)
- Cursor:
~/.cursor/mcp_settings.json - Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json - Windsurf:
~/.windsurf/mcp_settings.json
Format:
{
"mcpServers": {
"superlocalmemory-v2": {
"command": "python3",
"args": ["/Users/username/.claude-memory/mcp_server.py"],
"cwd": "/Users/username/.claude-memory",
"env": {
"PYTHONPATH": "/Users/username/.claude-memory"
},
"description": "SuperLocalMemory"
}
}
}Description: Override default profile
Usage:
export SLM_PROFILE=work
slm status # Uses work profile
# Temporary override
SLM_PROFILE=personal slm recall "query"Description: Custom database location
Usage:
export SLM_DB_PATH=/custom/path/memory.db
slm remember "test" # Saves to custom locationDescription: Custom config file location
Usage:
export SLM_CONFIG_PATH=/custom/config.jsonDescription: Python module search path (required for MCP server)
Usage:
export PYTHONPATH=$HOME/.claude-memory:$PYTHONPATHDescription: In-memory cache size (MB)
Default: 50
Usage:
export SLM_CACHE_SIZE=100 # 100MB cacheDescription: Parallel processing threads
Default: 4
Usage:
export SLM_MAX_WORKERS=8 # 8 threads for graph buildingDescription: Memories per graph build chunk
Default: 1000
Usage:
export SLM_GRAPH_CHUNK_SIZE=500 # Smaller chunks = less memory usageDescription: Enable debug logging
Usage:
export SLM_DEBUG=1
slm recall "query" # Shows debug outputDescription: Logging level
Values: DEBUG, INFO, WARNING, ERROR
Usage:
export SLM_LOG_LEVEL=DEBUGDescription: Log file location
Usage:
export SLM_LOG_FILE=/tmp/slm-debug.logDescription: Default importance for new memories
Type: Integer (1-10)
Default: 5
Usage:
{
"settings": {
"default_importance": 7
}
}Description: Maximum memory content size (bytes)
Type: Integer
Default: 1048576 (1MB)
Usage:
{
"settings": {
"max_content_size": 2097152
}
}Description: Maximum tags per memory
Type: Integer
Default: 50
Usage:
{
"settings": {
"max_tags": 20
}
}Description: Minimum relevance score for search results
Type: Float (0.0-1.0)
Default: 0.3
Usage:
{
"settings": {
"search_min_score": 0.5
}
}Description: Default number of search results
Type: Integer
Default: 10
Usage:
{
"settings": {
"search_default_limit": 20
}
}Description: Enabled search methods
Type: List of strings
Default: ["semantic", "fts", "graph"]
Usage:
{
"settings": {
"search_methods": ["semantic", "fts"]
}
}Description: Automatically rebuild graph after N new memories
Type: Integer (0 = disabled)
Default: 0
Usage:
{
"settings": {
"auto_build_graph": 50
}
}Description: Minimum similarity for graph edges
Type: Float (0.0-1.0)
Default: 0.3
Usage:
{
"settings": {
"graph_min_similarity": 0.4
}
}Description: Maximum edges per graph node
Type: Integer
Default: 50
Usage:
{
"settings": {
"graph_max_edges_per_node": 30
}
}Description: Enable Leiden clustering by default
Type: Boolean
Default: false
Usage:
{
"settings": {
"clustering_enabled": true
}
}Description: Leiden algorithm resolution parameter
Type: Float
Default: 1.0
Usage:
{
"settings": {
"clustering_resolution": 1.5
}
}Description: Enable pattern learning
Type: Boolean
Default: true
Usage:
{
"settings": {
"pattern_learning_enabled": true
}
}Description: Minimum confidence threshold for patterns
Type: Float (0.0-1.0)
Default: 0.5
Usage:
{
"settings": {
"pattern_learning_threshold": 0.6
}
}Description: Minimum frequency to consider a pattern
Type: Integer
Default: 3
Usage:
{
"settings": {
"pattern_min_frequency": 5
}
}Description: Enable progressive compression (planned v2.2.0)
Type: Boolean
Default: false
Usage:
{
"settings": {
"compression_enabled": true
}
}Description: Days before compression eligible
Type: Integer
Default: 90
Usage:
{
"settings": {
"compression_age_threshold_days": 180
}
}For fast search (<100ms):
{
"settings": {
"search_min_score": 0.5,
"search_methods": ["fts", "semantic"],
"graph_max_edges_per_node": 20
}
}Environment:
export SLM_CACHE_SIZE=100
export SLM_MAX_WORKERS=8For low memory systems (<4GB RAM):
{
"settings": {
"graph_max_edges_per_node": 10,
"clustering_enabled": false
}
}Environment:
export SLM_CACHE_SIZE=10
export SLM_MAX_WORKERS=2
export SLM_GRAPH_CHUNK_SIZE=500For best search quality:
{
"settings": {
"search_min_score": 0.3,
"search_methods": ["semantic", "fts", "graph"],
"graph_min_similarity": 0.2,
"clustering_enabled": true,
"pattern_learning_threshold": 0.4
}
}Build graph regularly:
# Cron job: daily at 3 AM
0 3 * * * slm build-graph --clustering{
"settings": {
"auto_build_graph": 0,
"graph_min_similarity": 0.4,
"graph_max_edges_per_node": 30,
"search_default_limit": 20
}
}Environment:
export SLM_CACHE_SIZE=200
export SLM_MAX_WORKERS=8
export SLM_GRAPH_CHUNK_SIZE=2000Pragmas (applied automatically):
PRAGMA journal_mode = WAL; -- Write-Ahead Logging
PRAGMA synchronous = NORMAL; -- Balance safety/speed
PRAGMA cache_size = -64000; -- 64MB cache
PRAGMA temp_store = MEMORY; -- In-memory temp tables
PRAGMA mmap_size = 268435456; -- 256MB memory-mapped I/OReclaim space after deletions:
sqlite3 ~/.claude-memory/memory.db "VACUUM;"Analyze statistics:
sqlite3 ~/.claude-memory/memory.db "ANALYZE;"sqlite3 ~/.claude-memory/memory.db "REINDEX;"Config: ~/.cursor/mcp_settings.json
Recommendations:
{
"mcpServers": {
"superlocalmemory-v2": {
"command": "/opt/homebrew/bin/python3",
"args": ["/Users/username/.claude-memory/mcp_server.py"],
"cwd": "/Users/username/.claude-memory",
"env": {
"PYTHONPATH": "/Users/username/.claude-memory",
"SLM_LOG_LEVEL": "ERROR"
}
}
}
}Config: ~/Library/Application Support/Claude/claude_desktop_config.json
Recommendations:
{
"mcpServers": {
"superlocalmemory-v2": {
"command": "python3",
"args": ["/Users/username/.claude-memory/mcp_server.py"],
"cwd": "/Users/username/.claude-memory",
"env": {
"PYTHONPATH": "/Users/username/.claude-memory"
}
}
}
}Config: Command Palette → "MCP: Open User Configuration"
Recommendations:
{
"servers": {
"superlocalmemory-v2": {
"type": "stdio",
"command": "python3",
"args": ["/Users/username/.claude-memory/mcp_server.py"]
}
}
}Add to ~/.bashrc:
# SuperLocalMemory
export PATH="$HOME/.claude-memory/bin:$PATH"
export PYTHONPATH="$HOME/.claude-memory:$PYTHONPATH"
# Default profile
export SLM_PROFILE=default
# Performance tuning
export SLM_CACHE_SIZE=100
# Auto-complete
source ~/.claude-memory/completions/slm.bash
# Profile prompt
slm_prompt() {
echo "SLM: $(slm status | grep 'Current Profile' | cut -d: -f2)"
}
export PS1="\$(slm_prompt) $PS1"Add to ~/.zshrc:
# SuperLocalMemory
export PATH="$HOME/.claude-memory/bin:$PATH"
export PYTHONPATH="$HOME/.claude-memory:$PYTHONPATH"
# Auto-complete
source ~/.claude-memory/completions/slm.zsh
# Profile switching by directory
autoload -Uz add-zsh-hook
profile_switch() {
case $PWD in
*/work/*) export SLM_PROFILE=work ;;
*/personal/*) export SLM_PROFILE=personal ;;
*) export SLM_PROFILE=default ;;
esac
}
add-zsh-hook chpwd profile_switchDaily backup script:
#!/bin/bash
# Save as: ~/bin/slm-backup.sh
BACKUP_DIR=~/backups/slm-$(date +%Y%m%d)
mkdir -p "$BACKUP_DIR"
# Backup all profiles
cp -r ~/.claude-memory/profiles/ "$BACKUP_DIR/"
# Backup config
cp ~/.claude-memory/config.json "$BACKUP_DIR/"
# Compress
tar czf "$BACKUP_DIR.tar.gz" -C ~/backups "$(basename $BACKUP_DIR)"
rm -rf "$BACKUP_DIR"
# Keep last 7 days
find ~/backups/ -name "slm-*.tar.gz" -mtime +7 -deleteCron job:
# Daily at 2 AM
0 2 * * * ~/bin/slm-backup.sh# Extract backup
tar xzf ~/backups/slm-20260207.tar.gz -C ~/backups/
# Restore profiles
cp -r ~/backups/slm-20260207/profiles/* ~/.claude-memory/profiles/
# Restore config
cp ~/backups/slm-20260207/config.json ~/.claude-memory/
# Rebuild graphs
slm build-graph --forceRecommended permissions:
# Directory
chmod 700 ~/.claude-memory/
# Databases
chmod 600 ~/.claude-memory/profiles/*/memory.db
# Scripts
chmod 700 ~/.claude-memory/*.py
# Config
chmod 600 ~/.claude-memory/config.jsonMCP server binds to localhost only:
# In mcp_server.py
server = Server(host="127.0.0.1", port=0) # Localhost onlyNo external connections:
- Zero API calls
- No telemetry
- No cloud sync
Solution:
# Recreate default config
cd ~/path/to/SuperLocalMemoryV2
./install.shSolution:
# Validate JSON
python3 -m json.tool ~/.claude-memory/config.json
# Fix syntax errors or restore from backup
cp ~/.claude-memory/config.json.backup ~/.claude-memory/config.jsonSolution:
# Verify variable is set
echo $SLM_PROFILE
# Restart shell
exec $SHELL
# Or source config
source ~/.bashrc # or ~/.zshrc- Quick Start Tutorial - First-time setup
- CLI Cheatsheet - Command reference
- Multi-Profile Workflows - Profile management
- Python API - Programmatic access
- Why Local Matters - Privacy benefits
Created by Varun Pratap Bhardwaj Solution Architect • SuperLocalMemory
SuperLocalMemory V3 — Your AI Finally Remembers You. 100% local. 100% private. 100% free.
Part of Qualixar | Created by Varun Pratap Bhardwaj | GitHub
SuperLocalMemory V3
Getting Started
Reference
Architecture
Enterprise
V2 Documentation