Memo::Search
Semantic search operations using USearch HNSW index
Constants
Prefiltered searches compare the query with each match directly when there are at most this many (else they use USearch's filtered search).
Unfiltered candidates fetched per filter check, at most (or 25 per result for large limits). A filter that would need more is narrow enough that applying it before searching is cheaper: at 20K vectors of 1536 dimensions, a search for 256 neighbors takes ~4 ms, while comparing the query directly with 2,000 vectors takes ~4 ms.
Instance methods
Mark chunks as read (increment read_count)
Semantic search using USearch HNSW index
Returns results ranked by cosine similarity.
IMPORTANT: Must provide service_id to ensure embeddings are from same vector space.
When metadata filters are present (source_type, like, match, sql_where), see search_filtered for how they're applied. When no filters, uses direct USearch search.