
Mem0 Switch Project
FreeEasily manage project scopes and global memory access.
Free · Opens the source repo
What Mem0 Switch Project does
Mem0 Switch Project is a Bash-based tool designed for users of the Mem0 memory management system. It allows you to override the automatic detection of project IDs, enabling you to specify a particular project scope or to enable global search capabilities. This is particularly useful when working across multiple projects or when the auto-detection feature does not resolve to the correct project. By using this skill, developers and designers can streamline their workflow, ensuring that they are accessing the right memories associated with their current project context.
The skill provides three primary functionalities: switching to a specific project, enabling global search across all memories, and disabling global search to revert to per-project scoping. Users can easily execute commands to set their desired project context or search parameters. The commands are straightforward and involve modifying the user's settings file to reflect the changes in project scope or search capabilities.
This tool is particularly beneficial for teams that need to collaborate on shared memories or for individuals who frequently switch between different projects. By allowing global access to memories, team members can share insights and data without the need to manually switch contexts. Conversely, the ability to restrict searches to a specific project ensures that users can focus on the relevant information without distractions from other projects.
Overall, Mem0 Switch Project enhances productivity by providing a clear mechanism for managing memory access in a multi-project environment, making it an essential tool for developers and designers who rely on the Mem0 system for their memory management needs.
When to use it
Use this skill when you need to switch project contexts or enable global memory access across multiple projects.
When not to use it
This skill is not suitable for users who work exclusively within a single project or do not require access to shared memories.
What you can build with it
Switching Between Projects
When working on multiple projects, use this skill to quickly switch the memory context to the relevant project, ensuring you access the right data.
Enabling Team-Wide Memory Access
For collaborative projects, enable global search to allow all team members to access shared memories without needing to switch contexts.
Correcting Auto-Detection Issues
If the automatic project detection resolves incorrectly, use this skill to manually set the correct project ID for your current directory.
How to install Mem0 Switch Project
View source1. Install with the skills CLI
npx skills add mem0ai/mem0/switch-project --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mem0aiMem0 Switch Project
Override the automatic project_id detection for the current directory, or enable global search mode.
Usage
/mem0:switch-project <project-name>— switch to a specific project scope/mem0:switch-project --global— enable global search (all memories, all users, all projects)/mem0:switch-project --no-global— disable global search and return to per-project scoping
Execution
If --global flag is provided:
-
Set
global_search: truein~/.mem0/settings.jsonusing the Bash tool:python3 -c " import json, os settings_file = os.path.expanduser('~/.mem0/settings.json') settings = {} if os.path.isfile(settings_file): with open(settings_file) as f: settings = json.load(f) settings['global_search'] = True with open(settings_file, 'w') as f: json.dump(settings, f, indent=2) print('Global search enabled') " -
Print:
Global search enabled. Searches now return all memories across all users and projects. Writes still use the current user_id and app_id. Restart the session for the change to take effect.
If --no-global flag is provided:
-
Set
global_search: falsein~/.mem0/settings.jsonusing the Bash tool:python3 -c " import json, os settings_file = os.path.expanduser('~/.mem0/settings.json') settings = {} if os.path.isfile(settings_file): with open(settings_file) as f: settings = json.load(f) settings['global_search'] = False with open(settings_file, 'w') as f: json.dump(settings, f, indent=2) print('Global search disabled') " -
Print:
Global search disabled. Searches now return only memories scoped to the current project. Restart the session for the change to take effect.
If a project name is provided (no flags):
-
If no project name was given, ask: "What project_id should this directory use?"
-
Write the mapping to
~/.mem0/project_map.jsonusing the Bash tool:python3 -c " import json, os map_file = os.path.expanduser('~/.mem0/project_map.json') mapping = {} if os.path.isfile(map_file): with open(map_file) as f: mapping = json.load(f) mapping[os.getcwd()] = '<PROJECT_NAME>' os.makedirs(os.path.dirname(map_file), exist_ok=True) with open(map_file, 'w') as f: json.dump(mapping, f, indent=2) print(f'Mapped {os.getcwd()} -> <PROJECT_NAME>') "(Replace
<PROJECT_NAME>with the user's chosen project name.) -
Verify by searching for existing memories:
- Call
search_memorieswithquery="project",filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<PROJECT_NAME>"}]},top_k=1
- Call
-
Print:
Switched to project <PROJECT_NAME>. <N> memories found for this project. Note: This override persists across sessions for this directory.
Frequently asked questions about Mem0 Switch Project
Similar skills
Canva Creator
Streamline your content campaign from brief to HubSpot.
Cowork Plugin Customization
Tailor your Claude Code plugin to fit your organization.
Impediment Prioritization
Rank and prioritize impediments effectively.
Chronicle
Streamline your Copilot session analysis and reporting.
Idea Refine
Transform vague ideas into actionable concepts.
App Store Optimization
Optimize your mobile app's visibility and performance.
