6 ms·
Duckdb is an excellent choice for this task, and it’s incredibly fast! We’ve also added vector search to our product, which is really useful. OpenAI’s officia
by youngbum 2y ago
Duckdb is an excellent choice for this task, and it’s incredibly fast!
We’ve also added vector search to our product, which is really useful.
OpenAI’s official examples of embedding search use cosine similarity. But here’s the cool part: since OpenAI embeddings are unit vectors, you can just run the dot product instead!
DuckDB has a super fast dot product function that you can use with SQL.
In our product, we use duckdb-wasm to do vector searches on the client side.
- bhl 2y agoWhat library do you use to compute embedding right now? I'm wondering if it's possible to do both embedding and vector search client-side for a local-first app.
- cxcorp 2y agoI think Transformers.js can do that client-side, e.g. see the documentation for calculating embeddings with Sentence Transformers models: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.FeatureExtractionPipeline https://huggingface.co/docs/transformers.js/api/pipelines#mo...
- rkagerer 2y ago>> In our product, we use duckdb-wasm to do vector searches on the client side. Curious, what is your product? Edit: Nevermind, your recent post explained it quite well: https://news.ycombinator.com/item?id=40520073 https://news.ycombinator.com/item?id=40520073