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

Method add

methods/mem0/client/main.py:717–725  ·  view source on GitHub ↗
(self, messages: Union[str, List[Dict[str, str]]], **kwargs)

Source from the content-addressed store, hash-verified

715
716 @api_error_handler
717 async def add(self, messages: Union[str, List[Dict[str, str]]], **kwargs) -> Dict[str, Any]:
718 kwargs = self.sync_client._prepare_params(kwargs)
719 payload = self.sync_client._prepare_payload(messages, kwargs)
720 response = await self.async_client.post("/v1/memories/", json=payload)
721 response.raise_for_status()
722 if "metadata" in kwargs:
723 del kwargs["metadata"]
724 capture_client_event("async_client.add", self.sync_client, {"keys": list(kwargs.keys())})
725 return response.json()
726
727 @api_error_handler
728 async def get(self, memory_id: str) -> Dict[str, Any]:

Callers

nothing calls this directly

Calls 7

capture_client_eventFunction · 0.90
_prepare_paramsMethod · 0.80
_prepare_payloadMethod · 0.80
postMethod · 0.80
listFunction · 0.50
keysMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected