---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  Reverse Image Search

Back to code examples

# Reverse Image Search

Build a reverse image search engine that accepts an image as input and returns visually similar results from your indexed collection. Uses multimodal embeddings to match visual features like color, shape, composition, and semantic content.

image

Single Tier

[Run in Builder](/build?recipe=reverse-image-search)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="image-catalog")

\# 1. A bucket for the catalog images, and a collection that writes a multimodal embedding per image

bucket \= client.buckets.create(

    bucket\_name\="catalog-images",

    bucket\_schema\={

        "properties": {

            "image": {

                "type": "image",

            },

        },

    },

)

collection \= client.collections.create(

    collection\_name\="product\_images",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "image", "type": "image", "data": "s3://your-bucket/images/sku-40211.jpg"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 3. An image input searched against the embeddings, then MMR so near-duplicates do not fill the page

retriever \= client.retrievers.create(

    retriever\_name\="reverse-image-search",

    collection\_identifiers\=\["product\_images"\],

    input\_schema\={

        "image": {

            "type": "image",

            "required": True,

        },

    },

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                        "query": {

                            "input\_mode": "content",

                            "value": "{{INPUT.image}}",

                        },

                        "top\_k": 100,

                    },

                \],

                "final\_top\_k": 100,

            },

        },

        {

            "stage\_name": "diversify",

            "stage\_id": "mmr",

            "parameters": {

                "lambda": 0.7,

                "diversity\_feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                "top\_k": 20,

            },

        },

    \],

)

\# 4. Search

results \= client.retrievers.execute(

    retriever\["retriever\_id"\],

    inputs\={

    "image": "https://example.com/query-photo.jpg",

},

)

for doc in results\["documents"\]:

    print(doc\["document\_id"\], doc\["score"\])

### Feature Extractors

Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

### Retriever Stages

feature search

Search and filter documents by vector similarity using feature embeddings

filter

mmr

Reorder results using Maximal Marginal Relevance for diversity

sort

## Frequently asked questions

### How does reverse image search differ from text-based image search?

Reverse image search uses the visual features of a query image to find similar images, while text-based search matches against captions or tags. Mixpeek supports both modes through the same retriever.

### What image resolutions are recommended?

Images are automatically resized for embedding extraction. Any resolution above 224x224 pixels works well. Higher resolution does not significantly improve search accuracy.

### Can I combine image and text queries?

Yes. Mixpeek supports multimodal queries where you provide both an image and a text description to refine results.

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Recipe

### Face Search Pipeline

Detect, align, and embed faces across your image and video library, then search by face identity. Uses SCRFD for detection and ArcFace for 512-dimensional identity embeddings, enabling large-scale face recognition and matching.

Learn more





](/recipes/face-search-pipeline)[

Recipe

### Visual Product Search

Enable camera-based product discovery for e-commerce. Customers snap a photo of a product they like, and the pipeline returns visually similar items from your catalog along with pricing, availability, and product metadata.

Learn more





](/recipes/visual-product-search)[

Recipe

### Visual Similarity Search

Unified visual similarity search across both images and video frames. Query with a photo, screenshot, or frame to discover visually related content regardless of format, with MMR diversification to ensure variety in results.

Learn more





](/recipes/visual-similarity-search)[

Recipe

### AI-Powered Catalog Search

Replace keyword-based catalog search with AI-powered semantic and visual search. Understands natural language queries like "lightweight summer dress under $50" and combines text understanding with visual similarity for comprehensive product discovery.

Learn more





](/recipes/ai-catalog-search)[

Extractor

### Image Embedding

Generate visual embeddings for similarity search and clustering

Learn more





](/extractors/image)