Skip to main content
VideoDB gives you two ways to retrieve indexed video:
  • Use direct retrieval methods when you know how the data should be searched, filtered, or grouped.
  • Use intelligent search when you want VideoDB to interpret a natural-language request and choose the retrieval strategy.

Try the search notebook

Explore a runnable guide to searching and retrieving indexed video.

Direct retrieval methods

Let VideoDB choose the retrieval strategy

You do not always need to select a direct method yourself. Intelligent search interprets the request and uses the relevant retrieval capabilities internally.
  • search() plans retrieval for a natural-language request.
  • search(mode="deepsearch") performs deeper, multi-step retrieval and supports follow-up sessions.
  • ask() retrieves evidence and synthesizes a grounded answer.

One request, multiple video signals

Consider this request:
Find moments where someone discusses Nike while holding a phone outside a store.
A useful answer may depend on several indexed signals: With intelligent search, the application sends the goal rather than manually coordinating each retrieval step:
The result keeps the timestamped evidence and can hydrate the relevant index rows through return_fields.

Intelligent Search

Learn when to use Search, DeepSearch, and Ask.

Index selection at a glance

With direct retrieval, you choose the indexes. With intelligent search, VideoDB selects them based on your request and the available index schemas. Plural selectors (index_names, index_ids) support multi-index retrieval. Singular selectors (index_name, index_id) identify one index.

How index and field targeting works

An index name searches all applicable fields inside that index. Add a field path when you want to target one specific field.
Filter fields follow the same targeting pattern. Suppose both the transcript and ocr indexes contain a text field. An unqualified field checks text in every index in scope where that field is present:
Qualify the field when the condition should use only text detected on screen by the ocr index:
For semantic refs, an exact index-name match wins first. Otherwise, VideoDB treats the first segment as the index name and the remainder as its field path. For query() and aggregate(), the singular index_name or index_id already limits the operation to one index.

Direct retrieval in detail

Use the direct methods when your application should control the retrieval operation and index selection. Use semantic search when you know the meaning you want to match and which semantic indexes should be searched.
You can select indexes by name or ID. If you omit both selectors, VideoDB searches all semantic indexes in the video or collection scope.
Add a filter when semantic similarity should also satisfy an explicit condition:
Filters must use fields supported by the indexes available to the search. Inspect an index’s field_schema before relying on a field or operator in production.

Apply exact conditions with query()

Use query when you know the index and the exact conditions to apply. Query does not interpret natural language or calculate semantic similarity.
Select exactly one index using index_name or index_id.

Count and group with aggregate()

Use aggregation when you need analytics rather than matching moments. group_by is required and must reference an aggregatable field.
Filters can narrow the rows included in the aggregation:
Unlike semantic search and query, aggregation returns an envelope rather than Shot objects. Read the aggregate rows from response["results"] and optional migration warnings with response.get("warnings", []).

Which direct method should I use?

Video and collection scope

The same methods are available at both scopes:
Use a video method for one video. Use a collection method to search every indexed video in a collection.

Next steps

Intelligent Search

Let VideoDB plan retrieval or synthesize an answer.

Results and Evidence

Work with shots, timestamps, returned fields, and streams.

Collection Search

Apply retrieval methods across a video library.