Jump to the manifest
video-understanding.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.At a glance
How the pieces connect
Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.Deploy it
1
Get the manifest
2
Validate it
Validate runs every check apply runs and creates nothing. Fix each entry in
errors, then run it again.3
Apply it
Apply creates every resource in one call. The response lists each resource with its outcome in
wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.Run the first query
Look up the namespace id by name, then runvideo-search. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.
Add your own data
Each object you add to a bucket is processed by every collection that reads it. This adds one object tovideos. NAMESPACE_ID is the id from the namespace lookup above.
PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.
Retrievers
video-search
Type what a moment shows or what someone says in it, and get the matching 10-second segments, ranked over the frames and the transcript together.
Stages: feature_search
Searches: video-moments
Collections
Each collection runs one extractor over a bucket, or over another collection’s documents.video-moments
video-moments
multimodal_extractor@v1 over bucket videos: one document per 10-second segment, with a visual embedding and a transcript embedding. Feeds video-search.Reads bucket
videos with multimodal_extractor v1.Inputs: video ← videoCopied onto each document: title, categoryThe manifest
Every resource above comes from this file. Change it and apply it again with?mode=upsert to update what exists. Manifests documents each field.
video-understanding.namespace.yaml
Hand it to an agent
Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown athttps://mixpeek.com/docs/templates/video-understanding.md.
Prompt
How it works
Each video invideos becomes one document per 10-second segment in video-moments. Every document carries the segment’s start_time and end_time in seconds, its transcription, a thumbnail_url, the source video’s URL in source_video_url, and the bucket object’s title and category.
One multimodal_extractor@v1 run writes two vector indexes per segment:
video-search sends the same text query to both indexes and fuses the two ranked lists into one. A query like “a man shaving with an electric razor” finds the segment by its frames. A query that repeats a line from the voice-over finds the segment by its transcript, even when the frames show something else.
Why these parameters
split_method: timewithtime_split_interval: 10cuts every video into fixed 10-second segments. Shorter segments give tighter timestamps; longer ones cost the same per minute and return coarser moments.fusion: dbsfrescales each search’s scores to 0 to 1 before it applies the weights. The two indexes come from different models with different score ranges.weight: 0.6andweight: 0.4let the frames lead. Swap them for spoken-word video such as interviews, lectures or podcasts.
budget.daily_usd of 2 pauses new batches once a day’s spend reaches 2 USD.
Change the fusion
Edit thehybrid_search stage and apply again with ?mode=upsert, which patches the retriever’s stages in place.
- Rank fusion
- Speech first
- Drop weak matches
rrf ranks by position in each list and ignores the raw scores. Use it when you do not want to tune weights.video-understanding.namespace.yaml
refused, with the resource and the field named.
Filter at query time
Passfilters with the execute call to narrow one run without changing the retriever. This one keeps only segments from automotive videos:
cURL
Filter by time
Return moments instead of segments
Adjacent segments often match the same query: a shaving scene that runs 25 seconds spans three 10-second segments. Themoment_group stage merges matching segments of the same video into one time range. Add it after hybrid_search in the retriever’s stages, then apply with ?mode=upsert.
video-understanding.namespace.yaml
time_field: start_time reads each segment’s own start and end in seconds, which is the right source for a text query. annotated keeps the best segment per video and attaches a moments array of merged ranges to it. Gaps up to merge_tolerance_ms (2 seconds here) are bridged. See Moment group.
Rerank by what was said
A cross-encoder scores the query against each segment’s transcript, which separates close matches better than vector similarity. Add arerank stage after hybrid_search:
video-understanding.namespace.yaml
max_candidates near the number of results you show. A segment with no transcript is left out of the scoring, with a warning in the response. See Rerank.
Search with a reference image
The visual index embeds images and text into one space, so a photo can be the query. Add this second retriever to the manifest’sretrievers list and apply with ?mode=upsert, which creates it beside video-search:
video-understanding.namespace.yaml
cURL
Split video a different way
Upsert changes an extractor’sparameters only on an empty collection. Once video-moments holds documents, apply refuses the change and names the collection, because the stored segments were cut with the old settings. To try another split, add a second collection over the same bucket.
This one cuts at scene changes, with each scene capped at 30 seconds:
video-understanding.namespace.yaml
collections, apply with ?mode=upsert, then process the videos already in the bucket. This bills the same 0.20 USD a minute again for the new collection.
cURL
video-scenes to its collections. Other splits: silence cuts at pauses in the audio, which suits lectures, and whole keeps one segment per video. Multimodal extractor documents every parameter, including run_ocr for on-screen text and run_video_description with response_shape for structured labels per segment.
Next steps
Ingest video from S3
Feed the same pipeline from an S3 prefix with a continuous sync.
Feature search
Every search, fusion and query mode the retriever stage accepts.
Tag segments
Label segments such as “product demo” or “interview” with a taxonomy.
Find recurring scenes
Cluster segment embeddings to group visually similar footage.

