3 ms·
I built this tool since I didn't just want to run single-table Postgres vector similarity search queries on some text snippets to demo vector search usefulness.
by tanelpoder 2y ago
I built this tool since I didn't just want to run single-table Postgres vector similarity search queries on some text snippets to demo vector search usefulness. I also didn't want to focus on some business vertical-specific example, so I downloaded 25000 pet images (Kaggle Cats and Dogs dataset) and vector-indexed their embeddings. And then built a simple web app that allows you to pick a cat or dog photo and find most similar-looking pet photos using Postgres HNSW vector search.
So that's just another way to demo what the higher-level "AI" similarity search means, but visually much more striking to people who are not that technical or are just getting started with this "AI" stuff.
Importantly, the web app also displays the SQL statements and execution plans (with performance metrics) that were executed in Postgres for generating the webpage. This makes some experimentation faster & easier as you could tweak the SQL or some parameter - create a different (vector) index - and just hit refresh in your browser to see the new results and the new execution plan with performance metrics.
My second goal was to blend together data from traditional tables (order history) and the newly generated embedding vectors, so I combined both worlds into a basic recommendation engine example. I first find top 20 most similar-looking cats compared to the selected one and then list the top purchased products by the 20 most similar-looking cats, all done within a single SQL query.