slm-switch-profile
Switch between memory profiles for context isolation and management. Use when the user wants to change profile context, separate work/personal memories, or manage multiple independent memory spaces. Each profile has its own database, graph, and patterns.
Best use case
slm-switch-profile is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Switch between memory profiles for context isolation and management. Use when the user wants to change profile context, separate work/personal memories, or manage multiple independent memory spaces. Each profile has its own database, graph, and patterns.
Teams using slm-switch-profile should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/slm-switch-profile/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How slm-switch-profile Compares
| Feature / Agent | slm-switch-profile | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Switch between memory profiles for context isolation and management. Use when the user wants to change profile context, separate work/personal memories, or manage multiple independent memory spaces. Each profile has its own database, graph, and patterns.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# SuperLocalMemory: Switch Profile
Switch between memory profiles to maintain separate contexts for different projects or use cases.
## Usage
```bash
slm switch-profile <name> [--create]
```
## What are Profiles?
**Profiles = Isolated Memory Spaces**
Each profile has its own:
- ✅ **Separate database** - Zero context bleeding
- ✅ **Independent knowledge graph** - Profile-specific relationships
- ✅ **Unique patterns** - Different coding preferences per profile
- ✅ **Isolated history** - No cross-contamination
**Think of profiles as workspaces:**
- `default` - General use
- `work` - Work projects
- `personal` - Personal projects
- `client-acme` - Specific client work
- `experiment` - Testing/learning
## Examples
### Example 1: Switch to Existing Profile
```bash
$ slm switch-profile work
```
**Output:**
```
🔄 Switching profile: default → work
Profile Information:
Name: work
Created: 2026-01-20
Memories: 342
Last Used: 2026-02-05 09:15
✅ Switched to profile "work"
Restart your AI tools (Cursor, ChatGPT, etc.) to use the new profile.
```
### Example 2: Create New Profile
```bash
$ slm switch-profile client-acme --create
```
**Output:**
```
🆕 Creating new profile: client-acme
Profile created successfully!
Location: ~/.superlocalmemory/profiles/client-acme/
Database: memory.db (empty)
Status: Active
✅ Switched to profile "client-acme"
Next steps:
• Start saving memories: slm remember "..."
• AI tools will use this profile automatically
```
### Example 3: List All Profiles
```bash
$ slm list-profiles
```
**Output:**
```
📁 Available Profiles (4 total)
→ work (active)
Created: 2026-01-20
Memories: 342
Size: 1.8 MB
Last used: 2 minutes ago
default
Created: 2026-01-15
Memories: 1,247
Size: 4.2 MB
Last used: 3 hours ago
personal
Created: 2026-01-22
Memories: 89
Size: 0.4 MB
Last used: Yesterday
client-acme
Created: 2026-02-07
Memories: 0
Size: 0 KB
Last used: Never
```
### Example 4: Return to Default
```bash
$ slm switch-profile default
```
**Always works** (default profile always exists)
## Arguments
| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `<name>` | string | Yes | Profile name (lowercase, hyphens allowed) |
| `--create` | flag | No | Create profile if doesn't exist |
| `--force` | flag | No | Switch even if current profile has unsaved work |
## Profile Naming Rules
**Valid:**
- Lowercase letters: `a-z`
- Numbers: `0-9`
- Hyphens: `-`
- Length: 1-64 characters
**Examples:**
- ✅ `work`
- ✅ `client-acme`
- ✅ `project-2024`
- ✅ `personal`
**Invalid:**
- ❌ `Work` (uppercase)
- ❌ `client_acme` (underscore)
- ❌ `client acme` (space)
- ❌ `client.acme` (period)
## Use Cases
### 1. Work/Personal Separation
```bash
# Morning: Start work
slm switch-profile work
slm remember "Sprint planning: focus on auth system"
# Evening: Personal projects
slm switch-profile personal
slm remember "Learning Rust - ownership is tricky"
```
**Benefit:** No mixing of work and personal context
### 2. Multi-Client Consulting
```bash
# Client A project
slm switch-profile client-a
slm remember "Client A uses AWS, prefers TypeScript"
# Client B project
slm switch-profile client-b
slm remember "Client B uses Azure, prefers C#"
```
**Benefit:** Client-specific preferences and patterns
### 3. Experimentation
```bash
# Create throwaway profile for learning
slm switch-profile experiment --create
slm remember "Testing new framework..."
# Later: delete when done
slm delete-profile experiment
```
**Benefit:** Safe experimentation without polluting main memory
### 4. Project Isolation
```bash
# Different tech stacks
slm switch-profile backend-api # Python/FastAPI
slm switch-profile frontend-app # React/TypeScript
slm switch-profile ml-pipeline # Python/PyTorch
```
**Benefit:** Pattern learning adapts to each stack
### 5. Team Shared Profiles (Advanced)
```bash
# Sync profile to team folder
slm export-profile work > team-shared/work-profile.db
# Team members import
slm import-profile team-shared/work-profile.db --name work
```
**Benefit:** Shared knowledge base for team
## How Switching Works
### Behind the Scenes
**1. Profile Structure:**
```
~/.superlocalmemory/
├── memory.db ← Current active profile (symlink)
├── profiles/
│ ├── default/
│ │ └── memory.db ← Default profile database
│ ├── work/
│ │ └── memory.db ← Work profile database
│ └── personal/
│ └── memory.db ← Personal profile database
└── current_profile ← Text file with active profile name
```
**2. Switching Process:**
```bash
$ slm switch-profile work
```
- **Step 1:** Verify "work" profile exists
- **Step 2:** Update symlink: `memory.db` → `profiles/work/memory.db`
- **Step 3:** Write "work" to `current_profile` file
- **Step 4:** Notify user to restart AI tools
**3. AI Tools Read:**
- MCP server reads `~/.superlocalmemory/memory.db`
- Symlink automatically points to active profile
- Transparent to AI tools
## Important Notes
### Restart Required
**After switching, restart your AI tools:**
- **Cursor:** Cmd+Q, reopen
- **Claude Desktop:** Quit, reopen
- **ChatGPT:** Close, reopen
- **VS Code:** Reload window
**Why:** Tools cache database connection at startup
### Profile Isolation is Complete
**Each profile has:**
- ❌ **NO access** to other profiles' memories
- ❌ **NO shared** knowledge graph
- ❌ **NO cross-profile** pattern learning
**This is by design** for true isolation.
### Default Profile Special
- Always exists
- Cannot be deleted
- Safe fallback
## Advanced Usage
### Profile Management
**Create multiple profiles:**
```bash
slm switch-profile work --create
slm switch-profile personal --create
slm switch-profile client-a --create
```
**Backup profile:**
```bash
cp -r ~/.superlocalmemory/profiles/work ~/.superlocalmemory/backups/work-2026-02-07
```
**Delete profile:**
```bash
slm delete-profile experiment
# Warning: This permanently deletes all memories!
```
**Rename profile:**
```bash
slm rename-profile old-name new-name
```
### Scripting & Automation
**Auto-switch by project directory:**
```bash
# Add to .bashrc or .zshrc
function cd() {
builtin cd "$@"
# Check for .slm-profile file
if [ -f ".slm-profile" ]; then
profile=$(cat .slm-profile)
slm switch-profile "$profile" --quiet
fi
}
```
**Usage:**
```bash
# In project directory
echo "myapp" > .slm-profile
# CD into directory
cd ~/projects/myapp
# Automatically switches to "myapp" profile
```
**Daily profile switching:**
```bash
#!/bin/bash
# cron: 0 9 * * 1-5 (Mon-Fri at 9 AM)
slm switch-profile work
echo "Switched to work profile" | notify-send "SuperLocalMemory"
```
### Profile Statistics
**Compare profiles:**
```bash
slm list-profiles --stats
```
**Output:**
```
Profile Memories Size Nodes Edges Patterns
default 1,247 4.2 MB 892 2,134 34
work 342 1.8 MB 256 789 12
personal 89 0.4 MB 67 145 4
```
**Export profile summary:**
```bash
slm profile-summary work > work-summary.txt
```
## Troubleshooting
### "Profile not found"
**Cause:** Typo or profile doesn't exist
**Solution:**
```bash
# List existing profiles
slm list-profiles
# Create if needed
slm switch-profile myprofile --create
```
### "Switch failed: Database locked"
**Cause:** AI tool still using old profile
**Solution:**
```bash
# Kill all MCP servers
killall python3
# Try again
slm switch-profile work
# Restart AI tools
```
### "Memories disappeared after switching"
**Cause:** Switched to empty/different profile (working as intended)
**Solution:**
```bash
# Check current profile
slm status | grep "Current Profile"
# Switch back to profile with memories
slm switch-profile default
# Or list all profiles to find the right one
slm list-profiles
```
### "AI tools still see old profile"
**Cause:** Didn't restart tools
**Solution:**
```bash
# Must completely restart (not just reload)
# macOS: Cmd+Q, then reopen
# Windows/Linux: Close all windows, reopen
```
## Performance
| Operation | Time | Notes |
|-----------|------|-------|
| Switch profile | ~100ms | Instant |
| Create profile | ~200ms | Fast |
| List profiles | ~50ms | Very fast |
**Switching is fast** because it's just updating a symlink.
## Notes
- **No data loss:** Switching never deletes memories
- **Profile persistence:** Memories stay in original profile
- **Tool transparency:** AI tools don't need special config per profile
- **Backup-friendly:** Each profile is separate directory
## Related Commands
- `slm list-profiles` - Show all profiles
- `slm delete-profile <name>` - Delete a profile
- `slm rename-profile <old> <new>` - Rename profile
- `slm status` - Shows current profile
- `slm export-profile <name>` - Export to file
- `slm import-profile <file>` - Import from file
---
**Created by:** [Varun Pratap Bhardwaj](https://github.com/varun369) (Solution Architect)
**Project:** SuperLocalMemory V3
**License:** AGPL-3.0 (see [LICENSE](../../LICENSE))
**Repository:** https://github.com/qualixar/superlocalmemory
*Open source doesn't mean removing credit. Attribution must be preserved per AGPL-3.0 terms.*Related Skills
slm-status
Check SuperLocalMemory system status, health, and statistics. Use when the user wants to know memory count, graph stats, patterns learned, database health, or system diagnostics. Shows comprehensive system health dashboard.
slm-show-patterns
Show what SuperLocalMemory has learned about your preferences, workflow patterns, and project context. Use when the user asks "what have you learned about me?" or wants to see their coding identity patterns. Shows tech preferences, workflow sequences, and engagement health.
slm-remember
Save content to SuperLocalMemory with intelligent indexing and knowledge graph integration. Use when the user wants to remember information, save context, store coding decisions, or persist knowledge for future sessions. Automatically indexes, graphs, and learns patterns.
slm-recall
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.
slm-list-recent
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).
slm-build-graph
Build or rebuild the knowledge graph from existing memories using TF-IDF entity extraction and Leiden clustering. Use when search results seem poor, after bulk imports, or to optimize performance. Automatically discovers relationships between memories and creates topic clusters.
superlocalmemory
AI agent memory with mathematical foundations. Store, recall, search, and manage memories locally with zero cloud dependency.
customer-psychographic-profiler
One sentence - what this skill does and when to invoke it
performance-profiler
Performance Profiler
system-profile
Profile a target (script, process, GPU, memory, interconnect) using external tools and code instrumentation. Produces structured performance reports with actionable recommendations. Use when user says "profile", "benchmark", "bottleneck", or wants performance analysis.
switch-worktree
Switch the current session to work in an existing git worktree
implementing-ransomware-kill-switch-detection
Detects and exploits ransomware kill switch mechanisms including mutex-based execution guards, domain-based kill switches, and registry-based termination checks. Implements proactive mutex vaccination and kill switch domain monitoring to prevent ransomware from executing. Activates for requests involving ransomware kill switch analysis, mutex vaccination, WannaCry-style domain kill switches, or malware execution guard detection.