diff --git a/edges.py b/edges.py index a7769c0..9462f82 100644 --- a/edges.py +++ b/edges.py @@ -30,6 +30,7 @@ class EdgesMixin: strength: float = 0.8, context: Optional[str] = None, description: Optional[str] = None, + skip_commit: bool = False, ) -> str: """Create a relationship between two memories with an edge file. @@ -137,10 +138,11 @@ class EdgesMixin: edge_id, edge_data, f"graph/{EDGES_DIR_NAME}/{edge_filename}" ) - self._git_commit( - f"relate: {from_id[:8]} --{rel_type}--> {to_id[:8]}", - [from_path, to_path, edge_path], - ) + if not skip_commit: + self._git_commit( + f"relate: {from_id[:8]} --{rel_type}--> {to_id[:8]}", + [from_path, to_path, edge_path], + ) return edge_id def edge_get(self, edge_id: str) -> Optional[Dict[str, Any]]: diff --git a/mcp_server.py b/mcp_server.py index 31e918e..2ea9667 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -632,6 +632,7 @@ def _auto_create_edges( rel_type=rel_type, description=desc, strength=strength, + skip_commit=True, # batched — git sync handles persistence ) if edge_id: # Empty string means duplicate