Skip to main content

Module search

Module search 

Source
Expand description

Hybrid search engine: BM25 + vector similarity + Reciprocal Rank Fusion.

Structs§

Bm25Hit
A BM25 search hit from FTS5.
VectorHit
A vector search hit.

Functions§

cosine_similarity
Compute cosine similarity between two vectors.
deduplicate_results
Deduplicate results by (source_type, source_id), keeping the first occurrence.
fts_only_search
Full-text search only (no embeddings needed). Synchronous.
hybrid_search
Perform a hybrid search (BM25 + vector + RRF).
hybrid_search_explained
Perform a hybrid search and return the exact score decomposition.
rrf_fuse
Fuse BM25 and vector results via Reciprocal Rank Fusion.
rrf_fuse_with_context
sanitize_fts_query
Sanitize a raw query string for safe use in an FTS5 MATCH expression.
source_dedup_key
vector_only_search
Vector-only search. Called after embedding the query.