RyanCodrai/turbovec · error · ValueError

TurboQuantVectorDb only supports search_type=SearchType.vect

Error message

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

What it means

Raised by the search_type property setter when anything other than SearchType.vector is assigned. agno's Knowledge.search sets vector_db.search_type directly before searching, so a keyword or hybrid request would otherwise silently return vector-only results; this guard rejects the unsupported request loudly at the assignment site.

Source

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

    def search_type(self) -> SearchType:
        return self._search_type

    @search_type.setter
    def search_type(self, value: SearchType) -> None:
        """Reject an unsupported search type on assignment, not only in
        ``__init__``.

        agno's ``Knowledge.search`` sets this attribute directly before
        searching — ``self.vector_db.search_type = SearchType(search_type)``
        — without consulting ``get_supported_search_types()``. As a plain
        attribute that mutation silently succeeded and the store then
        served vector-only results for a hybrid or keyword request, while
        reporting ``search_type == hybrid`` afterwards (#502). Raising
        here makes the unsupported request loud at the point it is made,
        and matches what the constructor already does.
        """
        if value != SearchType.vector:
            raise ValueError(
                f"TurboQuantVectorDb only supports search_type=SearchType.vector; "
                f"got {value}. Use LanceDb / Chroma / etc. for keyword "
                f"or hybrid search."
            )
        self._search_type = value

    def get_supported_search_types(self) -> List[SearchType]:
        # Only vector. Keyword and hybrid would require an external BM25
        # / lexical index that turbovec doesn't ship. Return shape
        # mirrors LanceDb: a list of SearchType enum members (not their
        # `.value` strings).
        return [SearchType.vector]

    # ---- VectorDb protocol: delete ----------------------------------------

    def delete_by_id(self, id: str) -> bool:
        if self._index is None:
            return False

View on GitHub (pinned to ccab9f325e)

Solutions

  1. Use SearchType.vector (the only supported mode) or leave search_type unset.
  2. Switch to a store that supports keyword/hybrid search (LanceDb, Chroma, etc.) when keyword or hybrid retrieval is required.
  3. Catch the ValueError in the agent/Knowledge layer to detect a misconfigured knowledge base early.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at turbovec-python/python/turbovec/agno.py:1034 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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