mem0ai/mem0 · error · ValueError

feedback must be one of {', '.join(VALID_FEEDBACK_VALUES)} o

Error message

feedback must be one of {', '.join(VALID_FEEDBACK_VALUES)} or None

What it means

Error "feedback must be one of {', '.join(VALID_FEEDBACK_VALUES)} or None" thrown in mem0ai/mem0.

Source

Thrown at mem0/client/main.py:930

        capture_client_event(
            "client.delete_webhook",
            self,
            {"webhook_id": webhook_id, "sync_type": "sync"},
        )
        return response.json()

    @api_error_handler
    def feedback(
        self,
        memory_id: str,
        feedback: Optional[str] = None,
        feedback_reason: Optional[str] = None,
    ) -> Dict[str, str]:
        VALID_FEEDBACK_VALUES = {"POSITIVE", "NEGATIVE", "VERY_NEGATIVE"}

        feedback = feedback.upper() if feedback else None
        if feedback is not None and feedback not in VALID_FEEDBACK_VALUES:
            raise ValueError(f"feedback must be one of {', '.join(VALID_FEEDBACK_VALUES)} or None")

        data = {
            "memory_id": memory_id,
            "feedback": feedback,
            "feedback_reason": feedback_reason,
        }

        response = self.client.post("/v1/feedback/", json=data)
        response.raise_for_status()
        capture_client_event("client.feedback", self, {**data, "sync_type": "sync"})
        return response.json()

    def _prepare_payload(self, messages: List[Dict[str, str]], kwargs: Dict[str, Any]) -> Dict[str, Any]:
        """Prepare the payload for API requests.

        Args:
            messages: The messages to include in the payload.
            kwargs: Additional keyword arguments to include in the payload.

View on GitHub (pinned to 001c235229)

Solutions

  1. Pass feedback as one of the VALID_FEEDBACK_VALUES (POSITIVE/NEGATIVE/VERY_NEGATIVE) or None.

When it happens

Trigger: Thrown at mem0/client/main.py:930 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/b1f620c436e7a3d1. Report an issue: GitHub.