Yup. I was just playing around with this in Javascript yesterday and with ChatGPT's help it was surprisingly simple to go from text => embedding (via. `openai.embeddings.create`) and then to compare the embedding similarity with the cosine distance (which ChatGPT wrote for me): https://gist.github.com/christiangenco/3e23925885e3127f2c177...
Seems like the next standard feature in every app is going to be natural language search powered by embeddings.
For posterity, OpenAI embeddings come pre-normalized so you can immediately dot-product.
Most embeddings providers do normalization by default, and SentenceTransformers has a normalize_embeddings parameter which does that. (it's a wrapper around PyTorch's F.normalize)
Seems like the next standard feature in every app is going to be natural language search powered by embeddings.