The Magic of Embeddings
stack.convex.dev
stack.convex.dev
It's worth noting that this is probably because this audience wants keyword matching rather than semantic search which Google switched to years back [1].
Curious to know whether embeddings have been a subsequent step in this transition.
1. https://blog.google/products/search/search-language-understa...
One of the hardest design problems with search is that the affordances of a search field is largely a mystery. Mixing paradigms does not help.
The best post I've seen so far that really does dive into the magic of embeddings is this: https://txt.cohere.com/text-embeddings/
We offer courses at work and needed a way to see how we compared with the sector. So I wrote a small Python script to scrape the name and description, along with other info, from the websites of other providers in the sector.
The embeddings came into play because our course names don't always line up with other course names. So I used the embeddings for the course description and outcomes to match courses.
The results were mostly good. I haven't done a super deep analysis of the results (got pulled off to work on more pressing issues) but for the most part the courses matched properly.
There were a handful though that didn't really match at all, but I haven't looked into it enough to find out why.
I'd like to learn more about the dimensionality of the embedding and how that is minimised - it seems intuitive (not the same thing as "actually correct"!) that keeping the vector length smaller would be more computationally efficient, with a trade-off in (theoretically) worse performance. I'd guess that performance drop assumes a totally "even" distribution of meaning throughout the embedding space, so I wonder if the enhancements revolve around targeting the embedding more towards real data distributions, or something more subtle.
SiteGuide (https://siteguide.ai/) was the first to do vector embeddings with Convex, built by integrating Convex + Pinecone. This combination has been an increasingly common pattern over the last few months. So we put a template project to demonstrate how this is usually done:
https://github.com/ianmacartney/embeddings-in-convex
We're strongly considering building in vector search a little further down the road, but this is the recommended approach for now.
So far our answer for folks who want alternative storage/query engines is to use our streaming Airbyte source connector or write directly to Pinecone, Snowflake, etc. This should work great for most devs.
There are likely always going to be some developers who want to use a particular third party database in addition to Convex, but we plan to expand built-in support for most workloads over time so that Convex is a truly full-stack backend replacement.