cognee-forget
Skill31k starsChanged 2 months agoApache-2.0View on GitHub
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.
Trending
More talk lately.about the whole repository
Who's talking about topoteretes/cognee
- A Hacker News story“Show HN: Cognee – Open-Source AI Memory Layer That Remembers Context”Hacker News · Jun 3, 2025 · 9 points
- @github-trending.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 topoteretes / cognee ⭐ 4,853 (+414) 🗒 Python Memory for AI Agents …”Bluesky · Jun 9, 2025 · 7 likes
- A Hacker News story“Show HN: Auto-optimizing deterministic LLM outputs using knowledge graphs”Hacker News · Apr 22, 2024 · 7 points
- A Hacker News story“Show HN: Cognee – Turn RAG and GraphRAG into custom dynamic semantic memory”Hacker News · Feb 13, 2025 · 6 points
- @github-trending.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 topoteretes / cognee ⭐ 28,581 (+303) 🗒 Python Cognee is the …”Bluesky · Jul 20, 2026 · 5 likes
The biggest 5 of 70 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 70
Talked about on GitHub, Bluesky and Hacker News (70 times).
On GitHub · 50
- Apr 10, 2026[Add App]Cognee — beclab/apps2 reactions
- Nov 15, 2025[Request] Implement Long-term Cross-session Memory through Cognee Integration — lobehub/lobehub2 reactions · 6 comments
- Jun 28, 2026Epic: Cross-project knowledge storage — queryable KB over the board — joelfuller2016/KanbanFlow-v21 reaction · 4 comments
- Nov 20, 2026[spike] Cognee GitHub ingestion vs file memory, Phase 0 measurement only — anchapin/plan-coder0 reactions · 1 comment
- Nov 16, 2026مرشحون جدد للدليل (2026-11-16) — mgrd281/Skill-0 reactions
45 more on GitHub
- Nov 3, 2026feat(connector): add Gitee data-source connector (cognee#6364) — topoteretes/cognee-community0 reactions
- Nov 3, 2026feat(connector): add Atlassian Jira project issues and agile tracking data-source connector (cognee#6466) — topoteretes/cognee-community0 reactions
- Nov 3, 2026feat(connector): add Zendesk support tickets and conversations data-source connector (cognee#6465) — topoteretes/cognee-community0 reactions
- Nov 3, 2026feat(connector): add Trello boards, lists, and cards data-source connector (cognee#6471) — topoteretes/cognee-community0 reactions
- Nov 3, 2026feat(connector): add AtCoder competitive programming data-source connector (cognee#6406) — topoteretes/cognee-community0 reactions
- Nov 3, 2026chore(deps): bump cognee from 0.4.1 to 1.5.0 in /ai-memory-hackathon-2026-02-07 — topoteretes/cognee-hackathons0 reactions
- Oct 30, 2026Bump the pip group across 2 directories with 2 updates — MendyData/agents-towards-production0 reactions
- Oct 29, 2026memory-lab: Cognee — развернуть на PVE и проверить — TeaShaman-cyber/theseus-local-lab0 reactions · 38 comments
- Oct 28, 2026feat(connector): add Trivy security vulnerability and misconfiguration connector — topoteretes/cognee-community0 reactions
- Oct 28, 2026feat(connector): add Traefik reverse proxy routing and middleware topology connector — topoteretes/cognee-community0 reactions
- Oct 26, 2026chore(deps-dev): bump cognee from 1.1.2 to 1.6.5 — TSchonleber/brainctl0 reactions
- Oct 26, 2026feat(connector): add Habitica gamified habits and task management connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add lemlist outreach and campaigns REST connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add Jotform form builder and submissions REST connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add npm package registry public REST API connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 25, 2026feat(connector): add WooCommerce store catalog and orders connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add Hardcover books and reading journals GraphQL connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add Bitrix24 CRM inbound webhook connector — topoteretes/cognee-community0 reactions
- Oct 25, 2026feat(connector): add BigCommerce catalog and orders connector — topoteretes/cognee-community0 reactions
- Oct 23, 2026MEMSYNC — Umbrella: governed synchronization of persistent memories across Cogentia agents — JeanHuguesRobert/cogentia0 reactions
- Oct 22, 2026Memoria que el agente escribe durante la sesión — e2its/myrmion-graphrag0 reactions
- Oct 22, 2026Olvidar y borrar como herramienta — e2its/myrmion-graphrag0 reactions
- Oct 20, 2026fix(storage): explain embedding mismatch recovery — volcengine/OpenViking0 reactions
- Oct 15, 2026[P0][Comparator][Cognee] Execute first local-model external same-harness comparison — MythologIQ-Labs-LLC/agent-memory0 reactions · 3 comments
- Oct 14, 2026feat: add Read.ai connector with OAuth and scoped sync — topoteretes/cognee-community0 reactions
- Oct 13, 2026[Benchmark][Comparators] Expand real same-harness market cohort beyond Mem0, with per-profile peer coverage — MythologIQ-Labs-LLC/agent-memorysays it tested it0 reactions · 9 comments
- Oct 9, 2026feat(linear): implement linear integration - #4699 — topoteretes/cognee-community0 reactions
- Oct 9, 2026feat(connector): add Airtable data-source connector — topoteretes/cognee-community0 reactions
- Oct 8, 2026feat(connector): add Snowflake data-source connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 8, 2026feat(connector): add Databricks workspace data connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 8, 2026feat(connector): add Outline Knowledge Base data-source connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 8, 2026feat(connector): add Appwrite data-source connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 8, 2026feat(connector): add Ghost CMS data-source connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 5, 2026feat(connector): add tl;dv meeting data-source connector — topoteretes/cognee-community0 reactions · 1 comment
- Oct 5, 2026feat(connector): add LogRocket MCP data source — topoteretes/cognee-community0 reactions · 1 comment
- Oct 3, 2026Bump the pip group across 2 directories with 2 updates — herominutes/agents-towards-production0 reactions
- Sep 27, 2026[assessment] Competitor assessment 3×7: KIP, mem0, ruflo, MemPalace, [redacted vendor], cognee, agentmemory, [redacted vendor] Agent Memory, Haystack vs ai-memory release/v1.0.0 (level, value, licensing) — alphaonedev/ai-memory-mcp0 reactions · 11 comments
- Sep 24, 2026Reality probe: Cognee #5161 passes local prune tests but the end-to-end claim is contradicted — hippoley/CounterProof0 reactions
- Sep 20, 2026Freshness: cognee v1.5.4 -> v1.6.5 — thoroc/context-radar0 reactions
- Sep 17, 2026📈 AI 开源趋势日报 2026-09-17 — 96loveslife/big_model_radar0 reactions
- Sep 15, 2026[GHSA-fcch-9ph8-q3p4] Cognee thru v0.4.0 contains a critical remote code... — github/advisory-database0 reactions
- Sep 4, 2026Bump cognee from 1.0.9 to 1.5.0 in /testbed/dmas/memory — rustic-ai/dmas-memory0 reactions
- Sep 3, 2026chore(deps): bump cognee from 1.1.0 to 1.5.0 in /cognee-mcp — monk-io/cognee0 reactions
- Sep 3, 2026chore(deps): bump the pip group across 2 directories with 1 update — CorInfinitum/cognee0 reactions
- Sep 3, 2026chore(deps): bump cognee from 0.2.0 to 1.5.0 in /evals/src — AhindraD/cognee0 reactions
On Bluesky · 15
- Jun 9, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 topoteretes / cognee ⭐ 4,853 (+414) 🗒 Python Memory for AI Agents in 5 lines of code — @github-trending.bsky.social7 likes and reposts
- Jul 20, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 topoteretes / cognee ⭐ 28,581 (+303) 🗒 Python Cognee is the open-source AI memory platform for… — @github-trending.bsky.social5 likes and reposts · 1 reply
- Mar 15, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 topoteretes / cognee ⭐ 13,644 (+168) 🗒 Python Knowledge Engine for AI Agent Memory in 6 lines of code — @github-trending.bsky.social5 likes and reposts
- Jun 3, 2025Explore the research: arxiv.org/abs/2505.24478 Our GitHub: github.com/topoteretes/... — @vasilijee.bsky.social3 likes and reposts
- Jan 17, 2025What will you build with cognee? Try it out: github.com/topoteretes/... — @vasilijee.bsky.social2 likes and reposts · 1 reply
10 more on Bluesky
- Jan 16, 2025Check it out and let us know what you’ll build 🛠️ github.com/topoteretes/... github.com/milvus-io/mi... @cognee.bsky.social… — @vasilijee.bsky.social2 likes and reposts
- Jul 20, 2026今日のGitHubトレンド topoteretes/cognee CogneeはAIエージェントにセッションをまたいだ永続的な長期記憶を提供するためのオープンソースAIメモリプラットフォームです。… — @dailygithubtrends.bsky.social1 likes and repost
- Jun 27, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 topoteretes / cognee ⭐ 23,567 (+729) 🗒 Python Cognee is the open-source AI memory platform for… — @github-trending.bsky.social1 likes and repost · 1 reply
- Jun 15, 2026Cognee transforma datos no estructurados en un grafo de conocimiento persistente. plugins para OpenClaw, Claude Code y Hermes Agent.… — @samuel-ferrero.bsky.social1 likes and repost
- Apr 16, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 topoteretes / cognee ⭐ 15,589 (+156) 🗒 Python Knowledge Engine for AI Agent Memory in 6 lines of code — @github-trending.bsky.social1 likes and repost
- Jun 19, 2025cognee Memory for AI Agents in 5 lines of code. https://github.com/topoteretes/cognee — @pythonhub.dev1 likes and repost · 1 reply
- Jun 8, 2025今日のGitHubトレンド topoteretes/cognee このリポジトリは、AIエージェント向けの動的なメモリ機能を提供することを目的に作成されました。 従来のRAG(Retrieval Augmented… — @dailygithubtrends.bsky.social1 likes and repost
- Jun 6, 2025今日のGitHubトレンド topoteretes/cognee このリポジトリは、AIエージェントにメモリ機能を持たせるためのライブラリです。… — @dailygithubtrends.bsky.social1 likes and repost
- Jan 21, 2025and try @cognee.bsky.social with LanceDB in our repo: github.com/topoteretes/... — @vasilijee.bsky.social1 likes and repost
- Jun 21, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 topoteretes / cognee ⭐ 18,410 (+361) 🗒 Python Cognee is the open-source AI memory platform for… — @github-trending.bsky.social0 likes and reposts · 1 reply
On Hacker News · 5
- Jun 3, 2025Show HN: Cognee – Open-Source AI Memory Layer That Remembers Context9 points · 2 comments
- Apr 22, 2024Show HN: Auto-optimizing deterministic LLM outputs using knowledge graphs7 points
- Feb 13, 2025Show HN: Cognee – Turn RAG and GraphRAG into custom dynamic semantic memory6 points · 1 comment
- Jan 13, 2025Cognee: Reliable LLM Memory for AI Applications and AI Agents2 points
- Feb 6, 2026Memory for AI agents in 6 lines of code1 point
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cognee-cliSkill
- cognee-communitySkill
- cognee-custom-graph-modelsSkill
- cognee-custom-pipelinesSkill
- cognee-dockerSkill
- cognee-improve-sessionsSkill
- cognee-ingestionSkill
- cognee-installSkill
- cognee-integrationsSkill
- cognee-migrationsSkill
- cognee-performanceSkill
- cognee-permissionsSkill
- cognee-recallSkill
- cognee-serverSkill
- cogneeSkill
The file
Files
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
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
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}/rawreturns the stored file (404 if it is gone). - SDK: there is no "get raw" helper; open the stored location:
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
| Goal | Call | What remains |
| One document | forget(data_id=..., dataset_id=...) (or dataset="name") | Nothing of that document; shared entities stay while another document still references them |
| A whole dataset | forget(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 later | forget(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 only | forget(dataset="name", data_id=..., memory_only=True) | That document's raw file and row |
| Every dataset the user can delete | forget(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.
Pitfalls
- A
data_idthat 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 fromlist_datafor that same dataset, and check it is still listed afterwards if it matters. - Pass either
datasetordataset_id, not both (ValueError).data_idandmemory_onlyboth need a dataset. memory_onlyis ignored wheneverything=Truein the SDK (the CLI rejects the combination).everything=Truealways 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 thedeletepermission on the dataset (see thecognee-permissionsskill).everything=Truedeletes every dataset the user hasdeletepermission 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; useforget().
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 theDatarow. 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 hasdeleteon 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 incognee/tests/unit/api/v1/forget/(argument validation, the HTTP endpoint,memory_only); cover both the document and thememory_onlypaths for new deletion behaviour.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

