Skip to main content
Pass an image and get back the images and video frames that look like it, ranked by visual similarity. Images and video frames share one SigLIP index, so the same namespace also answers a description in words.

Jump to the manifest

reverse-search.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.

At a glance

How the pieces connect

Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.

Deploy it

1

Get the manifest

2

Validate it

Validate runs every check apply runs and creates nothing. Fix each entry in errors, then run it again.
3

Apply it

Apply creates every resource in one call. wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.
The response lists each resource with its outcome in resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.

Run the first query

Look up the namespace id by name, then run search-by-description. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.

Add your own data

Each object you add to a bucket is processed by every collection that reads it. This adds one object to images. NAMESPACE_ID is the id from the namespace lookup above.
The object is PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.

Retrievers

find-similar

Pass an image and get back the images and video frames that look most like it. Stages: feature_search Searches: images, video-frames

search-by-description

Describe what an asset looks like in words and get back the images and video frames that match. Same index as find-similar, queried with text. Stages: feature_search Searches: images, video-frames

Collections

Each collection runs one extractor over a bucket, or over another collection’s documents.
image_extractor@v1 over bucket images: one document per image, embedded by SigLIP.Reads bucket images with image_extractor v1.Inputs: image ← imageCopied onto each document: title, brand
image_extractor@v1 over bucket videos: one document per visually distinct frame, with start_time and end_time, embedded by the same SigLIP model as the images.Reads bucket videos with image_extractor v1.Inputs: image ← videoCopied onto each document: title, brand

The manifest

Every resource above comes from this file. Change it and apply it again with ?mode=upsert to update what exists. Manifests documents each field.
reverse-search.namespace.yaml

Hand it to an agent

Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown at https://mixpeek.com/docs/templates/reverse-search.md.
Prompt

How it works

Both collections run image_extractor, which embeds pixels with Google SigLIP (google/siglip-base-patch16-224, 768 dimensions). An image and a sentence that describes it land close together in that space, so find-similar takes an image and search-by-description takes words, over the same index.
  • images stores one document per image.
  • video-frames stores one document per visually distinct frame of each video, with start_time and end_time in seconds. Near-identical frames collapse into the frame that stands for them, so a static shot costs one embedding.
Both collections write the same feature, mixpeek://image_extractor@v1/google_siglip_base_v1. A retriever that names both collections returns photos and frames in one ranked list. The find-similar search uses input_mode: content. The engine reads the value of query and picks the format by its shape: A data URI is the most reliable choice. A URL fails when its host refuses server-side fetches, and some public image hosts do. Each retriever runs one search, so score on each document is the raw SigLIP similarity, which a threshold can read. Each change below is an edit to the manifest. Apply it again with ?mode=upsert, which creates new resources and patches the ones that drifted from the file.

Query with an image

Send a local photo as a data URI to find the images and frames closest to query.jpg:
cURL
A document with start_time set is a video frame. To search with a frame from a video, extract it first and send it the same way:
Grab the frame at 12 seconds

Query with a document you already indexed

To find more like a result, skip the upload and reuse the stored vector. input_mode: document reads the vector of an existing document, so the query runs no inference. Add this retriever to the retrievers: list:
reverse-search.namespace.yaml (retrievers)
Run it with the collection_id and document_id of any document from an earlier response.

Keep only close matches

A similarity search returns up to final_top_k documents even when none looks like the query. For duplicate and counterfeit checks that need an empty answer, add a score_threshold stage after the search in find-similar:
reverse-search.namespace.yaml (find-similar stages)
min_score is fixed in the retriever; a template cannot set it per call because the stage expects a float. Pick it from your own data: run find-similar with a near-duplicate and with an unrelated image, and set min_score between the two scores.

One match per video

A video with many similar shots can fill the whole list with its own frames. Add a group_by stage to keep the best frame of each source object:
reverse-search.namespace.yaml (append to find-similar stages)
Each image is its own source object, so images pass through unchanged.

Find small things in wide shots

SigLIP embeds the whole frame at 224 by 224 pixels, so a logo in a corner of a wide shot barely moves the vector. tile_grid also embeds a grid of crops, one document per tile. Extractor parameters change only while a collection is empty, so add the tiles as a new collection:
reverse-search.namespace.yaml (append to collections)
Each tile document carries tile_index (0 is the full image, then the crops row by row) and frame_key, which the tiles of one image share. Search image-tiles with the same SigLIP search as find-similar, then rank images by their best tile with a group_by stage on frame_key and max_per_group: 1. After the apply, process the images already in the bucket:
cURL
A 3 by 2 grid plus the full image makes 7 documents per image, and 7 times the embedding cost.

Match moving video, across media

To match a query image against whole scenes, add a collection that runs multimodal_extractor, which embeds video segments, images and text in one 1408-dimension space with Vertex AI multimodalembedding@001. Add the extractor to the namespace first:
reverse-search.namespace.yaml (namespaces)
Then add a scene collection over the same videos bucket, and a retriever that searches it:
reverse-search.namespace.yaml (collections and retrievers)
Merge the blocks into the existing lists. A lower scene_detection_threshold (for example 0.3) cuts more scenes. Each search embeds the query with its own feature’s model, so image-to-scene uses Vertex. After the apply, trigger video-scenes the same way as image-tiles.

Filter by metadata at query time

title and brand are copied onto every document. Pass filters next to inputs to filter on them; this runs search-by-description over Norelco assets only:
cURL
The filter is ANDed with any filter in the retriever’s stages.

Where to go next

Tag assets with a taxonomy

Copy a brand or product label onto new assets that match a labeled reference set.

Group assets into clusters

Find visual themes across the library without predefined categories.

Alert on a match

Run a retriever on every new asset and notify when it returns documents.

Feature search reference

Every query mode, fusion strategy and search parameter.