diff --git a/cognee/infrastructure/databases/graph/networkx/adapter.py b/cognee/infrastructure/databases/graph/networkx/adapter.py index 19bd50051..5fe97e94a 100644 --- a/cognee/infrastructure/databases/graph/networkx/adapter.py +++ b/cognee/infrastructure/databases/graph/networkx/adapter.py @@ -267,14 +267,6 @@ class NetworkXAdapter(GraphDBInterface): await self.save_graph_to_file(file_path) except Exception: logger.error("Failed to load graph from file: %s", file_path) - # Initialize an empty graph in case of error - self.graph = nx.MultiDiGraph() - - file_dir = os.path.dirname(file_path) - if not os.path.exists(file_dir): - os.makedirs(file_dir, exist_ok = True) - - await self.save_graph_to_file(file_path) async def delete_graph(self, file_path: str = None): """Asynchronously delete the graph file from the filesystem."""