mem0ai/mem0 · error · Error
Unsupported S3 Vectors filter operator: ${operator}
Error message
Unsupported S3 Vectors filter operator: ${operator} What it means
While converting a metadata filter object to the S3 Vectors format, the store encountered an operator key it does not know at all (not eq, ne, gt, gte, lt, lte, in, nin, contains/icontains/startsWith, which have their own dedicated error). This is a fail-fast guard against typos and unsupported filter shapes so that filters are never silently dropped.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/s3_vectors.ts:640
if (!Array.isArray(operand) || operand.length === 0) {
return { [ALWAYS_FALSE_FILTER_KEY]: true };
}
operators.$in = operand;
break;
case "nin":
if (!Array.isArray(operand) || operand.length === 0) {
break;
}
operators.$nin = operand;
break;
case "contains":
case "icontains":
case "startsWith":
throw new Error(
`S3 Vectors does not support '${operator}' metadata filters.`,
);
default:
throw new Error(
`Unsupported S3 Vectors filter operator: ${operator}`,
);
}
}
if (Object.keys(operators).length === 0) {
return {};
}
return { [key]: operators };
}
private negateFilter(filter: S3Filter): S3Filter {
if (Array.isArray(filter.$and)) {
return {
$or: filter.$and.map((entry: S3Filter) => this.negateFilter(entry)),
};
}
View on GitHub (pinned to 001c235229)
Solutions
- Check the operator key in your filter and correct it to a supported one: eq, ne, gt, gte, lt, lte, in, nin.
- Strip the dollar prefix if you copied Mongo-style filters ($gt -> gt, $in -> in).
- Validate filter keys against the supported set before calling search (see defense strategy).
Example fix
// before
await memory.search("q", { filters: { ts: { $gte: 100 } } }); // Mongo-style keys
// after
await memory.search("q", { filters: { ts: { gte: 100 } } }); Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = new Set(["eq","ne","gt","gte","lt","lte","in","nin"]);
function validateFilterOperators(filters: any): string[] {
const bad: string[] = [];
const walk = (f: any) => {
for (const [k, v] of Object.entries(f ?? {})) {
if (["AND","OR","NOT"].includes(k)) { (v as any[]).forEach(walk); continue; }
if (v && typeof v === "object" && !Array.isArray(v))
for (const op of Object.keys(v)) if (!SUPPORTED.has(op)) bad.push(op);
}
};
walk(filters); return bad;
}
const bad = validateFilterOperators(filters); if (bad.length) throw new Error(`Unknown operators: ${bad.join(', ')}`); Type guard
type S3Operator = 'eq'|'ne'|'gt'|'gte'|'lt'|'lte'|'in'|'nin'; const isS3Operator = (op: string): op is S3Operator => new Set(['eq','ne','gt','gte','lt','lte','in','nin']).has(op);
Try / catch
try { await memory.search(q, { filters }); } catch (e) { if (e instanceof Error && e.message.startsWith('Unsupported S3 Vectors filter operator')) { /* log filter keys, fix typo */ } else throw e; } Prevention
- Never copy Mongo $-style operators into mem0 filters
- Centralize filter construction in one validated helper
- Type filter objects against a literal union of operators
When it happens
Trigger: Passing a filter operator like { endsWith: "x" }, { regex: "..." }, { size: 5 }, or a typo like { gteq: 10 } in filters for an S3 Vectors-backed Memory instance. Any operator key outside the recognized set hits the default case and throws.
Common situations: Typos in operator names; filters written for a different backend (Mongo-style $gt with dollar prefix, Pinecone-style $in) passed to S3 Vectors; new operators added to shared filter code without per-store support.
Related errors
- Top-level entity parameters [${invalidKeys.join(", ")}] are
- Invalid ${name}: cannot be empty or whitespace-only. Provide
- Invalid ${name}: cannot contain whitespace. Provide a valid
- AND filter value must be a list of filter dicts, got ${typeo
- OR filter value must be a list of filter dicts, got ${typeof
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/39a5d11ea6078066.
Report an issue: GitHub.