Skip to content

bug(search): NPU semantic search mixes three embedding spaces (384 hybrid, 512 accelerator, 768 active) and swallows dimension mismatches as empty results #18217

Open

Description

@mrveiss

Defect

autobot-backend/npu_semantic_search.py works in three embedding spaces at once:

  • 384-d: the hybrid FAISS index is hard-coded embedding_dim=384 (~:277).
  • 512-d: the Chroma text, image, audio and multimodal collections are written by store_multimodal_embedding (:1219) through accelerated_embedding_generation, a MiniLM output projected by an untrained text_projection into a 512-d "unified space" (ai_hardware_accelerator.py). cross_modal_search (:1516) queries in 512-d.
  • 768-d: the active knowledge-base model (nomic-embed-text, via autobot_shared/embedding_model.active_embedding_model()) produces the knowledge base's stored vectors and the NPU primary path.

A query in the wrong space fails, and the failure is swallowed: _vector_similarity_search returns [], and the text-collection path is caught and returns {}. A user sees "no matches" for an engine fault.

Found in review of the #18143/#18185 branch. A change moving query embeddings to the active 768-d model was reverted there because it would have silently emptied results against the 384/512-d indexes.

Acceptance criteria

Refs #18143, #18185.

Activity

  1. mrveiss commented on Oct 10, 2026

    @mrveiss
    OwnerAuthor

    Added acceptance criterion (from the #18143 review): autobot-npu-worker/npu_semantic_search_issue68_test.py is a manual, print-only integration script (live engine, main()). Its "CPU fallback" call (enable_npu_acceleration=False, ~line 117) now reports device_used=embedding_unavailable, because #18143 makes this engine refuse rather than emit a vector in another space.

    • Once this issue picks the single search space, convert that script into an asserting test: the expected device or refusal per path, and a dimension check of query against index. Its stale "CPU fallback" label goes.
  2. mrveiss commented on Oct 11, 2026

    @mrveiss
    OwnerAuthor

    From #18230's rework: the search engine now refuses any index whose embedding space is not recorded in knowledge/index_embedding_space.py, and only autobot_code_embeddings (codebert-base, 768) is recorded. Until this issue records the others, search_batch, cross_modal_search and search() over a populated hybrid index refuse on every host. Also: results from the KB path are labelled embedding_model="enhanced_model" (npu_semantic_search.py:588) rather than the KB index's real model id. Fix that label together with the space records.

  3. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  4. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 3, 2026
  5. added
    phase:M9.1M9.1 — measurement, grounding and repair for NL→SQL and KB answers
    on Nov 12, 2026
  6. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions