MCPInstall

import

Imports memories from an exported Markdown file or MEMORY.md into the current project. Use when migrating from another project, restoring from backup, importing Claude Code native MEMORY.md content, or setting up a new project with existing knowledge.

Installs
93
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/mem0ai/mem0 --skill import
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads import automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Mem0 Import

Import memories from a mem0 export file into the current project.

Execution

Step 1: Determine the export file to import

If the user provided a filename as an argument to /mem0:import <filename>, use that file.

Otherwise, list .md files in the current directory whose names contain mem0-export:

ls -1 *.md 2>/dev/null | grep mem0-export || echo "No export files found"

If multiple files are found, ask the user which one to import. If none are found, print:

No mem0-export files found in the current directory.
Run /mem0:export first, or provide the filename: /mem0:import <path-to-file>

Step 2: Parse the export file

Determine the plugin root. Use the appropriate variable for the current platform:

  • Claude Code: ${CLAUDE_PLUGIN_ROOT}
  • Codex: ${CODEX_PLUGIN_ROOT}
  • Cursor: ${CURSOR_PLUGIN_ROOT}

Run the parser script to extract memory records as JSON:

python3 "<PLUGIN_ROOT>/scripts/parse_export_file.py" "<path-to-export-file>"

This outputs a JSON array where each element has:

  • id — original memory ID (for reference only; a new ID will be assigned on import)
  • type — metadata type
  • confidence — metadata confidence value
  • branch — metadata branch
  • files — list of associated files
  • categories — list of categories
  • content — the memory text

If the script fails or outputs [], print:

Failed to parse <filename> or file contains no valid memory blocks.

and stop.

Step 3: Resolve identity

Determine the active identity:

  • user_id from MEM0_USER_ID env var, else $USER, else "default"
  • project_id (used as app_id) from MEM0_PROJECT_ID env var, or via the project resolver

Step 4: Import each memory

For each record in the parsed JSON array, call add_memory with:

  • text="<record.content>"
  • user_id=<active_user_id>
  • app_id=<active_project_id>
  • metadata={
    • "type": "<record.type>" (if non-empty)
    • "confidence": "<record.confidence>" (if non-empty)
    • "branch": "<record.branch>" (if non-empty)
    • "files": <record.files> (the list, if non-empty)
    • "source": "import"
    • }
  • infer=False

Notes:

  • Do NOT pass the original id — the platform assigns a new ID.
  • Skip records where content is empty (the parser already filters these, but be defensive).
  • Continue importing even if individual records fail; track the count of successes.

Step 5: Print results

Imported <N> memories into project <project_id>

Where <N> is the number of successfully imported memories.

If any failed:

Imported <N>/<total> memories into project <project_id> (<failed> failed)

Importing from competing AI tools (--tools)

When invoked with --tools (e.g., /mem0:import --tools), detect and import from competing AI tool configuration files:

Supported tools

ToolFile/directory
Cursor.cursorrules
GitHub Copilot.github/copilot-instructions.md
Clinememory-bank/ (directory of .md files)
Continue.continue/rules.md

T1: Detect

test -f .cursorrules && echo "cursor: .cursorrules"
test -f .github/copilot-instructions.md && echo "copilot: .github/copilot-instructions.md"
test -d memory-bank/ && echo "cline: memory-bank/"
test -f .continue/rules.md && echo "continue: .continue/rules.md"

T2: Ask user

List found files, ask which to import (numbers, comma-separated, or "all"). If none found:

No competing tool configuration files found.
Checked: .cursorrules, .github/copilot-instructions.md, memory-bank/, .continue/rules.md

T3: Run import

For each selected tool:

python3 "<PLUGIN_ROOT>/scripts/import_competing_tools.py" <tool> --path <file>

Tools: cursorrules, copilot, cline, continue.

T4: Report

Imported <N> memories into <project_id> (cursor: <N>, copilot: <N>)

Notes: infer=False, tagged metadata.source=<tool>-import, sections <50 chars skipped, chunks >10k chars truncated, safe to re-run (deduplication handles it).


Importing Claude Code's native MEMORY.md

When invoked with a path to Claude Code's native MEMORY.md file (typically ~/.claude/projects/<proj-key>/memory/MEMORY.md), or when on_session_start.sh detects native auto-memory and the user chooses to import:

  1. Read the file. It contains newline-separated memory entries (one fact per line, sometimes with - bullet prefix).
  2. Split by non-empty lines. Each line becomes one memory.
  3. Skip lines shorter than 20 characters or lines that are just headers (#).
  4. For each line, call add_memory with:
    • text="<line>"
    • user_id=<active_user_id>
    • app_id=<active_project_id>
    • metadata={"type": "task_learning", "source": "memory-md-import", "confidence": 0.8}
    • infer=False
  5. Report: Imported <N> memories from MEMORY.md into project <project_id>
  6. Suggest disabling native auto-memory:
    To avoid duplicate memory systems, add to ~/.claude/settings.json:
      "autoMemoryEnabled": false
    

This handles the cold-start gap when a user has been using Claude Code's native memory and switches to mem0.

Error Handling

  • If the parser script is not found at <PLUGIN_ROOT>/scripts/parse_export_file.py, print an error and stop.
  • If add_memory calls fail consistently (e.g. auth error), report the issue and stop early.

FAQ

What does the import skill do?

Imports memories from an exported Markdown file or MEMORY.md into the current project. Use when migrating from another project, restoring from backup, importing Claude Code native MEMORY.md content, or setting up a new project with existing knowledge.

How do I install import?

Run npx skills add https://github.com/mem0ai/mem0 --skill import in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/import/ (personal) or .claude/skills/import/ (project).

Which AI agents can use import?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is import safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains import?

It is published by mem0ai in mem0ai/mem0. It has 93 recorded installs.

More from mem0ai/mem0

View all →

mem0

mem0ai/mem0

Mem0 Platform SDK for adding persistent memory to AI applications. TRIGGER when: user mentions "mem0", "MemoryClient", "memory layer", "remember user preferences", "persistent context", "personalization", or needs to add long-term memory to chatbots, agents, or AI apps. Covers Python SDK (mem0ai), TypeScript SDK (mem0ai), and framework integrations (LangChain, CrewAI, OpenAI Agents SDK, Pipecat, LlamaIndex, AutoGen, LangGraph). Also covers the open-source self-hosted Memory class. This is the DEFAULT mem0 skill for ambiguous queries. DO NOT TRIGGER when: user asks about CLI commands, terminal usage, or shell scripts (use mem0-cli), or Vercel AI SDK / @mem0/vercel-ai-provider / createMem0 (use mem0-vercel-ai-sdk).

AI & Agents2.3K installs

mem0-cli

mem0ai/mem0

Mem0 CLI -- the command-line interface for mem0 memory operations. TRIGGER when: user mentions "mem0 cli", "mem0 command line", "@mem0/cli", "mem0-cli", "pip install mem0-cli", "npm install -g @mem0/cli", or is running mem0 commands in a terminal/shell (mem0 add, mem0 search, mem0 list, mem0 get, mem0 init, mem0 config, mem0 import). Also triggers when query includes CLI flags like --user-id, --output, --json, --agent, or describes bash/zsh/terminal/shell usage. DO NOT TRIGGER when: user asks about programmatic SDK integration in Python/TS code (use mem0 skill), or Vercel AI SDK provider (use mem0-vercel-ai-sdk skill).

DevOps & Cloud778 installs

Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also triggers for Next.js apps needing memory-augmented AI. DO NOT TRIGGER when: user asks about direct Python/TS SDK calls without Vercel (use mem0 skill), or CLI terminal commands (use mem0-cli skill).

AI & Agents514 installs

mem0-integrate

mem0ai/mem0

Open the skill to read its SKILL.md instructions.

402 installs

Open the skill to read its SKILL.md instructions.

Testing & QA327 installs

Open the skill to read its SKILL.md instructions.

186 installs

Popular docs & writing skills

View category →

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.2M installs

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing778.7K installs

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing490.7K installs

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing490.2K installs

writing-fragments

mattpocock/skills

Writing, explore: mine raw fragments, no structure yet.

Docs & Writing489.6K installs

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing479.3K installs