{"record":{"id":"4b53e399081d20c5","repo":"mem0ai/mem0","slug":"memory-with-id-memory-id-not-found","errorCode":null,"errorMessage":"Memory with id {memory_id} not found","messagePattern":"Memory with id (.+?) not found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/memory/main.py","lineNumber":1880,"sourceCode":"        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\n        Args:\n            memory_id (str): ID of the memory to delete.\n        \"\"\"\n        capture_event(\"mem0.delete\", self, {\"memory_id\": memory_id, \"sync_type\": \"sync\"})\n\n        existing_memory = self.vector_store.get(vector_id=memory_id)\n        if existing_memory is None:\n            raise ValueError(f\"Memory with id {memory_id} not found\")\n\n        self._delete_memory(memory_id, existing_memory)\n        decay_usage_notice = detect_decay_usage_from_delete()\n        if decay_usage_notice:\n            display_decay_usage_notice(self, \"sync\", \"delete\", *decay_usage_notice)\n        else:\n            display_first_run_notice(self, \"sync\", \"delete\")\n        return {\"message\": \"Memory deleted successfully!\"}\n\n    def delete_all(self, user_id: Optional[str] = None, agent_id: Optional[str] = None, run_id: Optional[str] = None):\n        \"\"\"\n        Delete all memories.\n\n        Args:\n            user_id (str, optional): ID of the user to delete memories for. Defaults to None.\n            agent_id (str, optional): ID of the agent to delete memories for. Defaults to None.\n            run_id (str, optional): ID of the run to delete memories for. Defaults to None.\n        \"\"\"","sourceCodeStart":1862,"sourceCodeEnd":1898,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/memory/main.py#L1862-L1898","documentation":"Error \"Memory with id {memory_id} not found\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0/memory/main.py:1880 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the memory_id exists (use get_all or search to list valid IDs) before updating."],"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"}