surfacesimilarityimage_matches
Similarityscalar · returns boolean

IMAGE_MATCHES

Check if an image semantically matches a text query (cross-modal)

Per-row — runs once for each row.

similarityembedding-modelspecialist-zooimage

Syntax

IMAGE_MATCHES({{ image }}, '{{ query }}')
{{ image }} IMAGE_MATCHES '{{ query }}'

Arguments

nametypedescription
imageVARCHAR
queryVARCHAR
threshold(optional)DOUBLE

About

Cross-modal image–text matching. Returns TRUE if an image semantically matches a text query above a similarity threshold, using the specialist zoo's SigLIP 2 encoders. Both the image and the text are embedded in the same shared space in a single gateway round trip, then compared via dot product (equivalent to cosine since the gateway L2-normalizes both sides). Example: SELECT product_id FROM catalog WHERE photo IMAGE_MATCHES 'red sports car'; SELECT screenshot_id, screenshot IMAGE_MATCHES 'error banner' AS has_error, screenshot IMAGE_MATCHES 'loading spinner' AS is_loading FROM session_screenshots; SigLIP 2 is well-calibrated for cross-modal retrieval — typical similarity scores for a genuine match are in the 0.2-0.35 range (sigmoid-loss models produce lower absolute scores than softmax-trained CLIP variants). The default threshold of 0.2 works for most catalog-style matching. Raise it for higher precision, lower it for higher recall, or use IMAGE_SIMILARITY directly to get the raw score and threshold in SQL.

Nearby rabbit holes

same domain
Climb back to The Looking Glass