Skip to main content
Version: 0.0.4

agrag.common.validation.require_valid_alpha

require_valid_alpha(alpha:float) -> None

Check that a hybrid_search alpha is a valid dense/keyword weight.

alpha is only meaningful in [0.0, 1.0]: 1.0 is pure dense, 0.0 is pure keyword. Outside that range, backends behave differently: Qdrant's client-side blend still produces a mathematically well-defined but meaningless score, while a backend's native ranker may reject the value outright.

Parameters:

  • alpha (float) – The dense/keyword balance to check.

Raises:

  • ValueError – alpha is outside [0.0, 1.0].