{"record":{"id":"041d521906ae1b63","repo":"mem0ai/mem0","slug":"unsupported-this-indextype-index-parameter-k","errorCode":null,"errorMessage":"Unsupported ${this.indexType} index parameter '${key}'. Allowed: ${Object.keys(allowed).join(\", \")}","messagePattern":"Unsupported (.+?) index parameter '(.+?)'\\. Allowed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/oracledb.ts","lineNumber":386,"sourceCode":"    }\n\n    this.indexParameters = this.validateIndexParameters(config.indexParameters);\n    this.doCreateIndex = config.doCreateIndex ?? true;\n    this.config = config;\n  }\n\n  private validateIndexParameters(\n    parameters?: Record<string, number>,\n  ): Record<string, number> {\n    if (!parameters) return {};\n\n    const allowed = INDEX_PARAMETER_RANGES[this.indexType];\n    const validated: Record<string, number> = {};\n\n    for (const [key, value] of Object.entries(parameters)) {\n      const range = allowed[key];\n      if (!range) {\n        throw new Error(\n          `Unsupported ${this.indexType} index parameter '${key}'. ` +\n            `Allowed: ${Object.keys(allowed).join(\", \")}`,\n        );\n      }\n      if (!Number.isInteger(value) || value < range[0] || value > range[1]) {\n        throw new Error(\n          `Index parameter '${key}' must be an integer between ${range[0]} and ${range[1]}`,\n        );\n      }\n      validated[key] = value;\n    }\n\n    return validated;\n  }\n\n  async initialize(): Promise<void> {\n    if (!this._initPromise) {\n      this._initPromise = this._doInitialize().catch(async (error) => {","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/oracledb.ts#L368-L404","documentation":"Index parameter keys are validated against INDEX_PARAMETER_RANGES for the chosen index type. HNSW accepts only 'neighbors' and 'efconstruction'; IVF accepts only 'neighbor partitions', 'samples_per_partition', and 'min_vectors_per_partition'. Any other key is rejected with the full allow-list in the message.","triggerScenarios":"indexType 'HNSW' with indexParameters { ef_construction: 400 } (snake_case with underscore — not recognized); HNSW with { m: 16 }; IVF with { neighbors: 64 }; IVF lists: sharing one parameter object across both types.","commonSituations":"Using pgvector/FAISS/Qdrant HNSW naming (m, ef_construction, ef_search, nlist, nprobe) instead of Oracle's; switching indexType from HNSW to IVF without updating indexParameters; hyphen vs underscore confusion — Oracle's IVF key is literally 'neighbor partitions' with a space.","solutions":["HNSW: use exactly neighbors (2–2048) and efconstruction (1–65535).","IVF: use exactly 'neighbor partitions' (1–10000000), samples_per_partition, min_vectors_per_partition.","Map common names: m → neighbors, ef_construction → efconstruction, nlist → 'neighbor partitions'.","Keep per-type parameter objects and select them alongside indexType in one config constant."],"exampleFix":"// before\nnew OracleDB({ connectionParams, indexType: 'HNSW', indexParameters: { ef_construction: 400, m: 16 } });\n\n// after\nnew OracleDB({ connectionParams, indexType: 'HNSW', indexParameters: { efconstruction: 400, neighbors: 16 } });","handlingStrategy":"validation","validationCode":"const INDEX_PARAMS: Record<'HNSW'|'IVF', Record<string, [number, number]>> = {\n  HNSW: { neighbors: [2, 2048], efconstruction: [1, 65535] },\n  IVF: { 'neighbor partitions': [1, 10_000_000], samples_per_partition: [1, Number.MAX_SAFE_INTEGER], min_vectors_per_partition: [0, Number.MAX_SAFE_INTEGER] },\n};\nfunction validateIndexParameters(type: 'HNSW'|'IVF', params: Record<string, number> = {}): void {\n  const allowed = INDEX_PARAMS[type];\n  for (const [k, v] of Object.entries(params)) {\n    const range = allowed[k];\n    if (!range) throw new RangeError(`Unknown ${type} parameter '${k}'. Allowed: ${Object.keys(allowed).join(', ')}`);\n    if (!Number.isInteger(v) || v < range[0] || v > range[1]) throw new RangeError(`${type} parameter '${k}' must be an integer ${range[0]}-${range[1]}`);\n  }\n}","typeGuard":"const isHnswParams = (p: Record<string, unknown>): p is { neighbors?: number; efconstruction?: number } =>\n  Object.keys(p).every((k) => k === 'neighbors' || k === 'efconstruction');","tryCatchPattern":null,"preventionTips":["Use Oracle's exact key names: neighbors, efconstruction, 'neighbor partitions' (with the space).","Keep a per-indexType parameter preset object so keys can never leak across types."],"tags":["oracle","config","index","hnsw","ivf","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}