MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / batch_update

Method batch_update

methods/mem0/client/main.py:385–403  ·  view source on GitHub ↗

Batch update memories. Args: memories: List of memory dictionaries to update. Each dictionary must contain: - memory_id (str): ID of the memory to update - text (str): New text content for the memory Returns: str: Message indi

(self, memories: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

383
384 @api_error_handler
385 def batch_update(self, memories: List[Dict[str, Any]]) -> Dict[str, Any]:
386 """Batch update memories.
387
388 Args:
389 memories: List of memory dictionaries to update. Each dictionary must contain:
390 - memory_id (str): ID of the memory to update
391 - text (str): New text content for the memory
392
393 Returns:
394 str: Message indicating the success of the batch update.
395
396 Raises:
397 APIError: If the API request fails.
398 """
399 response = self.client.put("/v1/batch/", json={"memories": memories})
400 response.raise_for_status()
401
402 capture_client_event("client.batch_update", self)
403 return response.json()
404
405 @api_error_handler
406 def batch_delete(self, memories: List[Dict[str, Any]]) -> Dict[str, Any]:

Callers

nothing calls this directly

Calls 3

capture_client_eventFunction · 0.90
putMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected