export

A memory-export skill saves all memories for the current project in a portable Markdown file. Markdown is a plain-text format that is easy to read, copy, and store.

In plain words
What is it for?
It is used for backups, project migration, sharing memory with teammates, and archiving memories before cleanup.
Why use it?
It gives you a backup of project memories and makes it possible to move or share them.

Skill for Claude CodeCodex

▶ Mem0 + Claude Code MCP — Give Your AI Agent a Permanent Memory Prompt Engineer · about mem0ai/mem0 · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mem0ai/mem0/export
Any agent
npx skills add mem0ai/mem0 --skill export
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00559
Opus 5 $0.00019 $0.00280
Sonnet 5 $0.00008 $0.00112
Haiku 4.5 $0.00004 $0.00056

Measured 3d ago against content hash e308fd0de8c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

export scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/mem0-plugin/skills/export/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mem0 Export

Export all memories for the current project to a portable Markdown file.

Execution

Step 1: 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 2: Fetch all memories

Call get_memories with:

  • filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}]}
  • page_size=200

If the response is paginated (i.e. the result contains a next cursor or the count equals page_size), continue fetching pages until all memories are retrieved.

Step 3: Format each memory as a YAML-frontmatter block

For each memory record, produce a block in this exact format:

---
id: <memory.id>
created_at: <memory.created_at>
type: <memory.metadata.type or "">
confidence: <memory.metadata.confidence or "">
branch: <memory.metadata.branch or "">
files: <memory.metadata.files joined with ", " or "">
categories: <memory.categories joined with ", " or "">
---
<memory.memory or memory content string>

Notes:

  • The --- delimiters must be on their own lines with no extra whitespace.
  • files and categories are written as comma-separated values on a single line.
  • Leave a blank line after the content before the next --- (for readability).
  • If a field is missing or null, write an empty string (not "null").

Step 4: Write the export file

Determine the output filename:

mem0-export-<project_id>-<YYYY-MM-DD>.md

Where <YYYY-MM-DD> is today's date in UTC.

Write all formatted blocks to this file using the Write tool (or equivalent). The file is written to the current working directory.

Step 5: Print summary

Exported <N> memories to <filename>

Where <N> is the total number of memory blocks written.

Error Handling

  • If get_memories returns an error or zero memories, print:
    No memories found for project <project_id>. Nothing exported.
    
  • If the write fails, report the error to the user.

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 77 lines · 39 tokens per session scan A e308fd0de8c3

Subscribe to this mod's changes

export is a skill published in the GitHub repository mem0ai/mem0 (64,535 stars, last pushed today), licensed Apache-2.0. It adds 39 tokens to every session and 559 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.