fix: reset graph database in Memory.reset() (#4185)

Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
This commit is contained in:
Br1an
2026-03-30 18:45:38 +05:30
committed by GitHub
co-authored by kartik-mem0
parent 97291aa119
commit 7213e1b1a6
2 changed files with 89 additions and 0 deletions
+12
View File
@@ -1371,6 +1371,12 @@ class Memory(MemoryBase):
)
capture_event("mem0.reset", self, {"sync_type": "sync"})
if self.enable_graph:
try:
self.graph.reset()
except Exception:
logger.warning("Failed to reset graph store, continuing with reset")
def chat(self, query):
raise NotImplementedError("Chat function not implemented yet.")
@@ -2527,5 +2533,11 @@ class AsyncMemory(MemoryBase):
)
capture_event("mem0.reset", self, {"sync_type": "async"})
if self.enable_graph:
try:
await asyncio.to_thread(self.graph.reset)
except Exception:
logger.warning("Failed to reset graph store, continuing with reset")
async def chat(self, query):
raise NotImplementedError("Chat function not implemented yet.")