mem0-scope

Views or changes the default memory scope for mem0 memory operations.

1|Updated Jan 13, 2022
One-click install
npx skills add https://github.com/jayho-k/TIL --skill mem0-scope-jayho-k
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mem0-scope
Source: https://github.com/jayho-k/TIL/tree/main/AI/mem0/code/mem0_code_analize/mem0/integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-scope
Command: npx skills add https://github.com/jayho-k/TIL --skill mem0-scope-jayho-k

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When using mem0 memory tools, memories can be scoped to a project, a session, or globally across all projects. Without a clear way to inspect or change the default scope, users risk saving memories to the wrong context or searching the wrong memory set. ## Core Features & Use Cases - View current scope: Reads the default_scope value from ~/.mem0/settings.json and displays which of the three scopes (project, session, global) is active, along with the current user, project, and session identity. - Change default scope: Updates the default_scope key in the settings file while preserving all other existing settings such as auto_save, search_limit, and global_search. - Use Case: You are working in a shared repository and want memories saved during this conversation to stay isolated to this run only. Run the scope change to session so subsequent memory saves and searches are filtered by the current run_id. ## Quick Start Ask the assistant to change the default memory scope to session so memories are 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?

Specify a target scope of project, session, or global, and the skill updates the default_scope key in ~/.mem0/settings.json. The change takes effect immediately for all memory tool calls 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 argument to delete user-wide memories, preventing accidental cross-project deletion.

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 the current user, while global_search is a separate setting that searches across all users. Changing the default scope leaves the global_search setting untouched.