---
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.  Visual Product Search

Back to code examples

# 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.

image

text

Multi-Stage

[Run in Builder](/build?recipe=visual-product-search)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="product-search")

\# 1. A bucket for product photos with their catalog fields as object metadata, and a collection that embeds each photo

bucket \= client.buckets.create(

    bucket\_name\="products",

    bucket\_schema\={

        "properties": {

            "photo": {

                "type": "image",

            },

        },

    },

)

collection \= client.collections.create(

    collection\_name\="product\_catalog",

    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": "photo", "type": "image", "data": "s3://your-bucket/product-images/trail-runner.jpg"}\],

    metadata\={

        "name": "Trail runner",

        "price": 89,

        "in\_stock": True,

    },

)

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

\# 3. A customer photo searched against the product embeddings

retriever \= client.retrievers.create(

    retriever\_name\="product-search",

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

    input\_schema\={

        "photo": {

            "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.photo}}",

                        },

                        "top\_k": 50,

                    },

                \],

                "final\_top\_k": 20,

            },

        },

    \],

)

\# 4. Search

results \= client.retrievers.execute(

    retriever\["retriever\_id"\],

    inputs\={

    "photo": "https://example.com/customer-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

## Frequently asked questions

### How do I handle product variants like color and size?

Store variants as metadata on each document. Use attribute filters to narrow results to specific colors or sizes after the visual similarity search.

### Can I combine text and image queries?

Yes. Send both a text description and an image to search for visually similar products that also match text criteria, like "red leather" with a shoe photo.

### What latency should I expect for production queries?

Typical query latency is 50-150ms for collections up to 10 million products. The retriever handles embedding extraction and search in a single API call.

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

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

### Multimodal Extractor

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

Learn more





](/extractors/multimodal)[

Recipe

### 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.

Learn more





](/recipes/reverse-image-search)[

Recipe

### E-commerce Catalog Enrichment

Automatically enrich product listings with visual attributes, descriptions, and tags extracted from product images. Fill in missing catalog data at scale.

Learn more





](/recipes/ecommerce-catalog-enrichment)[

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 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)