NEWVectors or files. Pick a path.Start →

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