cognee-forget 是什么?
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.
以上为来源原文,中文用途说明尚待整理。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
cognee-forget,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。
展开并复制给 Codex 的安装指令
安装并检查 cognee-forget
请在 Codex 的当前工作环境中安装并检查 cognee-forget 这个 Skill。
项目身份:topoteretes/cognee / cognee-forget
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-forget/SKILL.md
已定位的源文件:.agents/skills/cognee-forget/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 cognee-forget
请在 Claude Code 的当前工作环境中安装并检查 cognee-forget 这个 Skill。
项目身份:topoteretes/cognee / cognee-forget
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-forget/SKILL.md
已定位的源文件:.agents/skills/cognee-forget/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 cognee-forget
请在 Cursor Agent 的当前工作环境中安装并检查 cognee-forget 这个 Skill。
项目身份:topoteretes/cognee / cognee-forget
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-forget/SKILL.md
已定位的源文件:.agents/skills/cognee-forget/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 cognee-forget
请在 当前 Agent 的当前工作环境中安装并检查 cognee-forget 这个 Skill。
项目身份:topoteretes/cognee / cognee-forget
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-forget/SKILL.md
已定位的源文件:.agents/skills/cognee-forget/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-23T04:29:48.865Z
- 中文使用说明
- 尚待整理,保留英文来源内容
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料
.agents/skills/cognee-forget/SKILL.md · 抓取时间 2026-11-23T04:29:48.865Z
以下保留源文件的 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.
查看源文件章节 / Source sections
- 原文:Remove data with forget()
- 原文:Use it
- 原文:1. Find the dataset
- 原文:2. List its documents
- 原文:3. Read the content before deciding
- 原文:4. Delete
- 原文:Pitfalls
- 原文:How it works
- 原文:Extending it
原文: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.
原文: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
| 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. A search finds nothing afterwards, but the data is not deleted | | One document's memory only | `forget(dataset="name", data_id=..., memory_only=True)` | That document's raw file and row | | One document and your own search history | `forget(data_id=..., dataset_id=..., clean_history=True)` | Nothing of that document; the caller's recorded questions and answers are gone in every dataset, other users' stay | | Only your own search history | `forget(clean_history=True)` | All data; only the caller's recorded questions and answers are deleted | | 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) |
本段为节选,完整内容见源文件。
原文: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. - **An empty search after `memory_only` is not deletion.** The raw file and the data row are still there and the next cognify re-processes them. Use a plain `forget(dataset=...)` or `forget(data_id=...)` to remove the data. - **Deleted bytes can outlive the delete inside the storage engines.** Every mode removes the records and the memory it names; it does not scrub the engines' files. LanceDB keeps deleted rows in its append-only fragments until compaction rewrites them, and it rewrites a fragment only once enough of it is deleted, so a small delete in a large table can stay on disk indefinitely. The embedded graph file has no user-facing compaction. For a byte-level erasure guarantee run the engine's own compaction or vacuum, or start a new store. - **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()`.
文件 SHA256:ea46a4168f1931e69f50ade4122a1badca3444c6fad000681905d9762435f871
仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。
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.
历史收录数据
| 来源仓库 | topoteretes/cognee |
|---|---|
| Skill源路径 | .agents/skills/cognee-forget/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
