RyanCodrai/turbovec · error · ValueError

TurboQuantVectorDb only supports search_type=SearchType.vect

Error message

TurboQuantVectorDb only supports search_type=SearchType.vector; got {search_type}. Use LanceDb / Chroma / etc. for keyword or hybrid search.

What it means

TurboQuantVectorDb only implements vector (semantic) search. If constructed with search_type other than SearchType.vector (e.g. keyword or hybrid), it raises a ValueError directing you to backends like LanceDb or Chroma that support those modes.

Source

Thrown at turbovec-python/python/turbovec/agno.py:192

            from this path if present.
        """
        super().__init__(
            id=id,
            name=name,
            description=description,
            similarity_threshold=similarity_threshold,
        )
        if embedder is None:
            raise ValueError(
                "`embedder` is required; turbovec needs the embedder's "
                "`dimensions` to size the underlying index."
            )
        if embedder.dimensions is None:
            raise ValueError("Embedder.dimensions must be set.")
        if bit_width not in (2, 3, 4):
            raise ValueError(f"bit_width must be 2, 3, or 4, got {bit_width}")
        if search_type != SearchType.vector:
            raise ValueError(
                f"TurboQuantVectorDb only supports search_type=SearchType.vector; "
                f"got {search_type}. Use LanceDb / Chroma / etc. for keyword "
                f"or hybrid search."
            )
        if distance not in (Distance.cosine, Distance.max_inner_product):
            raise ValueError(
                f"TurboQuantVectorDb supports distance=Distance.cosine or "
                f"distance=Distance.max_inner_product; got {distance}. "
                f"L2 distance is not supported by the underlying "
                f"inner-product kernel."
            )

        self.embedder: Embedder = embedder
        self.dimensions: int = embedder.dimensions
        self.bit_width = bit_width
        # Assigned through the validating property below, so the guard
        # applies to runtime mutation as well as construction.
        self.search_type = search_type

View on GitHub (pinned to ccab9f325e)

Solutions

  1. Remove search_type or set it explicitly to SearchType.vector.
  2. If you need keyword or hybrid search, switch to LanceDb, Chroma, or another backend that supports it.
  3. Factor backend-specific options out of shared config so search_type only applies to supporting backends.

Example fix

// before
TurboQuantVectorDb(embedder=e, search_type=SearchType.hybrid)
// after
TurboQuantVectorDb(embedder=e, search_type=SearchType.vector)
Defensive patterns

Strategy: validation

Validate before calling

from agno.vectordb.search import SearchType
search_type = SearchType.vector  # only supported mode

Try / catch

try:
    db = TurboQuantVectorDb(embedder=e, search_type=st)
except ValueError as e:
    if "search_type" in str(e):
        db = LanceDb(embedder=e, search_type=st)  # backend that supports it

Prevention

When it happens

Trigger: TurboQuantVectorDb(..., search_type=SearchType.keyword) or SearchType.hybrid, or search_type copied from a config intended for another agno VectorDb implementation.

Common situations: Sharing a shared agno vector-db config dict across multiple backends; migrating from LanceDb/Chroma where keyword/hybrid was used; believing the quantized index supports BM25-style search.

Related errors


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