Mem0 Sync
Apps & Automationmem0-syncMem0 Sync is an Agent Skill for apps & automation published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Auto-sync session context, decisions, and patterns to Mem0 for cross-session continuity
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/context-management/mem0-sync/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/mem0-sync, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Mem0 Auto-Sync
Automatically synchronize session context to Mem0 for seamless cross-session continuity. This skill executes MCP calls to persist decisions, patterns, and session summaries.
When to Use
- Automatically: Invoked at session end by
mem0-pre-compaction-sync.shhook - Manually: Run
/mem0-syncto force sync mid-session - After major decisions: Sync important architectural decisions immediately
Quick Sync
Execute these MCP calls based on the sync context provided:
1. Session Summary (Always)
mcp__mem0__add_memory({
text: "Session Summary: {task_summary}",
user_id: "{project}-continuity",
metadata: {
type: "session_summary",
status: "{status}",
has_blockers: {has_blockers},
has_next_steps: {has_next_steps}
},
enable_graph: true
})
2. Pending Decisions (If Any)
For each decision in the decision log that hasn't been synced:
mcp__mem0__add_memory({
text: "{decision_content}",
user_id: "{project}-decisions",
metadata: {
category: "{category}",
outcome: "success"
},
enable_graph: true
})
3. Agent Patterns (If Any)
For each agent pattern that was learned:
mcp__mem0__add_memory({
text: "{pattern_description}",
user_id: "{project}-agents",
agent_id: "skf:{agent_type}",
metadata: {
category: "{category}",
outcome: "{success|failed}"
},
enable_graph: true
})
4. Best Practices (If Generalizable)
For patterns that apply across projects:
mcp__mem0__add_memory({
text: "{best_practice}",
user_id: "skillforge-global-best-practices",
metadata: {
project: "{project}",
category: "{category}",
outcome: "success"
},
enable_graph: true
})
Sync Protocol
- Check availability: Verify Mem0 MCP is configured
- Read sync state: Load
.claude/coordination/.decision-sync-state.json - Execute MCP calls: Run add_memory for each item
- Update sync state: Mark synced items to prevent duplicates
- Confirm completion: Output sync summary
Key Patterns
Idempotent Sync
- Track synced decision IDs in sync state file
- Skip already-synced items
- Handle partial failures gracefully
Graph Memory
- Always use
enable_graph: truefor relationship extraction - Mem0 automatically creates entity/relation graphs
- Enables semantic search across related concepts
Scoped User IDs
{project}-continuity: Session summaries{project}-decisions: Architectural decisions{project}-agents: Agent-specific patternsskillforge-global-best-practices: Cross-project patterns
Related Skills
recall- Search and retrieve from Mem0context-compression- Compress context before syncbrainstorming- Generate decisions worth syncing