{"record":{"id":"78d1c80b999b251c","repo":"mem0ai/mem0","slug":"at-least-one-of-text-metadata-or-expiration-date","errorCode":null,"errorMessage":"At least one of text, metadata, or expiration_date must be provided.","messagePattern":"At least one of text, metadata, or expiration_date must be provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":1854,"sourceCode":"        Returns:\n            dict: Success message indicating the memory was updated.\n\n        Example:\n            >>> m.update(memory_id=\"mem_123\", text=\"Likes to play tennis on weekends\")\n            {'message': 'Memory updated successfully!'}\n        \"\"\"\n        capture_event(\"mem0.update\", self, {\"memory_id\": memory_id, \"sync_type\": \"sync\"})\n\n        if data is not None:\n            logger.warning(\n                \"The `data` argument to update() is deprecated and will be removed in the \"\n                \"next major release. Use `text` instead.\"\n            )\n            if text is None:\n                text = data\n\n        if text is None and metadata is None and expiration_date is _UNSET:\n            raise ValueError(\"At least one of text, metadata, or expiration_date must be provided.\")\n\n        update_metadata = deepcopy(metadata) if metadata is not None else None\n        if expiration_date is not _UNSET:\n            update_metadata = update_metadata or {}\n            update_metadata[\"expiration_date\"] = _normalize_expiration_date(expiration_date)\n\n        existing_embeddings = {}\n        if text is not None:\n            existing_embeddings[text] = self.embedding_model.embed(text, \"update\")\n\n        self._update_memory(memory_id, text, existing_embeddings, update_metadata)\n        display_first_run_notice(self, \"sync\", \"update\")\n        return {\"message\": \"Memory updated successfully!\"}\n\n    def delete(self, memory_id):\n        \"\"\"\n        Delete a memory by ID.\n","sourceCodeStart":1836,"sourceCodeEnd":1872,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L1836-L1872","documentation":"Error \"At least one of text, metadata, or expiration_date must be provided.\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/memory/main.py:1854 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one of text, metadata, or expiration_date in the update() call."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}