Agent skill

Mem0 Memory Deletion

by mem0ai in mem0ai/mem0

Finds and deletes specific mem0 memories by search query or ID, always asking for confirmation first, and can undo the most recent memories added this session.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Mem0 Memory Deletion

skills CLI
$ npx skills add mem0ai/mem0 --skill mem0-forget -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mem0ai/mem0 mem0-forget --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mem0ai/mem0.git skills-src && mkdir -p .claude/skills && cp -r skills-src/integrations/opencode-plugin/opencode-skills/mem0-forget .claude/skills/mem0-forget && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mem0-forget
GitHub stars
67k
Token cost
~664 tokens
SKILL.md length
301 words
Files
1
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Finds and deletes specific mem0 memories by search query or ID, always asking for confirmation first, and can undo the most recent memories added this session.

  • Works in 5 steps: Parse input → Find memories → Confirm → …
  • Removing an outdated or incorrect memory from mem0
  • SKILL.md covers Execution, Undo recent writes and Output formatting
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Given a memory ID or a search phrase, the skill either verifies the memory exists with get_memory or runs search_memories scoped to the active user and project, showing a numbered list of matches with their type and creation date. It then asks which numbered entries to delete, or a yes or no for a single memory, and never deletes anything without that confirmation, since the action is destructive. Each confirmed id is removed with delete_memory and the count of deletions is reported, along with any that failed.

A separate undo path handles a request like undo last N memories: if the plugin's shell.env hook has set MEM0_SESSION_ID, it searches for recently added memories tagged with that session id, shows the most recent N sorted by creation time, and asks for confirmation before deleting them. If no session id is tracked, it suggests browsing recent memories instead. Output avoids markdown formatting entirely because the OpenCode TUI renders it as literal characters rather than rendering it.

When your agent uses it

  • Removing an outdated or incorrect memory from mem0
  • Cleaning up memories created during a test or experiment
  • Undoing the last few memories written earlier in the session

Example prompts

  • “/mem0-forget auth module decisions”
  • “Undo the last 3 memories you just added.”
  • “Delete the memory with ID 7f3a2b1c after showing me what it says.”

Requirements

  • A configured mem0 account with search_memories, get_memory and delete_memory tools
  • OpenCode with the mem0 plugin

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Parse input
  2. Find memories
  3. Confirm
  4. Delete
  5. Report

What it can do on your machine

Read from SKILL.md and the folder at commit b7ad69a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mem0 Memory Deletion loads about 664 tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 301 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~664

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mem0ai/mem0 at commit b7ad69a, republished under its Apache-2.0 licence (© mem0ai). 301 words, ~664 tokens.

Download SKILL.mdSave it as .claude/skills/mem0-forget/SKILL.md (or your agent's skills folder).
name
mem0-forget
description
Deletes memories by search query or memory ID with confirmation before removal. Use when removing outdated decisions, incorrect memories, sensitive data, or cleaning up after experiments. Also handles undo of recent additions.

Mem0 Forget

Delete specific memories from mem0.

Execution

Step 1: Parse input

The user provides either:

  • A search query: /mem0-forget auth module decisions
  • A memory ID: /mem0-forget <memory_id>

If no argument, ask: "What should I forget? Provide a search query or memory ID."

Step 2: Find memories

If memory ID provided (looks like a UUID or hex string):

  • Call get_memory with the ID to verify it exists.
  • Show: Found: "<memory content first 120 chars>" (created <date>)

If search query provided:

  • Call search_memories with:
    • query=<user's query>
    • filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<project_id>"}]}
    • top_k=10
  • Show numbered list:
    Found <N> memories matching "<query>":
    1. <content, 120 chars> (type: <type>, created: <date>) [ID: <short_id>]
    2. ...
Step 3: Confirm

Ask: "Delete which memories? Enter numbers (e.g., 1,3,5), 'all', or 'cancel'."

For a single memory ID, ask: "Delete this memory? [y/N]"

Never delete without confirmation. This is destructive.

Step 4: Delete

For each confirmed memory, call delete_memory with the memory ID.

Step 5: Report
Deleted <N> memories.

If any deletions failed, report which ones and why.

Undo recent writes

If the user says "undo last N memories" or "undo last write":

  1. Check the MEM0_SESSION_ID environment variable (set by the plugin's shell.env hook).
  2. If MEM0_SESSION_ID is set, call search_memories with:
    • query="recently added"
    • filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<project_id>"}, {"metadata": {"session_id": "<MEM0_SESSION_ID>"}}]}
    • top_k=20
  3. Sort results by creation time descending and show the last N entries (default 1). Ask for confirmation.
  4. Delete confirmed entries via delete_memory.

If MEM0_SESSION_ID is not set or the search returns no results, tell the user: "No recent memory IDs tracked this session. Try /mem0-tour to browse recent memories, or /mem0-forget <search query> to find specific ones."

Output formatting

IMPORTANT: Do NOT use markdown in your output. OpenCode TUI renders text verbatim — markdown like bold, ## headers, and | table | syntax appears as raw characters. Use plain text with indentation for structure. Use dashes for lists. Use spaces to align columns instead of markdown tables.

© mem0ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in integrations/opencode-plugin/opencode-skills/mem0-forget of mem0ai/mem0.

Open the folder on GitHubat commit b7ad69a

Compare with similar skills

Mem0 Memory Deletion next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mem0 Memory Deletion compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mem0 Memory Deletion this skillmem0ai/mem067k—~664Automated safety check: PassApache-2.0
AgentDB Pattern Memoryruvnet/ruflo74k2 repos~830Automated safety check: PassMIT
Cognee Custom Graph Modelstopoteretes/cognee32k—~2.5kAutomated safety check: PassApache-2.0
Cognee Custom Pipelinestopoteretes/cognee32k—~2.8kAutomated safety check: PassApache-2.0
Dive Into LangGraphluochang212/dive-into-langgraph457—~837Automated safety check: NotesCustom licence
LanceDB Memory Configuration GuideCortexReach/memory-lancedb-pro-skill229—~14kAutomated safety check: PassNone

Similar skills

  • Stores, searches, and retrieves successful patterns with HNSW-indexed semantic search so agents can reuse past solutions instead of relearning them.

    74k GitHub starsUsed in 2 repos~830 tokens
    AI & LLM EngineeringAuto-check passed
  • Cognee Custom Graph Models

    topoteretes/cognee

    Defines the shape of cognee's knowledge graph with graph_model: DataPoint node classes, identity and index fields, typed edges and fixes for duplicated nodes.

    32k GitHub stars~2.5k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Cognee Custom Pipelines

    topoteretes/cognee

    Shows how to write custom cognee tasks, chain them into pipelines, store custom DataPoints and run enrichment over the existing graph.

    32k GitHub stars~2.8k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Dive Into LangGraph

    luochang212/dive-into-langgraph

    A Chinese-language guide and reference for building agents with LangGraph 1.0, from a first ReAct agent through middleware, memory, MCP, RAG and web search.

    457 GitHub stars~837 tokensUpdated 28 days ago
    AI & LLM EngineeringAuto-check: notes
  • LanceDB Memory Configuration Guide

    CortexReach/memory-lancedb-pro-skill

    Walks through installing and tuning memory-lancedb-pro, picking an embedding, reranker, and LLM combination from four preset configuration plans.

    229 GitHub stars~14k tokensUpdated 6 mo ago
    AI & LLM EngineeringAuto-check passed
  • Cuda Cpp Kernel

    vipshop/cache-dit

    A skill your agent uses when writing, debugging, porting, reviewing, or optimizing CUDA C++ or PTX kernels; investigating CUDA Runtime or Driver API behavior; profiling kernels with Nsight Systems…

    1.3k GitHub stars~2.3k tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check passed

More from mem0ai/mem0

All 26 skills in this repo
  • Adds persistent memory to AI apps with the Mem0 Python and TypeScript SDKs: store, search, update and delete user memories, with framework integrations.

    67k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Adds, searches, lists, updates and deletes memories on the Mem0 platform from the terminal with the mem0 command, including a JSON mode built for agents.

    67k GitHub stars~2k tokensUpdated today
    Auto-check: notes
  • Adds persistent memory to Vercel AI SDK apps with the Mem0 provider, using a wrapped model or standalone retrieve and store utilities.

    67k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Saves a fact, decision or preference the user states into mem0 as written, labeled with a memory type such as decision, convention or user_preference.

    67k GitHub stars~560 tokensUpdated today
    Auto-check passed
  • Shows or changes the default Mem0 memory scope, project, session or global, which decides where memories are saved and searched.

    67k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Looks up stored agent memories by keyword or ID and prints compact one-line results instead of full detail.

    67k GitHub stars~502 tokensUpdated today
    Auto-check passed

Questions about Mem0 Memory Deletion

What does Mem0 Memory Deletion do?

Finds and deletes specific mem0 memories by search query or ID, always asking for confirmation first, and can undo the most recent memories added this session. Given a memory ID or a search phrase, the skill either verifies the memory exists with get_memory or runs search_memories scoped to the active user and project, showing a numbered list of matches with their type and creation date. It then asks which numbered entries to delete, or a yes or no for a single memory, and never deletes anything without that confirmation, since the action is destructive.

When should I use Mem0 Memory Deletion?

Mem0 Memory Deletion fits situations like: removing an outdated or incorrect memory from mem0; cleaning up memories created during a test or experiment; undoing the last few memories written earlier in the session.

How do I install Mem0 Memory Deletion in Claude Code?

Run `npx skills add mem0ai/mem0 --skill mem0-forget -a claude-code`. Or copy the skill folder (integrations/opencode-plugin/opencode-skills/mem0-forget in mem0ai/mem0) into .claude/skills/mem0-forget in your project. Claude Code loads it when a task matches its description.

How do I install Mem0 Memory Deletion in Codex?

Run `npx skills add mem0ai/mem0 --skill mem0-forget -a codex`. Or copy the skill folder (integrations/opencode-plugin/opencode-skills/mem0-forget in mem0ai/mem0) into .agents/skills/mem0-forget in your project. Codex loads it when a task matches its description.

Can I use Mem0 Memory Deletion in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mem0ai/mem0 --skill mem0-forget -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mem0-forget, .gemini/skills/mem0-forget, .github/skills/mem0-forget and .opencode/skills/mem0-forget in your project.

What does Mem0 Memory Deletion need to run?

SKILL.md names no scripts, command-line tools or credentials: Mem0 Memory Deletion is instructions for the agent only. Our summary lists: A configured mem0 account with search_memories, get_memory and delete_memory tools; OpenCode with the mem0 plugin.

Does Mem0 Memory Deletion access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mem0 Memory Deletion safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mem0 Memory Deletion use?

Mem0 Memory Deletion is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mem0 Memory Deletion use?

About 664 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mem0 Memory Deletion?

Skills that share tags, products or a category with Mem0 Memory Deletion: AgentDB Pattern Memory (ruvnet/ruflo, 74k stars), Cognee Custom Graph Models (topoteretes/cognee, 32k stars), Cognee Custom Pipelines (topoteretes/cognee, 32k stars) and Dive Into LangGraph (luochang212/dive-into-langgraph, 457 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mem0 Memory Deletion?

mem0ai (a GitHub organization) maintains it in mem0ai/mem0, which has 66,867 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 9, 2026.

Source: mem0ai/mem0 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.