1.  [](/)
2.  [Code examples](/recipes)
3.  Semantic Join

Back to code examples

Cross-MediaSimilarConcepts

# Semantic Join

Bridge extracted content features with business reference data. Join video clips to product catalogs, detected faces to employee directories, or documents to compliance frameworks-all via embedding similarity.

video

image

text

audio

Multi-Stage

[Run in Builder](/build?recipe=semantic-join)

"Find marketing videos featuring products from our electronics catalog with matched SKUs"

### Why This Matters

Better search isn't about better embeddings-it's about connecting extracted content to existing business systems. Query by product taxonomy, not embedding distance.

Python

cURL

import requests

from mixpeek import Mixpeek

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

API \= "https://api.mixpeek.com/v1"

HEADERS \= {"Authorization": "Bearer YOUR\_API\_KEY", "X-Namespace": "catalog-join"}

\# 1. The product catalog: one photo per product, with its SKU and category as metadata

catalog\_bucket \= client.buckets.create(

    bucket\_name\="product-catalog",

    bucket\_schema\={"properties": {"photo": {"type": "image"}}},

)

catalog \= client.collections.create(

    collection\_name\="product-catalog",

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

    feature\_extractor\={

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

        "version": "v1",

    },

)

client.buckets.upload(

    catalog\_bucket\["bucket\_id"\],

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

    metadata\={"sku": "SKU-001", "category": "Electronics"},

)

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

\# 2. The retriever that finds the closest catalog product

matcher \= client.retrievers.create(

    retriever\_name\="product-matcher",

    collection\_identifiers\=\["product-catalog"\],

    input\_schema\={"query": {"type": "text", "required": True}},

    stages\=\[

        {

            "stage\_name": "search",

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

            "parameters": {

                "searches": \[

                    {

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

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 3,

                    },

                \],

                "final\_top\_k": 3,

            },

        },

    \],

)

\# 3. A flat taxonomy is the join: each match copies the product's SKU and category onto

\#    the matching document. The SDK has no taxonomies resource, so this part is REST.

taxonomy \= requests.post(API + "/taxonomies", headers\=HEADERS, json\={

    "taxonomy\_name": "product-matcher",

    "config": {

        "taxonomy\_type": "flat",

        "retriever\_id": matcher\["retriever\_id"\],

        "input\_mappings": \[{"input\_key": "query", "source\_type": "payload", "path": "description"}\],

        "source\_collection": {

            "collection\_id": catalog\["collection\_id"\],

            "enrichment\_fields": \[

                {"field\_path": "metadata.sku", "target\_field": "matched\_sku", "merge\_mode": "replace"},

                {"field\_path": "metadata.category", "target\_field": "matched\_category", "merge\_mode": "replace"},

            \],

        },

    },

}).json()

\# 4. Marketing video scenes are described, then joined to the catalog as they are written

video\_bucket \= client.buckets.create(

    bucket\_name\="marketing-videos",

    bucket\_schema\={"properties": {"video": {"type": "video"}}},

)

videos \= client.collections.create(

    collection\_name\="marketing-videos",

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

    feature\_extractor\={

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

        "version": "v1",

        "parameters": {

            "split\_method": "scene",

            "run\_video\_description": True,

        },

    },

    taxonomy\_applications\=\[{"taxonomy\_id": taxonomy\["taxonomy\_id"\], "execution\_mode": "materialize"}\],

)

client.buckets.upload(

    video\_bucket\["bucket\_id"\],

    blobs\=\[{"property": "video", "type": "video", "data": "s3://your-bucket/marketing/spring-launch.mp4"}\],

)

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

\# 5. Search the videos; results carry the joined product fields

search \= client.retrievers.create(

    retriever\_name\="video-search",

    collection\_identifiers\=\["marketing-videos"\],

    input\_schema\={"query": {"type": "text", "required": True}},

    stages\=\[

        {

            "stage\_name": "search",

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

            "parameters": {

                "searches": \[

                    {

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

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 20,

                    },

                \],

                "final\_top\_k": 20,

            },

        },

    \],

)

results \= client.retrievers.execute(search\["retriever\_id"\], inputs\={"query": "product demos"})

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

    print(doc\["document\_id"\], doc.get("matched\_sku"), doc.get("matched\_category"))

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

### Resources Used

Taxonomy

[

Product Catalog

Business reference data for semantic joining

Business reference data for semantic joining



](https://mixpeek.com/docs/enrichment/taxonomies)

### Related Blog Posts

[The Semantic Join](https://mixpeek.com/blog/semantic-join)

### Documentation

[Taxonomies](https://mixpeek.com/docs/enrichment/taxonomies)[Retrievers](https://mixpeek.com/docs/retrieval/retrievers)

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

### Multimodal RAG

Retrieval-augmented generation across video, images, and text. Retrieve relevant multimodal context, then pass to your LLM with citations back to source timestamps and frames.

Learn more





](/recipes/multimodal-rag)[

Recipe

### Semantic Multimodal Search

Unified semantic search across all content types. Query by natural language and retrieve relevant video clips, images, audio segments, and documents based on meaning-not keywords or manual tags.

Learn more





](/recipes/semantic-multimodal-search)[

Recipe

### Hierarchical Classification

Assign content to multi-level category hierarchies using embedding-based classification. Define your taxonomy once, then classify new content automatically with confidence scores.

Learn more





](/recipes/hierarchical-classification)[

Recipe

### Video Content Analytics Pipeline

Analyze video content at scale to extract insights: scene composition, speaker time, topic distribution, and sentiment across your video library.

Learn more





](/recipes/video-analytics-pipeline)[

Recipe

### Feature Extraction

Multi-tier feature extraction that decomposes content into searchable components: embeddings, transcripts, detected objects, OCR text, scene boundaries, and more. The foundation for all downstream retrieval and analysis.

Learn more





](/recipes/feature-extraction)