mem0ai/mem0 · error · ValueError

Memory with id {memory_id} not found

Error message

Memory with id {memory_id} not found

What it means

Error "Memory with id {memory_id} not found" thrown in mem0ai/mem0.

Source

Thrown at mem0/memory/main.py:1880

        if text is not None:
            existing_embeddings[text] = self.embedding_model.embed(text, "update")

        self._update_memory(memory_id, text, existing_embeddings, update_metadata)
        display_first_run_notice(self, "sync", "update")
        return {"message": "Memory updated successfully!"}

    def delete(self, memory_id):
        """
        Delete a memory by ID.

        Args:
            memory_id (str): ID of the memory to delete.
        """
        capture_event("mem0.delete", self, {"memory_id": memory_id, "sync_type": "sync"})

        existing_memory = self.vector_store.get(vector_id=memory_id)
        if existing_memory is None:
            raise ValueError(f"Memory with id {memory_id} not found")

        self._delete_memory(memory_id, existing_memory)
        decay_usage_notice = detect_decay_usage_from_delete()
        if decay_usage_notice:
            display_decay_usage_notice(self, "sync", "delete", *decay_usage_notice)
        else:
            display_first_run_notice(self, "sync", "delete")
        return {"message": "Memory deleted successfully!"}

    def delete_all(self, user_id: Optional[str] = None, agent_id: Optional[str] = None, run_id: Optional[str] = None):
        """
        Delete all memories.

        Args:
            user_id (str, optional): ID of the user to delete memories for. Defaults to None.
            agent_id (str, optional): ID of the agent to delete memories for. Defaults to None.
            run_id (str, optional): ID of the run to delete memories for. Defaults to None.
        """

View on GitHub (pinned to 001c235229)

Solutions

  1. Verify the memory_id exists (use get_all or search to list valid IDs) before updating.

When it happens

Trigger: Thrown at mem0/memory/main.py:1880 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/4b53e399081d20c5. Report an issue: GitHub.