API Reference
memory_forget
Delete a memory node from the graph
memory_forget
Delete a memory node from the graph. Optionally cascade to delete connected edges.
Parameters
The ID of the node to delete.
If true, also delete all edges and hyperedges connected to this node. Default: false.
Target graph. Defaults to your account’s default graph.
Example request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "memory_forget",
"arguments": {
"node_id": "node_abc123",
"cascade": true
}
}
}
Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "node_abc123",
"status": "deleted",
"deleted_at": "2026-03-15T14:30:00Z",
"edges_deleted": 3,
"hyperedges_affected": 1
}
}
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Deleted node’s ID |
status | string | Always "deleted" on success |
deleted_at | string | Deletion timestamp |
edges_deleted | number | Count of edges deleted (when cascade=true) |
hyperedges_affected | number | Count of hyperedges this node was removed from |
Errors
| Code | Description |
|---|---|
INVALID_PARAMETER | Missing node_id |
NODE_NOT_FOUND | Node doesn’t exist |
GRAPH_NOT_FOUND | Specified graph_id doesn’t exist |
Notes
Free operation — Deletions don’t count against your query limit.
Cascade behavior
cascade: false (default)
- Node is deleted
- Connected binary edges become “orphaned” (point to non-existent node)
- Hyperedges have this node removed from their
nodesarray - Orphaned edges may cause issues — use
cascade: truefor clean deletion
cascade: true
- Node is deleted
- All binary edges connected to this node are deleted
- Hyperedges have this node removed from their
nodesarray - If a hyperedge would have fewer than 3 nodes, it’s converted to a binary edge or deleted
Hyperedge handling
When a node is removed from a hyperedge:
| Remaining nodes | Result |
|---|---|
| 3+ nodes | Hyperedge continues with reduced membership |
| 2 nodes | Hyperedge converts to binary edge |
| 1 node | Hyperedge is deleted |
Batch deletion
To delete multiple nodes, call memory_forget for each:
for node_id in nodes_to_delete:
client.call_tool("memory_forget", {
"node_id": node_id,
"cascade": True
})
Soft delete pattern
Instead of deleting, mark nodes as archived:
# Soft delete
client.call_tool("memory_update", {
"node_id": "node_abc123",
"metadata": {
"status": "archived",
"archived_at": "2026-03-15T14:30:00Z"
}
})
# Exclude archived from queries
client.call_tool("memory_recall", {
"query": "project status",
"metadata_filter": {
"status": {"$ne": "archived"}
}
})
This preserves history and relationships while hiding the node from normal queries.