Skip to main content

Find moments from a natural-language request

Use intelligent search when the user knows the goal but the application should not have to select indexes or retrieval methods.
The same pattern works inside one video:

Search by meaning

Use semantic search when the application should control which semantic indexes are searched.
Add exact conditions when a semantic match must satisfy additional criteria:

Filter search results

Filters are supported by default-mode search(), semantic_search(), query(), and aggregate(). A top-level list combines conditions with AND.
Use an explicit OR or NOT when the conditions should be combined differently:

Filter operators

See How index and field targeting works for selector and filter scoping examples.

Find every exact match

Use query for deterministic filtering and sorting on one index. This works well for review queues, inventories, dataset preparation, and compliance workflows.

Turn indexed signals into analytics

Use aggregation for counts, groups, and facets rather than moment playback.
Apply a filter before grouping when the analysis should cover only part of the indexed data:
Aggregation returns its rows in response["results"], so playback methods do not apply to them. Read optional migration information with response.get("warnings", []).

Investigate and refine

Use DeepSearch for questions that benefit from multiple retrieval steps or follow-up requests.

Answer with supporting moments

Use Ask when the application should present a synthesized answer. Request sources when users should be able to inspect the supporting video moments.

Inspect a result

Moment-returning methods provide Shot objects. A shot identifies where the result came from and where it occurs in the video.
Use return_fields when the interface should also show stored index evidence:

Play one matching moment

Call play() to open an individual shot in the VideoDB player:
Use generate_stream() when the application needs the playable HLS URL:
generate_stream() returns an existing stream URL when one is already available and generates one otherwise.

Compile several results

Direct semantic search and query return a SearchResult. Compile all of its shots into one stream:
High-level Search and DeepSearch return a SearchResponse. Compile the nested SearchResult when the response contains shots:
You can also play the compiled result directly:

Embed a result

Generate an iframe for an individual moment:
Or embed a compiled set of results:
The embed helper generates the required player URL when it is not already available.

Build common search experiences

Video and collection scope

Use video.* when the search should stay inside one known video. Use collection.* when a result may come from any indexed video in the collection.
The result and playback workflows remain the same at both scopes.

Next steps

Intelligent Search

Learn when to use Search, DeepSearch, and Ask.

Results and Evidence

Explore Shot fields, returned index data, and stream generation in detail.