mem0-scope

Views or changes the default memory scope for saving and searching memories.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When working with Mem0 memories across multiple projects, users need control over whether memories are isolated to the current repository, the current session, or shared across all projects. This Skill lets you view and change that default scope without manually editing configuration files.

Core Features & Use Cases

  • View Current Scope: Display the active default scope (project, session, or global) along with the current user, project, and session identity, plus an optional count of memories in scope.
  • Change Default Scope: Set the default scope to project (this repo only), session (this run only), or global (all your projects) by updating ~/.mem0/settings.json while preserving all other settings.
  • Use Case: You are debugging a personal project and want memories saved during this conversation to stay isolated from your other work. Run the scope command with "session" so new memories and searches are limited to this run only.

Quick Start

Ask the assistant to change the default memory scope to session so memories stay isolated to this conversation.

Frequently Asked Questions about mem0-scope

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

FAQPage Schema
How do I change the default memory scope in Mem0?

Run the mem0-scope command with a target scope: project, session, or global. The skill updates the default_scope key in ~/.mem0/settings.json, and the change takes effect immediately for memory tools in the current session.

What are the memory scope options in Mem0?

There are three scopes: project limits memories to the current repo via user_id and app_id, session isolates memories to the current run via run_id, and global shares memories across all your projects by dropping app_id on writes.

Does changing the default scope affect delete_all_memories?

No. delete_all_memories deliberately ignores the default scope and always requires an explicit scope=global to delete user-wide memories, so changing the default can never cause a cross-project wipe.

Can I override the default scope for a single memory call?

Yes. The default scope only applies when no explicit scope is given. Any memory tool call can pass an explicit scope parameter to override the default for that one operation.

What is the difference between global scope and global_search in Mem0?

Global scope means memories span all projects for your user, while global_search is a separate setting that searches across all users. Changing the default scope leaves the global_search setting untouched.