MCPcopy Create free account
hub / github.com/InternScience/InternAgent / _save_graph

Method _save_graph

internagent/mas/memory/long_memory.py:354–361  ·  view source on GitHub ↗

Save the graph to disk.

(self)

Source from the content-addressed store, hash-verified

352 return clusters
353
354 def _save_graph(self) -> None:
355 """Save the graph to disk."""
356 try:
357 with open(self._graph_save_path, "wb") as f:
358 pickle.dump(self.graph, f)
359 logger.debug(f"Graph saved to {self._graph_save_path}")
360 except Exception as e:
361 logger.error(f"Failed to save graph: {e}")
362
363 def __iter__(self) -> Iterable[Tuple[str, int]]:
364 """Iterate over nodes and their cluster IDs."""

Callers 2

add_idea_nodeMethod · 0.95
cluster_ideasMethod · 0.95

Calls 1

dumpMethod · 0.45

Tested by

no test coverage detected