{"record":{"id":"787d46b7166a0307","repo":"mem0ai/mem0","slug":"neptune-analytics-vector-store-requires-graphident","errorCode":null,"errorMessage":"Neptune Analytics vector store requires graphIdentifier or endpoint.","messagePattern":"Neptune Analytics vector store requires graphIdentifier or endpoint\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/neptune_analytics.ts","lineNumber":409,"sourceCode":"        },\n      );\n    } catch (error) {\n      console.error(\n        \"Neptune Analytics: failed to clean up node(s) after a failed insert\",\n        error,\n      );\n    }\n  }\n\n  private resolveGraphIdentifier(config: NeptuneAnalyticsConfig): string {\n    if (config.graphIdentifier) {\n      return config.graphIdentifier;\n    }\n\n    const rawIdentifier = config.endpoint;\n\n    if (!rawIdentifier) {\n      throw new Error(\n        \"Neptune Analytics vector store requires graphIdentifier or endpoint.\",\n      );\n    }\n\n    if (/^https?:\\/\\//i.test(rawIdentifier)) {\n      throw new Error(\n        \"Neptune Analytics HTTPS endpoints require graphIdentifier; pass graphIdentifier separately or use neptune-graph://<graph-id>.\",\n      );\n    }\n\n    if (rawIdentifier.startsWith(\"neptune-graph://\")) {\n      return rawIdentifier.slice(\"neptune-graph://\".length);\n    }\n\n    return rawIdentifier;\n  }\n\n  private buildClientConfig(config: NeptuneAnalyticsConfig): {","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/neptune_analytics.ts#L391-L427","documentation":"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.","triggerScenarios":"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.","commonSituations":"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'.","solutions":["Pass graphIdentifier: 'g-xxxxxxxx' (the Neptune Analytics graph id) in the vector store config.","Or pass endpoint: 'g-xxxxxxxx' / 'neptune-graph://g-xxxxxxxx' as the raw graph id.","Verify env/SSM loading before constructing the store; log Object.keys(config) minus secrets to confirm field names."],"exampleFix":"// before\nvectorStore: { provider: 'neptune-analytics', config: { collectionName: 'mem' } } // throws\n\n// after\nvectorStore: { provider: 'neptune-analytics', config: { collectionName: 'mem', graphIdentifier: 'g-1234abcd' } }","handlingStrategy":"validation","validationCode":"if (!config.graphIdentifier && !config.endpoint) {\n  throw new Error('neptune-analytics: set graphIdentifier (e.g. g-xxxx) or endpoint before init');\n}","typeGuard":"const hasNeptuneTarget = (c: unknown): c is { graphIdentifier?: string; endpoint?: string } =>\n  !!c && (typeof (c as any).graphIdentifier === 'string' || typeof (c as any).endpoint === 'string');","tryCatchPattern":"try {\n  store = new NeptuneAnalytics(config);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('graphIdentifier or endpoint')) {\n    // load graph id from env/SSM and retry construction\n  } else throw e;\n}","preventionTips":["Store the Neptune graph id in an env var (e.g. NEPTUNE_GRAPH_ID) and assert it at boot.","Note the config field names exactly: graphIdentifier (camelCase), not graph_id/graphId.","Fail fast on config validation in CI with a dry-run construction test."],"tags":["neptune","aws","config","vector-store","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}