{"record":{"id":"eeb5ec5a2b5b2cd5","repo":"mem0ai/mem0","slug":"unsupported-index-type-config-indextype","errorCode":null,"errorMessage":"Unsupported index type: ${config.indexType}","messagePattern":"Unsupported index type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/oracledb.ts","lineNumber":357,"sourceCode":"    this.embeddingModelDims = config.embeddingModelDims ?? 1536;\n    if (\n      !Number.isInteger(this.embeddingModelDims) ||\n      this.embeddingModelDims <= 0\n    ) {\n      throw new Error(\"`embeddingModelDims` must be a positive integer\");\n    }\n\n    const distanceMetric = (config.distanceMetric ??\n      \"COSINE\") as string as DistanceMetric;\n    this.distanceMetric = distanceMetric.toUpperCase() as DistanceMetric;\n    if (!DISTANCE_METRICS.includes(this.distanceMetric)) {\n      throw new Error(`Unsupported distance metric: ${config.distanceMetric}`);\n    }\n\n    const indexType = (config.indexType ?? \"HNSW\") as string;\n    this.indexType = indexType.toUpperCase() as IndexType;\n    if (this.indexType !== \"HNSW\" && this.indexType !== \"IVF\") {\n      throw new Error(`Unsupported index type: ${config.indexType}`);\n    }\n\n    this.indexAccuracy = config.indexAccuracy;\n    if (\n      this.indexAccuracy !== undefined &&\n      (!Number.isInteger(this.indexAccuracy) ||\n        this.indexAccuracy <= 0 ||\n        this.indexAccuracy > 100)\n    ) {\n      throw new Error(\"`indexAccuracy` must be an integer between 1 and 100\");\n    }\n\n    this.indexParameters = this.validateIndexParameters(config.indexParameters);\n    this.doCreateIndex = config.doCreateIndex ?? true;\n    this.config = config;\n  }\n\n  private validateIndexParameters(","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/oracledb.ts#L339-L375","documentation":"Oracle 23ai only offers HNSW and IVF vector index types, and the choice determines both the CREATE INDEX DDL and which index parameters are validated later. The value is uppercased before comparison, so 'hnsw' passes; any other string (including 'IVF_FLAT', 'FLAT', or 'HNSWPQ') is rejected with the raw config value echoed.","triggerScenarios":"indexType: 'ivfflat' (a pgvector name) fails; 'flat' fails because mem0 always creates a vector index; typos like 'HNSW ' with trailing space pass uppercase+trim? — no trim happens, so trailing whitespace fails; undefined defaults to 'HNSW'.","commonSituations":"Porting pgvector configs (ivfflat/halfvec), FAISS terminology (Flat, IVF), or Qdrant HNSW config into OracleDB; experimenting with quantization names that Oracle does not expose via this adapter.","solutions":["Set indexType to 'HNSW' (default, best for recall/low latency) or 'IVF' (lower build cost, larger scale) — case-insensitive.","Remove pgvector/FAISS-specific names like 'ivfflat' or 'flat' from the config.","Omit indexType entirely to keep the HNSW default.","Tune within the chosen type via indexParameters (neighbors/efconstruction for HNSW; neighbor partitions etc. for IVF) instead of inventing index types."],"exampleFix":"// before\nnew OracleDB({ connectionParams, indexType: 'ivfflat' });\n\n// after\nnew OracleDB({ connectionParams, indexType: 'IVF' });","handlingStrategy":"validation","validationCode":"function normalizeIndexType(t?: string): 'HNSW' | 'IVF' {\n  const upper = (t ?? 'HNSW').toUpperCase();\n  if (upper !== 'HNSW' && upper !== 'IVF') throw new RangeError(`indexType must be HNSW or IVF, got '${t}'`);\n  return upper;\n}","typeGuard":"const isOracleIndexType = (v: unknown): v is 'HNSW' | 'IVF' | 'hnsw' | 'ivf' => v === 'HNSW' || v === 'IVF' || v === 'hnsw' || v === 'ivf';","tryCatchPattern":null,"preventionTips":["Scrub pgvector/FAISS index names (ivfflat, flat) out of configs before switching to Oracle.","Pick per-type indexParameters together with indexType in one constant."],"tags":["oracle","config","index","validation","constructor"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}