{"record":{"id":"499127b7d0aab5b2","repo":"microsoft/semantic-kernel","slug":"index-kind-vector-field-index-kind-is-not-suppor","errorCode":null,"errorMessage":"Index kind {vector_field.index_kind} is not supported.","messagePattern":"Index kind (.+?) is not supported\\.","errorType":"exception","errorClass":"VectorStoreInitializationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/chroma.py","lineNumber":165,"sourceCode":"        ```python\n        await collection.create_collection(\n            configuration={\"hnsw\": {\"max_neighbors\": 16, \"ef_construction\": 200, \"ef_search\": 200}}\n        )\n        ```\n        if the `space` is set, it will be overridden, by the distance function set in the data model.\n\n        To use the built-in Chroma embedding functions, set the `embedding_func` parameter in the class constructor.\n\n        Args:\n            kwargs: Additional arguments are passed to the metadata parameter of the create_collection method.\n                See the Chroma documentation for more details.\n        \"\"\"\n        if self.definition.vector_fields:\n            configuration = kwargs.pop(\"configuration\", {})\n            configuration = CreateCollectionConfiguration(**configuration)\n            vector_field = self.definition.vector_fields[0]\n            if vector_field.index_kind not in INDEX_KIND_MAP:\n                raise VectorStoreInitializationException(f\"Index kind {vector_field.index_kind} is not supported.\")\n            if vector_field.distance_function not in DISTANCE_FUNCTION_MAP:\n                raise VectorStoreInitializationException(\n                    f\"Distance function {vector_field.distance_function} is not supported.\"\n                )\n            if \"hnsw\" not in configuration or configuration[\"hnsw\"] is None:\n                configuration[\"hnsw\"] = CreateHNSWConfiguration(\n                    space=DISTANCE_FUNCTION_MAP[vector_field.distance_function]\n                )\n            else:\n                configuration[\"hnsw\"][\"space\"] = DISTANCE_FUNCTION_MAP[vector_field.distance_function]\n            kwargs[\"configuration\"] = configuration\n        if \"get_or_create\" not in kwargs:\n            kwargs[\"get_or_create\"] = True\n\n        self.client.create_collection(name=self.collection_name, embedding_function=self.embedding_func, **kwargs)\n\n    @override\n    async def ensure_collection_deleted(self, **kwargs: Any) -> None:","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/chroma.py#L147-L183","documentation":"A VectorStoreInitializationException thrown by ChromaCollection during collection creation when the first vector field's index_kind is not in INDEX_KIND_MAP. The map (chroma.py:56-59) only permits IndexKind.HNSW and IndexKind.DEFAULT. Chroma uses HNSW exclusively, so any other index kind (FLAT, etc.) is rejected up front.","triggerScenarios":"Defining a VectorStoreRecordVectorField with index_kind=IndexKind.FLAT (or any non-HNSW kind) and passing that collection definition to a ChromaCollection; reusing a data model built for the Faiss or in-memory connector with Chroma.","commonSituations":"Porting a vector record model from the in-memory/Faiss connector (which use FLAT) to Chroma without updating index_kind; copy-pasting a field definition that omits index_kind assuming a default that maps to HNSW.","solutions":["Set the vector field's index_kind to IndexKind.HNSW (or IndexKind.DEFAULT, which maps to HNSW) in the VectorStoreRecordVectorField definition.","If you intentionally need a flat/brute-force index, use the Faiss or in-memory connector instead of Chroma."],"exampleFix":"// before\nVectorStoreRecordVectorField(name=\"embedding\", index_kind=IndexKind.FLAT, dimensions=1536)\n// after\nVectorStoreRecordVectorField(name=\"embedding\", index_kind=IndexKind.HNSW, dimensions=1536)","handlingStrategy":"validation","validationCode":"from semantic_kernel.connectors.chroma import INDEX_KIND_MAP\nassert all(f.index_kind in INDEX_KIND_MAP for f in definition.vector_fields), (\n    f\"Chroma only supports index kinds: {[k.value for k in INDEX_KIND_MAP]}\"\n)","typeGuard":"from semantic_kernel.data.vector import IndexKind\nfrom semantic_kernel.connectors.chroma import INDEX_KIND_MAP\n\ndef is_chroma_index_kind(kind: IndexKind) -> bool:\n    return kind in INDEX_KIND_MAP","tryCatchPattern":"from semantic_kernel.exceptions.vector_store_exceptions import VectorStoreInitializationException\ntry:\n    await collection.ensure_collection_exists()\nexcept VectorStoreInitializationException as e:\n    if \"Index kind\" in str(e):\n        # fix the field definition's index_kind\n        ...","preventionTips":["When porting a model between connectors, re-check index_kind against that connector's INDEX_KIND_MAP.","Default Chroma models to IndexKind.HNSW."],"tags":["chroma","vector-store","configuration","index-kind"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}