Skip to content

tech-debt(rag): two hybrid-search implementations — one reachable only from a validator #17599

Description

@mrveiss

Parent: #10603

HybridSearchEngine (autobot-backend/utils/hybrid_search.py:133, 507 lines) has exactly one
caller: autobot-backend/utils/system_validator.py:894 — a validator, not a production path.
The live RAG path uses a different hybrid implementation, the BM25 route in
autobot-backend/advanced_rag_optimizer.py:475 landed by #10600.

So we carry two implementations of one concept, and the more elaborate one is wired only to a
self-check. Per consolidate, never fork, one of these is unwired machinery.

Verification run 2026-09-27:

grep -rn "get_hybrid_search_engine|HybridSearchEngine" --include=*.py .
  utils/hybrid_search.py:133,496,503   (definition)
  utils/system_validator.py:894,910    (only caller)
  repo_tests/kb_read_visibility_allowlist.py:204-206

Note its keyword scorer is a hand-rolled word-frequency map
(_build_word_frequency_map, line 67) — naive TF, not BM25 — so it is also the weaker of the two.

Acceptance criteria

  • One hybrid-search implementation remains, named once, reachable from the production path
  • The retained implementation uses BM25, not substring TF
  • system_validator validates the retained implementation, not a private copy
  • No behaviour is deleted — capability in the dropped copy is carried over or explicitly
    recorded as unwanted with a reason

Activity

  1. added this to the v0.12.0 milestone on Sep 27, 2026
  2. mrveiss commented on Oct 12, 2026

    @mrveiss
    OwnerAuthor

    Closure evidence (merged in merge train #18358, 13be1b4; constituent #18348 plus a train fix). Verified against main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions