Skip to main content

Module query_embedding

Module query_embedding 

Source
Expand description

The one resolution of a query string into a live embedding, shared by every read path so vec_degraded means the same thing in each envelope. The one place a read path turns a query string into a live embedding.

recall and hybrid-search both need the same three-way outcome — a vector, a deliberate skip, or a degradation — and both need to report it the same way on their envelope. They used to carry byte-identical copies of that logic, including the reason string, which is duplicated knowledge rather than merely similar code: changing the degradation contract meant remembering to edit two files, and nothing failed if you edited one.

Keeping the resolution here also keeps the envelope honest. vec_degraded is what tells a caller that a hybrid search silently became a pure FTS5 search, and a single implementation is what guarantees both commands raise it under exactly the same conditions.

Structs§

QueryEmbedding
Live query embedding plus the flags describing whether it succeeded.

Constants§

FALLBACK_FTS_ONLY_CODE
reason_code recorded for a degradation the operator asked for.
FALLBACK_FTS_ONLY_REASON
Machine-readable vec_error for a degradation the operator asked for.

Functions§

degradation_failure
Decides whether a degraded read must become a non-zero exit.
resolve_query_embedding
Resolves the query embedding, degrading to FTS5-only instead of failing.