MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / delete_node

Method delete_node

LightRAG/lightrag/storage.py:282–292  ·  view source on GitHub ↗

Delete a node from the graph based on the specified node_id. :param node_id: The node_id to delete

(self, node_id: str)

Source from the content-addressed store, hash-verified

280 self._graph.add_edge(source_node_id, target_node_id, **edge_data)
281
282 async def delete_node(self, node_id: str):
283 """
284 Delete a node from the graph based on the specified node_id.
285
286 :param node_id: The node_id to delete
287 """
288 if self._graph.has_node(node_id):
289 self._graph.remove_node(node_id)
290 logger.info(f"Node {node_id} deleted from the graph.")
291 else:
292 logger.warning(f"Node {node_id} not found in the graph for deletion.")
293
294 async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]:
295 if algorithm not in self._node_embed_algorithms:

Callers

nothing calls this directly

Calls 1

has_nodeMethod · 0.45

Tested by

no test coverage detected