mem0ai/mem0 · error · Error

Neptune Analytics vector search does not support property-ex

Error message

Neptune Analytics vector search does not support property-existence filters.

What it means

Some Mem0 vector stores interpret value '*' as 'field exists / match any'. Neptune Analytics vector search has no property-existence predicate, so buildFieldVertexFilter() rejects '*' outright instead of silently returning wrong results. This is a documented capability gap, not a malformed input per se.

Source

Thrown at mem0-ts/src/oss/src/vector_stores/neptune_analytics.ts:548

    joiner: "andAll" | "orAll",
    operations: NeptuneVertexFilter[],
  ): NeptuneVertexFilter | undefined {
    if (operations.length === 0) {
      return undefined;
    }

    if (operations.length === 1) {
      return operations[0];
    }

    return {
      [joiner]: operations,
    };
  }

  private buildFieldVertexFilter(key: string, value: any): NeptuneVertexFilter {
    if (value === "*") {
      throw new Error(
        "Neptune Analytics vector search does not support property-existence filters.",
      );
    }

    if (Array.isArray(value)) {
      return {
        in: {
          property: key,
          value,
        },
      };
    }

    if (typeof value !== "object" || value === null) {
      return {
        equals: {
          property: key,
          value,

View on GitHub (pinned to 001c235229)

Solutions

  1. Omit the field entirely instead of passing '*': build filters with undefined values removed.
  2. If existence semantics are required, use a different vector store provider that supports it.
  3. Strip '*' entries before calling search on Neptune: delete keys whose value === '*'.

Example fix

// before
store.search(q, 5, { user_id: '*' }); // throws

// after
const filters = { user_id: '*' };
for (const [k, v] of Object.entries(filters)) if (v === '*') delete filters[k];
store.search(q, 5, Object.keys(filters).length ? filters : undefined);
Defensive patterns

Strategy: validation

Validate before calling

function stripWildcards(filters: Record<string, any>) {
  const out: Record<string, any> = {};
  for (const [k, v] of Object.entries(filters)) if (v !== '*') out[k] = v;
  return Object.keys(out).length ? out : undefined;
}

Type guard

const hasNoWildcard = (f: Record<string, unknown>): boolean =>
  Object.values(f).every((v) => v !== '*');

Try / catch

try { await store.search(q, 5, filters); }
catch (e) {
  if (e instanceof Error && e.message.includes('property-existence filters')) {
    return store.search(q, 5, stripWildcards(filters)); // wildcard = no constraint, safe to drop
  }
  throw e;
}

Prevention

When it happens

Trigger: search(q, k, { user_id: '*' }) or { run_id: '*' } on the neptune-analytics provider; generic filter logic that uses '*' as a default/placeholder value for unset fields; code ported from chroma/qdrant/milvus paths where '*' is skipped or treated as match-all.

Common situations: Shared filter builders across providers; user-facing filter APIs where '*' is documented as wildcard; default filter objects populated with '*' to mean 'no constraint'.

Related errors


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/32d5ee1303e87883. Report an issue: GitHub.