{"record":{"id":"fdf3c3033648833f","repo":"mem0ai/mem0","slug":"databricks-storage-optimized-endpoints-require-dim","errorCode":null,"errorMessage":"Databricks storage-optimized endpoints require dimensions divisible by 16.","messagePattern":"Databricks storage-optimized endpoints require dimensions divisible by 16\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/databricks.ts","lineNumber":503,"sourceCode":"      config.syncPollIntervalMs ?? DEFAULT_SYNC_POLL_INTERVAL_MS;\n    this.syncTimeoutMs = config.syncTimeoutMs ?? DEFAULT_SYNC_TIMEOUT_MS;\n    this.sqlClient = config.sqlClient ?? null;\n    this.httpClient = config.httpClient || this.createHttpClient();\n\n    if (\n      this.endpointType === \"STORAGE_OPTIMIZED\" &&\n      this.pipelineType !== \"TRIGGERED\"\n    ) {\n      throw new Error(\n        \"Databricks storage-optimized endpoints only support TRIGGERED pipelineType.\",\n      );\n    }\n\n    if (\n      this.endpointType === \"STORAGE_OPTIMIZED\" &&\n      this.dimension % 16 !== 0\n    ) {\n      throw new Error(\n        \"Databricks storage-optimized endpoints require dimensions divisible by 16.\",\n      );\n    }\n\n    this.initialize().catch(console.error);\n  }\n\n  async initialize(): Promise<void> {\n    if (!this._initPromise) {\n      this._initPromise = this._doInitialize().catch((error) => {\n        // A failed init (e.g. a cold/auto-suspended warehouse at startup) must not be cached\n        // forever -- clear it so the next public call retries instead of replaying the\n        // rejection. Every step is idempotent (CREATE ... IF NOT EXISTS / ensure*), so a\n        // retry is safe.\n        this._initPromise = undefined;\n        throw error;\n      });\n    }","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/databricks.ts#L485-L521","documentation":"Databricks storage-optimized vector indices internally quantize embeddings and require the vector dimension to be a multiple of 16. The constructor checks dimension % 16 and throws at creation time when it is not.","triggerScenarios":"Using endpointType: 'STORAGE_OPTIMIZED' with an embedding dimension not divisible by 16 — e.g. 1536 is fine (96x16), but 1537, 768+1, or unusual custom-model dims like 1000 are not.","commonSituations":"Custom fine-tuned embedding models with arbitrary output sizes; truncating/padding embeddings by a few dims; choosing STORAGE_OPTIMIZED after previously using STANDARD with a non-multiple-of-16 dimension.","solutions":["Switch endpointType to 'STANDARD', which has no divisibility constraint","Or use an embedding model whose dimension is a multiple of 16 (OpenAI 1536/3072, many common models qualify)","If you control the model, project/pad embeddings to a multiple of 16 before storing"],"exampleFix":"// before\nnew Databricks({ endpointType: 'STORAGE_OPTIMIZED', embeddingDimensions: 1000, ... });\n\n// after\nnew Databricks({ endpointType: 'STANDARD', embeddingDimensions: 1000, ... });","handlingStrategy":"validation","validationCode":"if (cfg.endpointType === 'STORAGE_OPTIMIZED' && cfg.embeddingDimensions % 16 !== 0) {\n  throw new Error(`dimension ${cfg.embeddingDimensions} not divisible by 16 — use endpointType STANDARD`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check dimension divisibility when selecting endpoint type","Prefer standard embedding models (1536/3072) which satisfy the constraint"],"tags":["databricks","embeddings","configuration","vector-search"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}