This demo illustrates one potential application of the new pgvector compatible capability
released in the 24.2 version of CockroachDB. When you click Choose an Image File, the following sequence occurs:
- Your chosen image is uploaded to the app
- Your image's features are extracted using a large language model (LLM)
- A k-means model uses the features to predict which cluster that image maps to in our index
- This result, along with the image feature vectors, is incorporated into a SQL query
- The closest matches are rendered on this page ordered by their cosine similarity to the your image
Some additional details on the demo deployment:
- The index consists of approximately 50000 images from Flickr
- The app is written in Python + Flask
- The database is a CockroachDB Basic instance