mem0ai/mem0 · error · ValueError
At least one entity ID is required for delete_entities.
Error message
At least one entity ID is required for delete_entities.
What it means
Error "At least one entity ID is required for delete_entities." thrown in mem0ai/mem0.
Source
Thrown at cli/python/src/mem0_cli/backend/platform.py:356
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:
raise ValueError("At least one entity ID is required for delete_entities.")
# Delete each provided entity via the v2 path-based endpoint. Key each
# response by entity type so a multi-entity delete (e.g. --user-id and
# --agent-id together) doesn't discard everything but the last result.
results: dict = {}
for entity_type, entity_id in entities.items():
results[entity_type] = self._request(
"DELETE",
f"/v2/entities/{_encode_path_segment(entity_type)}/{_encode_path_segment(entity_id)}/",
params={"source": "CLI"},
)
return results
def ping(self, timeout: float | None = None) -> dict:
"""Call the ping endpoint and return the raw response.
When *timeout* is given it overrides the client-level timeout so that
validation pings can fail fast without blocking the user.
"""View on GitHub (pinned to 001c235229)
Solutions
- Provide at least one entity ID (user, agent, app, or run) to delete_entities.
When it happens
Trigger: Thrown at cli/python/src/mem0_cli/backend/platform.py:356 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/b2352913d060a8db.
Report an issue: GitHub.