RyanCodrai/turbovec · error · NotImplementedError

TurboQuantVectorStore does not support query mode {query.mod

Error message

TurboQuantVectorStore does not support query mode {query.mode!r}. Only VectorStoreQueryMode.DEFAULT is supported — MMR / SVM / hybrid modes need access to full-precision vectors which turbovec discards after quantization. Maintain a parallel store with full vectors if you need a non-default scoring mode.

What it means

TurboQuantVectorStore only supports VectorStoreQueryMode.DEFAULT (top-k similarity). Modes like MMR, SVM, LINEAR_REGRESSION, and HYBRID need full-precision vectors, which quantization discards, so the store raises loudly instead of silently degrading to DEFAULT search.

Source

Thrown at turbovec-python/python/turbovec/llama_index.py:795

            # must be present in the metadata value (which is typically
            # a list — tag-set matching).
            return all(t in value for t in target)
        if op == FilterOperator.ANY:
            return any(t in value for t in target)
        raise NotImplementedError(
            f"filter operator {op!r} not supported by TurboQuantVectorStore"
        )

    def query(self, query: VectorStoreQuery, **_: Any) -> VectorStoreQueryResult:
        # MMR / SVM / LINEAR_REGRESSION / HYBRID etc. all need access to
        # full-precision vectors (for pairwise diversity, learned scoring,
        # or sparse-dense fusion). turbovec discards full precision after
        # quantization, so any non-DEFAULT mode is unsupportable here.
        # Raise loudly instead of silently treating it as DEFAULT, which
        # the previous impl did and which let callers think they were
        # getting e.g. MMR diversity when they were not.
        if query.mode != VectorStoreQueryMode.DEFAULT:
            raise NotImplementedError(
                f"TurboQuantVectorStore does not support query mode "
                f"{query.mode!r}. Only VectorStoreQueryMode.DEFAULT is "
                "supported — MMR / SVM / hybrid modes need access to "
                "full-precision vectors which turbovec discards after "
                "quantization. Maintain a parallel store with full vectors "
                "if you need a non-default scoring mode."
            )
        if query.query_embedding is None:
            raise ValueError(
                "TurboQuantVectorStore requires a pre-computed query_embedding "
                "(is_embedding_query=True)."
            )
        qvec = np.asarray(query.query_embedding, dtype=np.float32)
        if qvec.ndim == 1:
            qvec = qvec[None, :]
        # Cosine mode: normalize the query so the raw inner product
        # against unit node vectors is true cosine similarity.
        if self._similarity == COSINE:

View on GitHub (pinned to ccab9f325e)

Solutions

  1. Remove the query_mode setting so the retriever uses DEFAULT
  2. Maintain a parallel full-precision store (e.g. SimpleVectorStore) for non-default query modes
  3. Implement MMR-style reranking yourself on the DEFAULT results

Example fix

// before
retriever = index.as_retriever(vector_store_query_mode="mmr")
// after
retriever = index.as_retriever()  # DEFAULT mode
Defensive patterns

Strategy: validation

Validate before calling

from llama_index.core.vector_stores.types import VectorStoreQueryMode
if q.mode != VectorStoreQueryMode.DEFAULT:
    raise ValueError(f"TurboQuantVectorStore supports only DEFAULT, got {q.mode}")

Try / catch

try:
    result = store.query(q)
except NotImplementedError as e:
    if "query mode" in str(e):
        q.mode = VectorStoreQueryMode.DEFAULT
        result = store.query(q)
    else:
        raise

Prevention

When it happens

Trigger: Calling query() with VectorStoreQuery(mode=VectorStoreQueryMode.MMR/SVM/HYBRID/...) — typically via retrievers configured with vector_store_query_mode set.

Common situations: Configuring a retriever with query_mode="mmr" for diversity; hybrid search recipes ported from other stores; accidentally inherited retriever settings.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of RyanCodrai/turbovec@ccab9f325e (2026-09-06). Data as JSON: /api/errors/a71bfeef84c1cac0. Report an issue: GitHub.