switch-project

Overrides auto-detected project scope or enables global search for Mem0 memories.

64.5k|7.6k|Updated Jun 20, 2023
One-click install
npx skills add https://github.com/mem0ai/mem0 --skill switch-project
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: switch-project
Source: https://github.com/mem0ai/mem0/tree/main/integrations/mem0-plugin/skills/switch-project
Command: npx skills add https://github.com/mem0ai/mem0 --skill switch-project

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When working across multiple repositories or teams, Mem0's automatic project detection can scope memories to the wrong project, making it impossible to read or write memories under the correct project ID or to search across all projects at once.

Core Features & Use Cases

  • Project Scope Override: Maps the current working directory to a specific project_id in ~/.mem0/project_map.json so reads and writes target the right project.
  • Global Search Mode: Toggles a global_search flag in ~/.mem0/settings.json to search memories across all users and projects.
  • Use Case: You are working in a monorepo but need to access memories stored under a different project's ID. Run the switch-project command with that project name, and the override persists across sessions for that directory.

Quick Start

Ask the assistant to switch this directory's Mem0 project scope to a specific project name, or to enable global memory search across all projects.

Frequently Asked Questions about switch-project

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch Mem0 to a different project ID?

Run the switch-project command with the target project name. The skill writes a mapping from the current working directory to that project_id in ~/.mem0/project_map.json, and the override persists across sessions for that directory.

How do I search Mem0 memories across all projects and users?

Use the switch-project command with the --global flag. This sets global_search to true in ~/.mem0/settings.json, so searches return all memories across all users and projects while writes still use the current user_id and app_id.

Does the Mem0 project override persist between sessions?

Yes, the directory-to-project mapping is stored in ~/.mem0/project_map.json and persists across sessions. However, changes to the global_search setting require a session restart to take effect.

How do I disable global search in Mem0?

Run switch-project with the --no-global flag. This sets global_search to false in ~/.mem0/settings.json, returning searches to only memories scoped to the current project after a session restart.

What happens if Mem0 auto-detection picks the wrong project?

Auto-detection can resolve to the wrong project when directories do not match expected naming. The switch-project skill fixes this by explicitly mapping the current directory to the correct project_id, overriding the automatic detection.