mem0ai/mem0 · error · ValueError

Either memory_id or --all is required

Error message

Either memory_id or --all is required

What it means

Error "Either memory_id or --all is required" thrown in mem0ai/mem0.

Source

Thrown at cli/python/src/mem0_cli/backend/platform.py:337

                params["user_id"] = user_id
            if agent_id:
                params["agent_id"] = agent_id
            if app_id:
                params["app_id"] = app_id
            if run_id:
                params["run_id"] = run_id
            return self._request("DELETE", "/v1/memories/", params=params)
        elif memory_id:
            params = {"source": "CLI"}
            if delete_linked:
                params["delete_linked"] = "true"
            return self._request(
                "DELETE",
                f"/v1/memories/{_encode_path_segment(memory_id)}/",
                params=params,
            )
        else:
            raise ValueError("Either memory_id or --all is required")

    def delete_entities(
        self,
        *,
        user_id: str | None = None,
        agent_id: str | None = None,
        app_id: str | None = None,
        run_id: str | None = None,
    ) -> dict:
        # v2 endpoint: DELETE /v2/entities/{entity_type}/{entity_id}/
        type_map = {
            "user": user_id,
            "agent": agent_id,
            "app": app_id,
            "run": run_id,
        }
        entities = {t: v for t, v in type_map.items() if v}
        if not entities:

View on GitHub (pinned to 001c235229)

Solutions

  1. Pass a specific memory_id to the command, or add --all to target every memory.

When it happens

Trigger: Thrown at cli/python/src/mem0_cli/backend/platform.py:337 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/0492476cd234d1f7. Report an issue: GitHub.