Skip to main content
A search over whole videos ranks a 10-minute video by one embedding for all 10 minutes. A search over scenes finds the 4 seconds that match, but it returns scenes. This pipeline does both. It searches the scene layer and returns each matching scene’s whole video. Each video carries the scenes that matched as evidence. It uses four pieces, all on one manifest:
  1. A multimodal extractor layer tree: the whole video, its scenes, and fixed short intervals.
  2. Embeddings only on the layer you search.
  3. feature_search on the scene layer.
  4. traverse_edge with follow: "lineage" and include_evidence: true, which returns the parent videos.
An optional fifth stage, llm_enrich, sends each returned video to a model.

The layer tree

Each layer is its own collection. The videos collection reads the bucket and writes one document per video. The two child collections read videos and split each video again. Every child document records its parent in _internal.lineage.source_document_id. The stage walks that link back up. time_split_interval takes fractions of a second, down to 0.1. A layer with run_multimodal_embedding: false still writes one document per segment, with start_time, end_time and lineage. Attribute filters read those documents, and feature search does not. An embedding costs processing time and storage on every segment it covers. In this tree, only scenes is searched, so only scenes embeds. videos and intervals set run_multimodal_embedding: false. A feature search over a collection with no vector index fails with a 400 that names the collection. Search an embedded layer, and read the others with attribute_filter or through lineage.

The manifest

Apply it with POST /v1/manifest/apply. Run it first with ?dry_run=true, which checks the whole plan and creates nothing.
input_schema is a flat dict keyed by field name. A JSON Schema object with properties is refused.

Search the scenes

feature_search runs on the retriever’s collections, here scenes alone. collection_identifiers takes a list of collection names or ids. A string, including an {{INPUT...}} template, is refused with a 422, because the collections a search reads are fixed when the retriever is created. To search a different set of layers, create one retriever per set.

Return the whole videos

traverse_edge with follow: "lineage" climbs from each scene to its document in videos. Fifty scene hits from 12 videos return 12 results. Each result is the stored videos document, scored by its best scene.
Each document in the response carries _evidence, one entry per scene that reached it, best first:
start_time and end_time give the moment inside the video, so a player can open at 312 s. The traverse edge page lists every _evidence field. A scene that cannot reach videos is dropped and counted under stage_statistics.stages.whole_videos.metadata, with a reason per drop. The run also returns a warning that counts them. If a store read fails, the run fails with a 503 instead of returning fewer videos.

Optional: ask a model about each video

Add llm_enrich after traverse_edge to send each returned video to a model. Its video_field defaults to video_segment_url, which a whole document holds for the full video.
The stage accepts at most max_candidates documents, 10 unless you set it. A larger working set is refused before any model call, so cut it with final_top_k or a reduce stage first. A video stored outside this namespace’s storage is not sent. See Media per document.

What each step costs

Explain prices a retriever’s stages before you run it.