Try the indexing notebooks
Explore runnable examples for turning understanding artifacts into indexes.
Quick example
name is omitted, VideoDB uses the artifact name.
Index sources
source accepts three forms:
Choose an index name
Use the same index name to group the same kind of data across videos in a collection. For example, name the location index on every video
"location"; you can then target that logical group with collection.semantic_search(index_names=["location"]), collection.query(index_name="location"), or collection.aggregate(index_name="location").Indexes that share a name must also share the same field structure. This keeps collection-level retrieval consistent because "location" always represents the same fields. If you create another "location" index with a different structure, VideoDB returns a 400 showing the existing and incoming structures. See Collection Search for index-specific retrieval across videos.Index all artifacts
Declare index capabilities with use_for
Use use_for to say which retrieval capabilities the index should support.
semantic describes an index capability. Use semantic_search() for direct vector similarity over semantic fields. Use search() for high-level natural-language search that may combine semantic indexes with filters and other signals.use_for is omitted, the index defaults to ["semantic", "query", "aggregate"] — semantic search works out of the box. The semantic fields come from the derived defaults below; if nothing qualifies as a default, all string fields are embedded. Pass use_for without semantic (e.g. ["query"]) to opt out of embeddings. query and aggregate are interchangeable capabilities.
The use_for that get_index() reports back is the index’s effective capability, not a verbatim echo of the request: aggregate is present only when a field is actually groupable, semantic only when a field was embedded, and an index with no records reports []. This keeps list_indexes() from advertising a capability a call would then reject.
Default fields derived from your data
fields is optional, per group: any group you declare is used verbatim, and any group you omit is filled from your actual scene data.
Well-known field names get product defaults:
Every other field is classified by shape:
Two rules to remember:
semanticdefaults apply whenuse_forincludessemanticor is omitted (semantic is on by default); if nothing qualifies, all string fields are embedded.- An explicitly empty group opts out and is not refilled:
fields={"filter": []}means “no filter fields”.
Configure fields
Usefields when you want explicit control over which artifact fields become semantic text, text fields, filters, aggregates, or sort keys.
Field names may be dotted paths into nested data. For example, frames.detections.label reaches inside every frame’s detection list. See Index Fields for the full pattern.
Fields must exist on the artifact you are indexing (dotted paths are resolved against the scene data; a name that resolves nowhere fails the create with a 400 listing the available fields). Scene descriptions, object detections, and brand detections usually come from separate artifacts, so index them separately:
objects and brands artifacts as the source of truth for object labels and brand names. Keep the scene index focused on the fields produced by your VLM prompt/schema.
VideoDB still stores additional artifact fields with indexed records. Use
return_fields during search to choose which stored fields, such as frames or raw response references, should come back in results.
See Index Fields for details.
Index user-provided temporal records
You can also index your own records if they include timestamps. Pass one record dictionary or a list of record dictionaries. VideoDB moves every field other than the reserved fields below into the record’s indexabledata.
Index field paths refer to custom fields directly. For example, use
summary, not data.summary.
Index artifacts from sandbox models
Sandbox Compute affects where the analyzer runs. The indexing interface stays the same. If an artifact was produced by a sandbox-backed analyzer, pass that artifact tovideo.index(...) exactly like a hosted-model artifact:
sandbox_id validation. Use this page for the artifact-to-index step.
Sandbox Compute
Create a sandbox and route supported model jobs to it.
Sandbox Models
See supported models, tiers, and where to pass model names.
video.index() options
Index status and inspection
Everything is validated synchronously — bad fields, missing sources, and name-contract conflicts fail the create call immediately with a descriptive400. What runs asynchronously is the embedding work: every semantic index returns as building and flips to ready when its vectors are written — typically within seconds for small indexes. Query-only indexes (no semantic embedding) return ready immediately.
Indexing is rows-first: the structured records are stored before the create call returns, so query() and aggregate() work on a building index right away. semantic_search() serves an index only once it is ready.
Because the build is asynchronous, the Index object has lifecycle helpers so you do not have to poll get_index() by hand:
Use
refresh() to fetch the latest manifest and update the existing index object:
wait_until_complete() when your next operation requires a fully built index, such as semantic search. It polls until the index reaches a terminal status: ready or failed.
wait_until_complete() raises TimeoutError. A failed build is a completed build, so the method returns the index with status == "failed"; inspect index.error for the reason.
Use video.list_indexes() and video.get_index(...) to reopen or inspect index manifests, field schemas, and record previews. See View Indexes.
Next steps
Index Fields
Learn how fields become semantic text, filters, facets, and sort keys.
View Indexes
Inspect index status, fields, schema, and records.