Distance and similarity functions over embedding columns (see
as_embedding()), usable inside mutate() / filter() like any other
expression. The query side is either another embedding column or a constant
numeric vector. Decoding and the arithmetic run in C, one row at a time,
parallelized over rows.
Details
cosine() returns cosine distance (1 - similarity) and l2() Euclidean
distance, so smaller means nearer – pair them with slice_min() for
nearest-neighbour search. dot() returns the inner product, where larger
means nearer (slice_max()).