---
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.  Multimodal RAG

Back to code examples

Cross-MediaSimilar

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

video

image

text

audio

Multi-Stage

[Run in Builder](/build?recipe=multimodal-rag)

"How did the product launch go? Cite specific video clips and document timestamps"

### Why This Matters

RAG quality depends on retrieval quality. Mixpeek handles the multimodal retrieval infrastructure while you bring your preferred generation model.

Python

cURL

from openai import OpenAI

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="launch-recordings")

openai \= OpenAI(api\_key\="YOUR\_OPENAI\_KEY")

\# 1. Recordings are cut at pauses, transcribed, and each passage is embedded

bucket \= client.buckets.create(

    bucket\_name\="launch-recordings",

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

)

collection \= client.collections.create(

    collection\_name\="launch-recordings",

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

    feature\_extractor\={

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

        "version": "v1",

        "parameters": {

            "split\_method": "silence",

            "run\_transcription": True,

            "run\_transcription\_embedding": True,

        },

    },

)

client.buckets.upload(

    bucket\["bucket\_id"\],

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

)

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

\# 2. Retrieve passages, then rerank them against the question

retriever \= client.retrievers.create(

    retriever\_name\="launch-context",

    collection\_identifiers\=\["launch-recordings"\],

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

    stages\=\[

        {

            "stage\_name": "search",

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

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/multilingual\_e5\_large\_instruct\_v1",

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

                        "top\_k": 50,

                    },

                \],

                "final\_top\_k": 50,

            },

        },

        {

            "stage\_name": "rerank",

            "stage\_id": "rerank",

            "parameters": {

                "inference\_name": "BAAI\_\_bge\_reranker\_v2\_m3",

                "query": "{{INPUT.query}}",

                "document\_field": "transcription",

                "top\_k": 8,

            },

        },

    \],

)

question \= "How did the product launch go?"

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

\# 3. Number each passage with its source and timestamp so the answer can cite it

context \= " ".join(

    f"\[{i}\] {doc\['transcription'\]} (source {doc\['root\_object\_id'\]} at {doc\['start\_time'\]}s)."

    for i, doc in enumerate(results\["documents"\], 1)

)

response \= openai.chat.completions.create(

    model\="gpt-4o",

    messages\=\[

        {"role": "system", "content": "Answer from the numbered context and cite the numbers. Context: " + context},

        {"role": "user", "content": question},

    \],

)

print(response.choices\[0\].message.content)

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

rerank

Rerank documents using cross-encoder models for accurate relevance

sort

### Documentation

[Retrievers Overview](https://mixpeek.com/docs/retrieval/retrievers)[LLM Rerank Stage](https://mixpeek.com/docs/retrieval/stages/overview#llm_rerank)

## Use Cases Using This Recipe

Beginner

6 min

### Course Content Intelligence

Make every lecture moment searchable and actionable

80% reduction

Content discovery time

[

education

](/solutions/education)[

learning

](/solutions/learning)

Who It's For

EdTech platforms, universities, and corporate L&D teams managing 1,000+ hours of educational content

[View Details](/use-cases/course-content-intelligence)

Intermediate

Coming Soon

7 min

### Epstein Files Intelligence

Search and analyze thousands of declassified legal documents

100% of corpus indexed

Document searchability

[

legal

](/solutions/legal)

Who It's For

Investigative journalists, legal researchers, OSINT analysts, and public interest organizations working with large declassified document sets

[View Details](/use-cases/epstein-files)

Advanced

Coming Soon

7 min

### Government Intelligence

Multimodal search and analysis for government document repositories

100% unified index

Cross-department search coverage

[

legal

](/solutions/legal)

Who It's For

Government agencies, policy researchers, compliance teams, and public affairs professionals managing multi-department document repositories

[View Details](/use-cases/government-intelligence)

Beginner

### Semantic Search for Knowledge Bases

Find answers by meaning, not keywords, across your entire knowledge repository

85% of queries answered on first search vs. 40% baseline

First-search success rate

[

education

](/solutions/education)

Who It's For

Knowledge management teams, internal documentation owners, customer support organizations, and EdTech platforms maintaining 10K+ articles, documents, and multimedia resources

[View Details](/use-cases/semantic-search-knowledge-base)

Intermediate

### Enterprise RAG Search

Ask questions across all your enterprise data and get sourced, verifiable answers

80% faster from question to answer

Information retrieval time

[

finance

](/solutions/finance)

Who It's For

Financial services firms, consulting organizations, legal teams, and enterprise knowledge workers who need to synthesize information across thousands of internal documents, reports, and presentations

[View Details](/use-cases/enterprise-rag-search)

Intermediate

10 min

### Multimodal RAG

Retrieval-augmented generation that understands text, images, video, and audio

+26% over text-only RAG

Answer accuracy with multimodal context

ai search

[

ecommerce

](/solutions/ecommerce)

Who It's For

AI engineering teams, product builders, and enterprise developers building RAG applications that need to reason over documents, images, video, and audio rather than text alone

[View Details](/use-cases/multimodal-rag)

Advanced

9 min

### AI Compliance Document Review

Automate regulatory document review with multimodal AI understanding

10x faster

Review cycle time

[

legal

](/solutions/legal)[

finance

](/solutions/finance)

Who It's For

Compliance teams, regulatory affairs departments, and legal operations groups reviewing 1,000+ regulatory documents per quarter across banking, insurance, pharma, and financial services

[View Details](/use-cases/ai-compliance-document-review)

Advanced

10 min

### AI-Powered E-Discovery

Accelerate legal discovery across documents, emails, video, and audio evidence

83% lower cost per document

Review cost reduction

[

legal

](/solutions/legal)

Who It's For

Law firms, corporate legal departments, litigation support providers, and e-discovery vendors processing 100,000+ documents per matter across civil litigation, regulatory investigations, and internal compliance reviews

[View Details](/use-cases/ai-powered-e-discovery)

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

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

Learn more





](/recipes/semantic-join)[

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

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

Recipe

### Clustering & Theme Discovery

Unsupervised clustering that groups content into semantic themes using HDBSCAN. Surfaces hidden patterns, content variants, and outliers without requiring predefined labels.

Learn more





](/recipes/clustering-theme-discovery)[

Recipe

### Anomaly Detection

Identify outliers and anomalous content using embedding distance from cluster centroids. Flag quality issues, novel content, or items that don't match expected patterns.

Learn more





](/recipes/anomaly-detection)