mem0ai/mem0 · error · Error

Neptune Analytics vector store requires graphIdentifier or e

Error message

Neptune Analytics vector store requires graphIdentifier or endpoint.

What it means

The Neptune Analytics provider resolves which graph to query via resolveGraphIdentifier(): it first uses config.graphIdentifier; otherwise it falls back to config.endpoint as a raw graph id. If neither is set there is nothing to address openCypher queries against, so construction fails fast with this error instead of issuing requests to an undefined graph.

Source

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

        },
      );
    } catch (error) {
      console.error(
        "Neptune Analytics: failed to clean up node(s) after a failed insert",
        error,
      );
    }
  }

  private resolveGraphIdentifier(config: NeptuneAnalyticsConfig): string {
    if (config.graphIdentifier) {
      return config.graphIdentifier;
    }

    const rawIdentifier = config.endpoint;

    if (!rawIdentifier) {
      throw new Error(
        "Neptune Analytics vector store requires graphIdentifier or endpoint.",
      );
    }

    if (/^https?:\/\//i.test(rawIdentifier)) {
      throw new Error(
        "Neptune Analytics HTTPS endpoints require graphIdentifier; pass graphIdentifier separately or use neptune-graph://<graph-id>.",
      );
    }

    if (rawIdentifier.startsWith("neptune-graph://")) {
      return rawIdentifier.slice("neptune-graph://".length);
    }

    return rawIdentifier;
  }

  private buildClientConfig(config: NeptuneAnalyticsConfig): {

View on GitHub (pinned to 001c235229)

Solutions

  1. Pass graphIdentifier: 'g-xxxxxxxx' (the Neptune Analytics graph id) in the vector store config.
  2. Or pass endpoint: 'g-xxxxxxxx' / 'neptune-graph://g-xxxxxxxx' as the raw graph id.
  3. Verify env/SSM loading before constructing the store; log Object.keys(config) minus secrets to confirm field names.

Example fix

// before
vectorStore: { provider: 'neptune-analytics', config: { collectionName: 'mem' } } // throws

// after
vectorStore: { provider: 'neptune-analytics', config: { collectionName: 'mem', graphIdentifier: 'g-1234abcd' } }
Defensive patterns

Strategy: validation

Validate before calling

if (!config.graphIdentifier && !config.endpoint) {
  throw new Error('neptune-analytics: set graphIdentifier (e.g. g-xxxx) or endpoint before init');
}

Type guard

const hasNeptuneTarget = (c: unknown): c is { graphIdentifier?: string; endpoint?: string } =>
  !!c && (typeof (c as any).graphIdentifier === 'string' || typeof (c as any).endpoint === 'string');

Try / catch

try {
  store = new NeptuneAnalytics(config);
} catch (e) {
  if (e instanceof Error && e.message.includes('graphIdentifier or endpoint')) {
    // load graph id from env/SSM and retry construction
  } else throw e;
}

Prevention

When it happens

Trigger: new NeptuneAnalytics({ collectionName: 'mem' }) with neither graphIdentifier nor endpoint; config keys typo'd (graph_id, graphId, host) so both real fields are undefined; building config from env vars where neither NEPTUNE_GRAPH_ID nor endpoint was exported.

Common situations: AWS deployments where the graph id lives in an SSM/env var that wasn't loaded in one environment; porting config from Neptune Database (port 8182 host:port endpoint) to Neptune Analytics which needs a graph identifier like 'g-1234abcd'.

Related errors


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