mem0ai/mem0 · error · ValueError
Unsupported filter operator: {op}
Error message
Unsupported filter operator: {op} What it means
Error "Unsupported filter operator: {op}" thrown in mem0ai/mem0.
Source
Thrown at mem0/vector_stores/pgvector.py:89
not_groups = []
for not_filter in value:
sub_conds, sub_params = _build_filter_conditions(not_filter)
if sub_conds:
not_groups.append("(" + " AND ".join(sub_conds) + ")")
params.extend(sub_params)
if not_groups:
conditions.append("NOT (" + " OR ".join(not_groups) + ")")
continue
if value == "*":
conditions.append("payload ? %s")
params.append(key)
continue
if isinstance(value, dict):
for op, op_value in value.items():
if op not in OPERATOR_SQL_MAP:
raise ValueError(f"Unsupported filter operator: {op}")
template, is_numeric = OPERATOR_SQL_MAP[op]
if op in ("in", "nin"):
if not isinstance(op_value, list):
raise ValueError(
f"Filter operator {op!r} for key {key!r} requires a list value, got {type(op_value).__name__}"
)
str_list = [str(v) for v in op_value]
conditions.append(template)
params.extend([key, str_list])
elif op in ("contains", "icontains"):
escaped = str(op_value).replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_")
conditions.append(template + " ESCAPE '\\'")
params.extend([key, f"%{escaped}%"])
else:
conditions.append(template)
if is_numeric:
params.extend([key, float(op_value)])
else:View on GitHub (pinned to 001c235229)
Solutions
- Use a supported PGVector filter operator (eq, ne, gt, gte, lt, lte, in, nin, contains, icontains).
When it happens
Trigger: Thrown at mem0/vector_stores/pgvector.py:89 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/bc4d076531c57cb0.
Report an issue: GitHub.