Skip to content

Remove data with forget()

Safely find and delete documents, datasets or memory from cognee via forget()

Stars
33,002
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an agent how to delete information from a cognee memory store. It walks the agent through finding the right dataset and document, reading the stored content to confirm the match, and then removing only the requested item (one document, a whole dataset, or just the derived graph and vector memory). It also tells the agent to confirm with the user before any deletion, because deletion cannot be undone.

Great for

  • Developers who maintain a cognee knowledge base and need to remove outdated or sensitive documents
  • Teams that want an agent to handle deletion requests without wiping more than intended
  • Operators who need to rebuild a dataset's graph while keeping the original raw files

Skip it if

  • Replacing or editing a document's content: the skill notes this should use cognee.update() instead, since forget() is a delete
  • Anyone expecting an undo: deletions are permanent, and the CLI does not ask for confirmation
  • Use on shared multi-user deployments without care: forget(everything=True) removes data across all datasets the user can delete, and clears session caches for every user

Try asking

  • “Find the document in my 'support-tickets' dataset that mentions the old pricing and delete it”
  • “Rebuild the graph for the 'research' dataset without deleting the raw files”
  • “Show me which datasets I have and list the documents in the marketing one before removing anything”
Step-by-step guide: how to use Remove data with forget()Install, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    cognee-forget.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip cognee-forget.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip cognee-forget.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Ask the agent to show the matching document previews and get your explicit approval before it deletes anything
  • Prefer deleting by exact data_id from a dataset listing; avoid deleting by file name alone
  • Use memory_only when you only want to rebuild derived memory and keep the raw files

What's inside

  • SKILL.md

Redistributed unmodified from topoteretes/cognee under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.