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

FieldTypeDescription
idstringDeleted node’s ID
statusstringAlways "deleted" on success
deleted_atstringDeletion timestamp
edges_deletednumberCount of edges deleted (when cascade=true)
hyperedges_affectednumberCount of hyperedges this node was removed from

Errors

CodeDescription
INVALID_PARAMETERMissing node_id
NODE_NOT_FOUNDNode doesn’t exist
GRAPH_NOT_FOUNDSpecified 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 nodes array
  • Orphaned edges may cause issues — use cascade: true for clean deletion

cascade: true

  • Node is deleted
  • All binary edges connected to this node are deleted
  • Hyperedges have this node removed from their nodes array
  • 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 nodesResult
3+ nodesHyperedge continues with reduced membership
2 nodesHyperedge converts to binary edge
1 nodeHyperedge is deleted

Permanent deletion — There is no undo. For recoverable deletion, consider adding metadata like status: "archived" instead.

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.