{"record":{"id":"2315587edc3a3acb","repo":"mem0ai/mem0","slug":"index-type-must-be-either-delta-sync-or-direct","errorCode":null,"errorMessage":"index_type must be either 'DELTA_SYNC' or 'DIRECT_ACCESS'","messagePattern":"index_type must be either 'DELTA_SYNC' or 'DIRECT_ACCESS'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/vector_stores/databricks.py","lineNumber":322,"sourceCode":"        Returns:\n            The index object.\n        \"\"\"\n        # Determine index configuration\n        embedding_dims = vector_size or self.embedding_dimension\n        embedding_source_columns = [\n            EmbeddingSourceColumn(\n                name=\"memory\",\n                embedding_model_endpoint_name=self.embedding_model_endpoint_name,\n            )\n        ]\n\n        logger.info(f\"Creating vector search index '{self.fully_qualified_index_name}'\")\n\n        # First, ensure the source Delta table exists\n        self._ensure_source_table_exists()\n\n        if self.index_type not in [VectorIndexType.DELTA_SYNC, VectorIndexType.DIRECT_ACCESS]:\n            raise ValueError(\"index_type must be either 'DELTA_SYNC' or 'DIRECT_ACCESS'\")\n\n        try:\n            if self.index_type == VectorIndexType.DELTA_SYNC:\n                index = self.client.vector_search_indexes.create_index(\n                    name=self.fully_qualified_index_name,\n                    endpoint_name=self.endpoint_name,\n                    primary_key=\"memory_id\",\n                    index_type=self.index_type,\n                    delta_sync_index_spec=DeltaSyncVectorIndexSpecRequest(\n                        source_table=self.fully_qualified_table_name,\n                        pipeline_type=self.pipeline_type,\n                        columns_to_sync=self.column_names,\n                        embedding_source_columns=embedding_source_columns,\n                    ),\n                )\n                logger.info(\n                    f\"Successfully created vector search index '{self.fully_qualified_index_name}' with DELTA_SYNC type\"\n                )","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/vector_stores/databricks.py#L304-L340","documentation":"ValueError raised in Databricks index creation when self.index_type is neither VectorIndexType.DELTA_SYNC nor VectorIndexType.DIRECT_ACCESS. The value comes from the 'index_type' constructor/config argument; only those two Databricks Vector Search index types are supported, and the check runs after the source Delta table is ensured but before create_index is called.","triggerScenarios":"Constructing the store with index_type='delta_sync' (lowercase, not matching the enum), an arbitrary string like 'HYBRID', or a VectorIndexType member that exists in the SDK but is not one of the two supported values.","commonSituations":"Config copied from Databricks docs using different casing; SDK version drift introducing/renaming enum members; hand-written YAML with a typo'd index_type.","solutions":["Set index_type to exactly 'DELTA_SYNC' or 'DIRECT_ACCESS' (the values the store maps to VectorIndexType).","Pick DELTA_SYNC when you want Databricks to sync from a Delta source table and auto-embed via a model endpoint; DIRECT_ACCESS when you write vectors yourself.","Validate the value against {'DELTA_SYNC','DIRECT_ACCESS'} in your config loader before creating the store."],"exampleFix":"# before\nDatabricks(..., index_type=\"delta_sync\")  # ValueError\n\n# after\nDatabricks(..., index_type=\"DELTA_SYNC\")","handlingStrategy":"validation","validationCode":"VALID_INDEX_TYPES = {\"DELTA_SYNC\", \"DIRECT_ACCESS\"}\n\nif index_type not in VALID_INDEX_TYPES:\n    raise ValueError(f\"index_type must be one of {sorted(VALID_INDEX_TYPES)}, got {index_type!r}\")\n\nstore = Databricks(..., index_type=index_type)","typeGuard":"from typing import Literal\nIndexType = Literal[\"DELTA_SYNC\", \"DIRECT_ACCESS\"]\n\ndef is_index_type(v) -> bool:\n    return v in (\"DELTA_SYNC\", \"DIRECT_ACCESS\")","tryCatchPattern":null,"preventionTips":["Type the field as Literal['DELTA_SYNC','DIRECT_ACCESS'] so mypy catches bad literals.","Uppercase index_type values from external config before use.","Document which mode pairs with model-endpoint embedding vs. client-provided vectors."],"tags":["databricks","validation","config","vector-search"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}