mem0ai/mem0 · error · ValueError

At least one of text, metadata, or expiration_date must be p

Error message

At least one of text, metadata, or expiration_date must be provided.

What it means

Error "At least one of text, metadata, or expiration_date must be provided." thrown in mem0ai/mem0.

Source

Thrown at mem0/memory/main.py:1854

        Returns:
            dict: Success message indicating the memory was updated.

        Example:
            >>> m.update(memory_id="mem_123", text="Likes to play tennis on weekends")
            {'message': 'Memory updated successfully!'}
        """
        capture_event("mem0.update", self, {"memory_id": memory_id, "sync_type": "sync"})

        if data is not None:
            logger.warning(
                "The `data` argument to update() is deprecated and will be removed in the "
                "next major release. Use `text` instead."
            )
            if text is None:
                text = data

        if text is None and metadata is None and expiration_date is _UNSET:
            raise ValueError("At least one of text, metadata, or expiration_date must be provided.")

        update_metadata = deepcopy(metadata) if metadata is not None else None
        if expiration_date is not _UNSET:
            update_metadata = update_metadata or {}
            update_metadata["expiration_date"] = _normalize_expiration_date(expiration_date)

        existing_embeddings = {}
        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.

View on GitHub (pinned to 001c235229)

Solutions

  1. Provide at least one of text, metadata, or expiration_date in the update() call.

When it happens

Trigger: Thrown at mem0/memory/main.py:1854 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/78d1c80b999b251c. Report an issue: GitHub.