Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

Add support for batch update/delete (#2064)

Dev Khant847e1cc986b0
diff --git a/mem0/client/main.py b/mem0/client/main.py
index aa485da19..2775dc64d 100644
--- a/mem0/client/main.py
+++ b/mem0/client/main.py
@@ -317,6 +317,28 @@ class MemoryClient:
capture_client_event("client.reset", self)
return {"message": "Client reset successful. All users and memories deleted."}
+ @api_error_handler
+ def batch_update(self, memories: List[Dict[str, Any]]) -> Dict[str, Any]:
+ """Batch update memories."""
+ response = self.client.put("/v1/batch/", json={"memories": memories})
+ response.raise_for_status()
+
+ capture_client_event("client.batch_update", self)
+ return response.json()
+
+ @api_error_handler
+ def batch_delete(self, memories: List[Dict[str, Any]]) -> Dict[str, Any]:
+ """Batch delete memories."""
+ response = self.client.request(
+ "DELETE",
+ "/v1/batch/",
+ json={"memories": memories}
+ )
+ response.raise_for_status()
+
+ capture_client_event("client.batch_delete", self)
+ return response.json()
+
def chat(self):
"""Start a chat with the Mem0 AI. (Not implemented)
diff --git a/pyproject.toml b/pyproject.toml
index 93d2dd90d..283bd0ae2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mem0ai"
-version = "0.1.33"
+version = "0.1.34"
description = "Long-term memory for AI Agents"
authors = ["Mem0 <[email protected]>"]
exclude = [