Semantic search by cosine similarity. Returns top-n matches from an
embedding matrix for one or more query vectors. Subject-first: embeddings
(haystack) then query (needle). Pipe-friendly.
search_vector(embeddings, query, n = 10)Data frame with columns query, method (“cosine”), score (3 significant figures), and the unit-id column (e.g. uid). For multiple queries, a list of such data frames.