Recover a deleted node¶
If you deleted a node you still need, you can usually get it back in a couple of clicks. Deleting a node in the portal does not destroy it: Hadron keeps the node until someone hard-deletes it, and a writer on the memory can find it and restore it. This page shows how, in the portal first, then by asking an agent, then with the CLI. You do not need a terminal for the first two.
Two limits to know up front. Only people who can write to the memory can see or restore a deleted node (a reader cannot). And a restore brings back one node with its comment threads: not the nodes under it, and not its edit history.
Who can do this¶
You can list, read and restore deleted nodes in a memory only if you can both read and write it. That is the same write access you need to edit a node.
Everyone else gets the same answer a node that never existed would give. A reader, a public subscriber, an App key, a run, or a session acting on someone else's behalf (impersonating them) does not see deleted nodes and cannot restore them. A refusal does not tell you whether the node exists, so "not found" can mean "no such node" or "not yours to recover".
How long a deleted node is kept¶
A deleted node is kept until a hard delete. Hadron sets no retention period
for soft-deleted nodes, so there is no number of days to count on or to expect.
If someone ran a hard delete (node rm --hard), the node and its revision
history are gone and cannot be restored.
Recover a node in the portal¶
- Open the memory in the portal and go to its Nodes list.
- Turn on Include deleted. Deleted nodes now appear in the Tree and Table views, marked with a Deleted badge. If you are not a writer on the memory, no badges appear and a deleted node opens as "not found".
- Open the deleted node. The page is marked Deleted and shows the node's URN, when it was deleted, and its saved content, read-only.
- Select Restore node.
On success you land on the live node page. If Hadron refuses, the reason is shown on the page exactly as the server gave it, and the node stays deleted. The most common reason is covered in When a restore is refused.
You can also reach a deleted node from another node's edges: when a node linked to a deleted one, that edge shows the deleted node's name with a Deleted badge and a link to its restore page.
Recover a node by asking your agent¶
If your agent is connected to Hadron with your account, you can ask it in plain words, for example:
List the deleted nodes in my "project notes" memory, then restore the one called "Launch checklist".
The agent uses the recovery tools in the MCP tool reference:
hadron_list_recovery_nodes to list what is retained, hadron_get_recovery_node
to read one deleted node's saved content, and hadron_restore_node to restore it.
They act with your access, so the writer-only rule above applies to the
agent too. A connection that runs on an App key, or a run, cannot use them.
For a memory with nothing deleted, the list tool answers with an empty list and a total of zero.
Recover a node with the CLI¶
You need the CLI for this path; the two above do not. The recovery commands are
first shipped in Hadron CLI v0.29.0 (check with hadron --version). If an option below is missing, update the CLI.
List what was deleted from a memory, then restore one node:
hadron node recovery list -m hrn:mem:acme.com:kb
hadron node restore hrn:node:acme.com:kb:findings:flaky-ci
When nothing is deleted, recovery list prints No deleted nodes in <memory>.
To look before you restore, read one deleted node, with its saved content if you
add --content:
Note that node restore sits beside the node recovery group, not inside it.
recovery list shows one page of 20 deleted nodes by default. Use --limit
(1 to 200) and --offset for a page, or --all to read every page. Add --json
to any of them for machine-readable output. hadron node recovery graph lists the
links among live nodes and the deleted nodes you could restore, which tells you
which links a restore would reconnect.
The full command text is in the CLI reference.
What a restore brings back¶
A restore brings back:
- the one node you named, at the same address it had; and
- the comment threads that were removed when that node was deleted.
It does not bring back:
- the node's descendants (the nodes under it);
- revision history; or
- comments that were deleted separately from the node.
To recover a whole branch, restore its nodes one by one, parent first.
Restoring a node that is already live is accepted and changes nothing, so a second restore is safe. While a node is deleted but not hard-deleted, adding a node at its address brings that same node back with the new content: the address and the node stay one.
When a restore is refused¶
Hadron refuses, and leaves the node deleted, when:
- A parent is still deleted. Restore the deleted ancestor first. The message
names it, for example
Restore the deleted ancestor <urn> first.Then restore the child. - The node is governed (a node whose role or rulebook controls who may change it), or is a comment, a compiled boot prompt, or at a protected address. These cannot be restored with this command.
- The node changed while the restore waited. The message is
Node changed while recovery waited; read again and retry.Read the node again (the portal page,hadron node recovery get) and, if it is still deleted, restore it again.
If you are not allowed to see deleted nodes in the memory, the answer is the generic "not found", whatever the cause.
One case is not a refusal. After a hard delete nothing is left to restore: it removes the node for good, and everything under it. If the address now holds a new node, a restore of that address reports the node there as live. It does not bring your old node back.
If an answer is lost¶
The CLI sends one request and does not retry. If the connection drops
before you see the result, check the node with hadron node recovery get or
hadron node get before you run the restore again. Because restoring a live
node is accepted and changes nothing, running it again is safe either way.
Related¶
- Understanding memory: what a memory and its nodes are.
- Adding nodes to a memory: in the portal, adding a node at the address of a deleted node brings that node back with your content.
- Deleting a memory: deleting a whole memory.
- CLI reference: the recovery commands in full.
- MCP tool reference: the recovery tools in full.