Skip to main content
Retrieval cookbook: ready-to-copy pipeline recipes for RAG, hybrid search, video moments, face search, and dedup
Every recipe below is a complete, copy-paste retriever config. Create the retriever once, then execute it with runtime inputs.
Stage shape. Every stage is { "stage_name", "stage_type", "config": { "stage_id", "parameters" } }. stage_name is your label; stage_id is the implementation (feature_search, rerank, attribute_filter, …); stage_type is the category (filter, sort, reduce, group, enrich, apply). See Retrievers and Stages.
Point feature_uri at your collection’s index. Each recipe’s feature_search uses a feature_uri for a specific extractor (e.g. mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding). That string must match the collection you built — a video_search collection uses mixpeek://universal_extractor@v1/gemini-embedding-2, not the multimodal one. A mismatched feature_uri silently returns 0 results. Find yours with GET /v1/collections/{id}vector_indexes[].feature_uri — see Find your feature_uri.
Create + execute (every recipe uses this)

Multimodal RAG

Retrieve context for an LLM across a video’s visual content and transcript, fuse with RRF, rerank, and format into a single prompt-ready context block.
Result: the 10 most relevant moments, reranked, formatted into a cited context block ready to paste into an LLM prompt.

Hybrid Search (dense + keyword/BM25)

Fuse semantic recall (dense vectors) with exact-keyword precision (BM25) under RRF — so brand names, SKUs, and prices like $9.99 still match. Requires a text payload index (see Text Indexes).
Result: 25 results ranked by fused semantic + keyword relevance. Use rrf here — it ranks by position, immune to the cosine-vs-BM25 score-scale mismatch.

Search Across Languages (cross-lingual)

Mixpeek’s text and multimodal embeddings are multilingual (E5-Large / Gemini, 100+ languages) and every language lands in the same vector space. So a query in one language retrieves semantically matching content in any language — no translation step, no per-language index, no language parameter. Query in English, match Farsi, Mandarin, or Spanish transcripts and captions.
Result: an English query like "discussion of sanctions" returns segments whose transcript or caption is in another language — ranked by meaning, not keywords. For audio/video collections, transcription is produced in the source language (universal / audio extractors; Whisper covers 99 languages) and the multilingual embedding is what makes it retrievable cross-lingually — just point feature_uri at that extractor’s transcript embedding, e.g. mixpeek://multimodal_extractor@v1/multilingual_e5_large_instruct_v1.
Mixpeek retrieves across languages; it does not translate. There is no translation output field — matched text comes back in its original language. If you need it rendered in the reader’s language (e.g. original + English side by side), append an llm_enrich stage that translates each result into a new field:
Each result then carries both content (original) and translation (English) for side-by-side display. This is the recommended path — reach for a custom extractor only if you need translation baked in at ingest time.

Video Moment Localization

Search a video and collapse matching segments into a handful of seekable moments with start/end timestamps.
Result: per video, up to 5 merged moments with timestamps you can seek to.
time_field must point at the field holding each segment’s timestamp. For a plain text query use the segment’s own start_time. query_chunks is only present when you search with a file input via query preprocessing.

Face Search (1:N identification)

Find every clip a person appears in by passing a reference face image as a content query against the face embedding.
Result: the 20 closest face matches. A cosine score above ~0.30 typically indicates the same person (see Face Identity). This recipe chases one reference face. To match every new video against a maintained roster of named identities (a watchlist you add to and refine over time), build a reference collection instead — see Bootstrap a Labeled Dataset.

Reverse Image Search + Dedup

Find visually similar items from other sources, deduplicated.
Result: unique visually-similar items, excluding the original source.

Search OCR Text from Scanned PDFs

Scanned and archival PDFs are OCR’d — and VLM-corrected for low-confidence blocks — by the document graph extractor, which embeds each text block. So OCR’d text is searchable exactly like any other text: no separate OCR index or step. Optionally keep only high-confidence blocks, or target a layout type (e.g. only table blocks).
Result: the 25 best-matching blocks (each with page_number, bbox, object_type), limited to high-confidence OCR. Drop the high_confidence stage to include fair/poor blocks, or filter object_type to table/form to target structured regions.
For text burned into video frames (not PDFs), enable run_ocr on the multimodal extractor — it populates an ocr_text payload field you can filter on with attribute_filter. See also feature_search → Lexical (BM25).

Search + Classify

Search, then attach an LLM/taxonomy label to each result in one pipeline.
Result: 25 results, each annotated with a structured label. For NSFW/safety classification use the classify stage; for taxonomy-backed labeling see Taxonomies.

Scan a batch of inputs

Any retriever can run many queries at once — ideal for moderating an upload queue or scanning a catalog:
The retriever is planned once and reused across the batch (query optimization).

Composing recipes

Stages are independent — add, remove, or reorder them. Common extensions: append a rerank for precision, an attribute_filter for metadata scoping (the optimizer pushes it down for you), or a rag_prepare to format for an LLM.