Ross W
Ross W2y ago

Vector Search / Embeddings

Hey! Do y’all have vector search on the roadmap? I’ve seen that Xata.io offers it and would be a great addition to semantic search. Especially with all the AI craze right now!
3 Replies
jamwt
jamwt2y ago
Ping @sujayakar He’s thought this out a bit. (An on-platform solution) Most of our work right now is projects that are convex + pinecone But our own offering is not out of the realm of possibility. @ian did you have thoughts based on your pinecone stuff recently?
ian
ian2y ago
Great timing. I'm actually playing around with embeddings and vectors and writing up some content on how to pair it with Convex. At this point my advice is to use a dedicated vector database alongside Convex, if you have non-trivial data. If you don't have many vectors to compare, it's not unreasonable to do the comparison in JS, since for OpenAI you can just do a dot product to get cosine similarity. If you go that route, I'd store the embedding as a Float32Array buffer in the document rather than an array of numbers. The way I'd recommend using Pinecone is to store the convex document ID in the pinecone vector metadata and do your search in pinecone from a Convex action, then re-associate the results with the application data in the Convex DB. Pinecone is optimized for vectors rather than transactional app data, and Convex is the inverse, so they pair pretty well together.
Chad Maycumber
This is currently how I'm handling it too if it helps @Ross W

Did you find this page helpful?