Agent skill

Cognee Forget

by topoteretes in topoteretes/cognee

Removes data from cognee memory with forget(), finding the right dataset and document first and choosing between one document, a dataset or only the graph and vector memory.

Apache-2.0Auto-check passedAgent Workflows

Install Cognee Forget

skills CLI
$ npx skills add topoteretes/cognee --skill cognee-forget -a claude-code

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

GitHub CLI
$ gh skill install topoteretes/cognee cognee-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/topoteretes/cognee.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/cognee-forget .claude/skills/cognee-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
cognee-forget
GitHub stars
32k
Token cost
~1.9k tokens
SKILL.md length
859 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Removes data from cognee memory with forget(), finding the right dataset and document first and choosing between one document, a dataset or only the graph and vector memory.

  • Works in 4 steps: Find the dataset → List its documents → Read the content before deciding → …
  • Deleting a specific document from cognee memory
  • SKILL.md covers Use it, Pitfalls, How it works and Extending it
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

forget() is cognee's single deletion API, and the skill treats deletion as final: find, read, confirm, then delete. The agent lists the datasets you can read, lists a dataset's documents, then reads the stored content, because names are often hashes, and shows candidates with a short preview. The same steps are given for the Python SDK, the HTTP API and the CLI.

Hard limits apply: delete only what you asked to forget, confirm the exact items first unless you gave exact ids, and use forget(everything=True) only when you explicitly ask to wipe all of your memory, never any other reset mechanism. A table maps goals to calls: one document, a whole dataset, or only the derived graph and vector memory while the raw files are kept, with shared entities staying while another document still references them.

When your agent uses it

  • Deleting a specific document from cognee memory
  • Removing a whole dataset or only its graph and vector memory
  • Finding which dataset holds content you want forgotten

Example prompts

  • “Forget the meeting notes about the Henderson contract from my cognee memory.”
  • “List my cognee datasets and show which documents are in the research dataset.”
  • “Delete the derived graph memory for the support dataset but keep the raw files.”

Requirements

  • A cognee installation, used through its Python SDK, HTTP API or CLI

Workflow steps

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

  1. Find the dataset
  2. List its documents
  3. Read the content before deciding
  4. Delete

What it can do on your machine

Read from SKILL.md and the folder at commit 0ec7a9f. 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 (its code samples are python).

    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

Cognee Forget loads about 1.9k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 859 words of instructions outside code blocks.

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

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 topoteretes/cognee at commit 0ec7a9f, republished under its Apache-2.0 licence (© topoteretes). 859 words, ~1,920 tokens.

Download SKILL.mdSave it as .claude/skills/cognee-forget/SKILL.md (or your agent's skills folder).
name
cognee-forget
description
Use when removing data from cognee memory with forget() in the SDK, HTTP API, or CLI — finding which dataset and document hold the content to delete (listing datasets and data items, reading raw content), choosing between deleting one document, a whole dataset, or only the graph/vector memory, and doing it safely.

Remove data with forget()

forget() is cognee's one deletion API. It removes one document, a whole dataset, or only the derived memory (graph + vectors) while keeping the raw files. Deletion cannot be undone, so the workflow is always find, read, confirm, then delete.

Hard limits for agents

  • Delete only what the user asked to forget. Identify it by reading the content first; never guess from a file name alone.
  • Confirm the exact items with the user before deleting, unless they already named exact ids.
  • The widest deletion you may run is forget(everything=True), and only when the user explicitly asks to wipe all of their memory. Never use any other reset or wipe mechanism to delete data.

Use it

1. Find the dataset
python
import cognee

datasets = await cognee.datasets.list_datasets()  # datasets the user can read
for ds in datasets:
    print(ds.id, ds.name)

HTTP: GET /api/v1/datasets. CLI: cognee-cli datasets list.

2. List its documents
python
items = await cognee.datasets.list_data(dataset_id)  # all Data rows, oldest first
for item in items:
    print(item.id, item.name, item.extension, item.created_at)

HTTP: GET /api/v1/datasets/{dataset_id}/data?limit=100&offset=0 (limit up to 1000; GET .../data/count for the total; example: examples/python/dataset_data_pagination.py). CLI: cognee-cli datasets data <dataset_uuid>.

Each item has id, name, created_at, extension, mime_type, raw_data_location, dataset_id, label, external_metadata (including any node_set), and data_size.

3. Read the content before deciding

Names are often text_<hash>.txt, so read the content to find what the user means.

  • HTTP: GET /api/v1/datasets/{dataset_id}/data/{data_id}/raw returns the stored file (404 if it is gone).
  • SDK: there is no "get raw" helper; open the stored location:
python
from cognee.infrastructure.files.utils.open_data_file import open_data_file

async with open_data_file(item.raw_data_location, mode="rb") as f:
    preview = f.read(2000).decode("utf-8", errors="replace")

Judge matches by meaning, not only by keywords, and show the user the candidates (name + a short preview) before deleting.

4. Delete
GoalCallWhat remains
One documentforget(data_id=..., dataset_id=...) (or dataset="name")Nothing of that document; shared entities stay while another document still references them
A whole datasetforget(dataset="name") or forget(dataset_id=...)The dataset is deleted outright: the record, its data rows, graph and vector stores, and attributed sessions
Rebuild a dataset's graph laterforget(dataset="name", memory_only=True)Raw files and data rows; graph, vectors, sessions and pipeline status are reset, so the data can be re-processed
One document's memory onlyforget(dataset="name", data_id=..., memory_only=True)That document's raw file and row
Every dataset the user can deleteforget(everything=True)Nothing, in any dataset the user has delete on in the current tenant (shared ones included). Only on explicit request (see the hard limits)

Return values: {"data_id", "dataset_id", "status"} for a document, {"dataset_id", "status"} for a dataset (plus data_records_reset with memory_only), {"datasets_removed", "status"} for everything (datasets_removed counts the datasets the user can read, not the delete set).

HTTP: POST /api/v1/forget with a JSON body; camelCase and snake_case keys both work: {"datasetId": "...", "dataId": "..."}, {"dataset": "name", "memoryOnly": true}, {"everything": true}. Invalid combinations return 422.

CLI: cognee-cli forget --dataset NAME | --dataset-id UUID [--data-id UUID] [--memory-only], or --everything / --all. The CLI does not ask for confirmation; confirm with the user first.

Show full SKILL.md (426 more words)Show less

Pitfalls

  • A data_id that is not in the dataset returns success and deletes nothing. The delete path treats an unknown id as a custom-graph-model delete. Always take the id from list_data for that same dataset, and check it is still listed afterwards if it matters.
  • Pass either dataset or dataset_id, not both (ValueError). data_id and memory_only both need a dataset.
  • memory_only is ignored when everything=True in the SDK (the CLI rejects the combination). everything=True always deletes everything.
  • Not found and not allowed look the same. An unknown dataset name and one the user cannot delete both raise DatasetNotFoundError. Deleting needs the delete permission on the dataset (see the cognee-permissions skill). everything=True deletes every dataset the user has delete permission on in the current tenant, including datasets shared to them with delete rights, not only the ones they own.
  • Sessions that cited deleted data are invalidated so recall stops returning answers built on it. Agent-trace entries are not invalidated.
  • Changing a document is not a delete. To replace a document's content, use cognee.update(data_id=..., data=..., dataset_id=...), which keeps its id and re-extracts only the changed parts.
  • cognee.delete() is deprecated; use forget().

How it works

forget() resolves the dataset with the delete permission, then:

  • One document → datasets.delete_data(): takes the dataset lock, deletes the graph nodes and edges the document owns, the matching vectors and edge evidence, invalidates sessions that cited them, then deletes the Data row. Ownership is tracked per document (source-refs on graph elements), so an entity shared by two documents survives until both are deleted. Raw files are reference-counted by storage location.
  • A dataset → datasets.empty_dataset().
  • memory_only → drops the dataset's graph/vector memory and resets its pipeline status, leaving raw data for a rebuild.
  • everything → datasets.delete_all() over every dataset the user has delete on in the current tenant, plus a full prune of the session cache (when caching or usage logging is on). This wipes every user's sessions (Redis FLUSHDB / the whole fs cache / all SQL cache tables), not just this user's.

Key files:

  • cognee/api/v1/forget/forget.py (SDK), routers/get_forget_router.py (HTTP), cognee/cli/commands/forget_command.py (CLI)
  • cognee/api/v1/datasets/datasets.py (list_datasets, list_data, delete_data, empty_dataset, delete_all)
  • cognee/api/v1/datasets/routers/get_datasets_router.py (list, count, raw)
  • cognee/infrastructure/databases/provenance/source_refs.py (per-document ownership of graph elements)
  • cognee/infrastructure/files/utils/open_data_file.py

Extending it

  • Anything new that writes graph nodes or edges for a document must record its source-refs, or forget(data_id=...) cannot find and remove it.
  • Anything new that stores per-document data outside the graph (like edge evidence) needs a cleanup step in the delete path and in memory_only.
  • Unit tests for forget() are in cognee/tests/unit/api/v1/forget/ (argument validation, the HTTP endpoint, memory_only); cover both the document and the memory_only paths for new deletion behaviour.

© topoteretes, 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 .agents/skills/cognee-forget of topoteretes/cognee.

Open the folder on GitHubat commit 0ec7a9f

Compare with similar skills

Cognee Forget 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.

Cognee Forget compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cognee Forget this skilltopoteretes/cognee32k—~1.9kAutomated safety check: PassApache-2.0
Mem0 CLI Memory Commandsmem0ai/mem067k—~2kAutomated safety check: NotesApache-2.0
MemPalace Setup and OperationMemPalace/mempalace59k—~2.2kAutomated safety check: PassMIT
SkillOpt-Sleep Self-Improvement Cyclemicrosoft/SkillOpt18k—~2.3kAutomated safety check: PassMIT
Agent Memorytigerless-labs/agent-memory3.4k—~1.3kAutomated safety check: PassMIT
Mindmemos CLImindscale-noah/MindMemOS1k—~3.4kAutomated safety check: PassNone

Similar skills

  • 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 yesterday
    Agent WorkflowsAuto-check: notes
  • Installs and configures MemPalace as a private local palace, a shared-brain hub or a client of an existing hub, including MCP registration and version-correct initialization.

    59k GitHub stars~2.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Official

    Runs a nightly or on-demand sleep cycle for a local Codex agent: review past sessions, replay recurring tasks and stage validated skill and memory edits for adoption.

    18k GitHub stars~2.3k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Agent Memory

    tigerless-labs/agent-memory

    Read and write the shared long-term memory store. An agent skill from tigerless-labs/agent-memory.

    3.4k GitHub stars~1.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Mindmemos CLI

    mindscale-noah/MindMemOS

    Give an AI agent persistent, cross-session long-term memory through MindMemOS.

    1k GitHub stars~3.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agent Wiki Compare Outcomes

    AgentToolkit/altk-evolve

    Contrasts successful and failed agent runs of the same task and derives guidelines backed by evidence from transcripts, tool calls and outcome judgments.

    123 GitHub stars~1.7k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from topoteretes/cognee

All 19 skills in this repo
  • Cognee CLI Memory Commands

    topoteretes/cognee

    Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations.

    32k GitHub stars~2.2k tokensUpdated today
    Auto-check: notes
  • Cognee Community Packages

    topoteretes/cognee

    Guide to using and contributing cognee community packages: database adapters, data-source connectors, custom tasks and retrievers, and Keywords AI observability.

    32k GitHub stars~1.2k tokensUpdated today
    Auto-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 today
    Auto-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 today
    Auto-check passed
  • Cognee Docker Setup

    topoteretes/cognee

    Runs the Cognee AI memory platform in Docker, from a one-file prebuilt image to a full compose stack with UI, MCP server, Postgres and Neo4j.

    32k GitHub stars~901 tokensUpdated today
    Auto-check: notes
  • Explains how cognee stores session memory by session_id and bridges it into the permanent graph with improve(), including the stages, results and settings.

    32k GitHub stars~3.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Cognee Forget

What does Cognee Forget do?

Removes data from cognee memory with forget(), finding the right dataset and document first and choosing between one document, a dataset or only the graph and vector memory. forget() is cognee's single deletion API, and the skill treats deletion as final: find, read, confirm, then delete. The agent lists the datasets you can read, lists a dataset's documents, then reads the stored content, because names are often hashes, and shows candidates with a short preview.

When should I use Cognee Forget?

Cognee Forget fits situations like: deleting a specific document from cognee memory; removing a whole dataset or only its graph and vector memory; finding which dataset holds content you want forgotten.

How do I install Cognee Forget in Claude Code?

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

How do I install Cognee Forget in Codex?

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

Can I use Cognee Forget 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 topoteretes/cognee --skill cognee-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/cognee-forget, .gemini/skills/cognee-forget, .github/skills/cognee-forget and .opencode/skills/cognee-forget in your project.

What does Cognee Forget need to run?

SKILL.md names no scripts, command-line tools or credentials: Cognee Forget is instructions for the agent only. Our summary lists: A cognee installation, used through its Python SDK, HTTP API or CLI.

Does Cognee Forget 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 Cognee Forget 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 Cognee Forget use?

Cognee Forget 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 Cognee Forget use?

About 1.9k tokens (SKILL.md is roughly 7.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 Cognee Forget?

Skills that share tags, products or a category with Cognee Forget: Mem0 CLI Memory Commands (mem0ai/mem0, 67k stars), MemPalace Setup and Operation (MemPalace/mempalace, 59k stars), SkillOpt-Sleep Self-Improvement Cycle (microsoft/SkillOpt, 18k stars) and Agent Memory (tigerless-labs/agent-memory, 3.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cognee Forget?

topoteretes (a GitHub organization) maintains it in topoteretes/cognee, which has 31,919 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 9, 2026.

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