Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



>> 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


What 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.


I 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#mo...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: