RyanCodrai/turbovec · error · NotImplementedError

filter condition not supported by TurboQuantVectorStore

Error message

filter condition {condition!r} not supported by TurboQuantVectorStore

What it means

_filters_match only implements AND, OR, and NOT condition types from LlamaIndex's MetadataFilters. Any other FilterCondition (e.g. custom or newly added enum values) hits the fallthrough NotImplementedError.

Solutions

  1. Rewrite the filter using MetadataFilters(condition=FilterCondition.AND/OR/NOT)
  2. Simplify to a single flat filter list (implicit AND)
  3. Check supported conditions before building filters

Example fix

// before
filters = MetadataFilters(filters=[...], condition=FilterCondition.PIPE)
// after
filters = MetadataFilters(filters=[...], condition=FilterCondition.AND)
Defensive patterns

Strategy: validation

Validate before calling

from llama_index.core.vector_stores.types import FilterCondition
assert filters.condition in (FilterCondition.AND, FilterCondition.OR, FilterCondition.NOT)

Try / catch

try:
    results = store.query(q)
except NotImplementedError as e:
    if "filter condition" in str(e):
        q.filters = MetadataFilters(filters=q.filters.filters, condition=FilterCondition.AND)
        results = store.query(q)
    else:
        raise

Prevention

When it happens

Trigger: Passing VectorStoreQuery(filters=MetadataFilters(condition=<unsupported>)) to delete_nodes, get_nodes, or query where condition is not AND/OR/NOT.

Common situations: Upgrading llama_index-core introduces a new FilterCondition and code passes it through; copy-pasted filter code using an exotic condition.

Related errors


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

Appendix: source

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

            if isinstance(f, MetadataFilters):
                # Deliberate superset of the reference: SimpleVectorStore's
                # build_metadata_filter_fn raises ValueError on nested
                # MetadataFilters groups; turbovec recurses and evaluates
                # them. Per-operator semantics still match the reference
                # (see _single_filter_match).
                results.append(cls._filters_match(metadata, f))
            else:
                results.append(cls._single_filter_match(metadata, f))
        if condition == FilterCondition.AND:
            return all(results) if results else True
        if condition == FilterCondition.OR:
            return any(results) if results else True
        if _CONDITION_NOT is not None and condition == _CONDITION_NOT:
            # Reference semantics (`build_metadata_filter_fn`,
            # `utils.py:187-189`): NOT matches when none of the inner
            # filters match. Empty inner list trivially satisfies NOT.
            return not any(results)
        raise NotImplementedError(
            f"filter condition {condition!r} not supported by TurboQuantVectorStore"
        )

    @staticmethod
    def _single_filter_match(metadata: dict[str, Any], f: MetadataFilter) -> bool:
        # Semantics mirror SimpleVectorStore's _build_metadata_filter_fn
        # (llama_index/core/vector_stores/simple.py) so that filtered
        # results agree with the in-tree reference store.
        op = f.operator
        target = f.value
        value = metadata.get(f.key)

        # IS_EMPTY is the only operator that treats a missing key as a hit.
        if op == FilterOperator.IS_EMPTY:
            return value is None or value == "" or value == []

        # Missing key: no value to compare, so every operator declines —
        # EXCEPT the negative ones. "this node's colour is not red" is

View on GitHub (pinned to ccab9f325e)