microsoft/semantic-kernel · warning · VectorStoreInitializationException

Index with {field.index_kind} is not supported.

Error message

Index with {field.index_kind} is not supported.

What it means

A VectorStoreInitializationException raised by the final 'case _' of _create_index() (faiss.py:64) when index_kind passes the outer INDEX_KIND_MAP check but the match on index_kind has no corresponding case. Like error 1294, this is a secondary guard: the outer map (FLAT, DEFAULT) and the match arm (FLAT | DEFAULT) cover the same values, so this fires only if the two diverge after an edit.

Source

Thrown at python/semantic_kernel/connectors/faiss.py:64

    """Create a Faiss index."""
    if field.index_kind not in INDEX_KIND_MAP:
        raise VectorStoreInitializationException(f"Index kind {field.index_kind} is not supported.")
    if field.distance_function not in DISTANCE_FUNCTION_MAP:
        raise VectorStoreInitializationException(f"Distance function {field.distance_function} is not supported.")
    match field.index_kind:
        case IndexKind.FLAT | IndexKind.DEFAULT:
            match field.distance_function:
                case DistanceFunction.EUCLIDEAN_SQUARED_DISTANCE | DistanceFunction.DEFAULT:
                    return faiss.IndexFlatL2(field.dimensions)
                case DistanceFunction.DOT_PROD:
                    return faiss.IndexFlatIP(field.dimensions)
                case _:
                    raise VectorStoreInitializationException(
                        f"Distance function {field.distance_function} is "
                        f"not supported for index kind {field.index_kind}."
                    )
        case _:
            raise VectorStoreInitializationException(f"Index with {field.index_kind} is not supported.")


class FaissCollection(InMemoryCollection[TKey, TModel], Generic[TKey, TModel]):
    """Create a Faiss collection.

    The Faiss Collection builds on the InMemoryVectorCollection,
    it maintains indexes and mappings for each vector field.
    """

    indexes: MutableMapping[str, faiss.Index] = Field(default_factory=dict)
    indexes_key_map: MutableMapping[str, MutableMapping[TKey, int]] = Field(default_factory=dict)

    def __init__(
        self,
        record_type: type[TModel],
        definition: VectorStoreCollectionDefinition | None = None,
        collection_name: str | None = None,
        embedding_generator: EmbeddingGeneratorBase | None = None,

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Check for a library bug (INDEX_KIND_MAP vs match arms inconsistency) and file an issue.
  2. Workaround: pass a pre-built faiss.Index via 'index'/'indexes' to skip _create_index.
Defensive patterns

Strategy: try-catch

Validate before calling

from semantic_kernel.connectors.faiss import INDEX_KIND_MAP
SUPPORTED_MATCH = {IndexKind.FLAT, IndexKind.DEFAULT}
assert set(INDEX_KIND_MAP) == SUPPORTED_MATCH, "Faiss index-kind maps are inconsistent; report a library bug"

Try / catch

from semantic_kernel.exceptions import VectorStoreInitializationException
try:
    FaissCollection(record_type=Doc)
except VectorStoreInitializationException as e:
    if "Index with" in str(e) and "is not supported" in str(e):
        # pass a pre-built faiss.Index; report library bug if maps should align
        ...

Prevention

When it happens

Trigger: Effectively unreachable with current maps — would require INDEX_KIND_MAP to contain a kind that the match statement does not handle.

Common situations: Not encountered in normal usage; defensive guard against future map/match drift.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/d1580e7937f42d32. Report an issue: GitHub.