Skip to main content
Video was built for people to watch. VideoDB makes it understandable and actionable for people and AI agents. With one backend, your application can turn files, live streams, and cameras into structured, timestamped context - then retrieve exact moments and act on playable evidence. Every VideoDB workflow follows the same loop:
1

See

Upload a video, connect a live stream, or capture a desktop.
2

Understand

Create reusable artifacts from what was said and what was shown, then index the context you want to retrieve.
3

Act

Retrieve matching moments, play the evidence, or trigger an alert.
You will complete this loop with one recorded video, apply it continuously to a live stream, and see how the same foundation extends to desktop capture.

Set up VideoDB

Get an API key

  1. Go to the VideoDB Console.
  2. Copy your API key.
  3. Add it to your environment:

Install the SDK

Run the Node.js examples as ES modules by using an .mjs file or setting "type": "module" in package.json.

See, understand, and search a video

Start with one recorded video and complete the loop. By the end, a natural-language request will return timestamped matches and one stream containing only the relevant moments. Choose Python or Node.js, then run that language’s blocks in order in the same script or interactive session.

See: upload a video

Connect to your default collection, then upload a public video URL.
The media is now available to your application. VideoDB can also ingest local files, object-storage URLs, and other publicly accessible video URLs. Generate a playable stream for the complete uploaded video. Later, you will compile a second stream containing only matching evidence.

Understand: create visual and spoken artifacts

Next, create reusable, timestamped artifacts from what was said and what was shown. One understanding run can create both: spoken_words produces a timed transcript, while the vlm prompt controls which visual details become structured context. Understanding and indexing run as background jobs; the wait calls below continue when each result is ready.
Retrieve the completed analyzer handles:
Each artifact contains timestamped scenes. Inspect the first result from each analyzer:

Understand: index the artifacts

Artifacts record what VideoDB found. Index them once to make that context retrievable without rerunning the analysis. Create the transcript index:
Create the visual scene index:
VideoDB derives the index configuration from each artifact. You can choose explicit fields later when an application needs a specific schema for filtering or aggregation.

Act: find and play matching moments

Now ask for a moment - not a summary. Search both indexes by their returned IDs so the request uses the artifacts created in this run. Each returned Shot includes timestamps and the matched index text in its metadata.
Compile the matching moments into one playable HLS stream:
You now have timestamped results and a stream that plays only the matching evidence - ready to show to a user or pass to another part of your application.

See, understand, and act on a live stream

Files finish processing; streams keep producing new windows. For live media, understanding and indexing run continuously while the RTStream is active. Copy these blocks in order into one file. The first block opens main() in each language, the middle blocks continue it, and the final block closes and runs it.

See: connect the stream

Connect the sample stream in the default collection and retain it for the continuous workflow.

Understand: analyze each window

Use one continuous VLM output named scene for each five-second window.

Understand: index the scene output

Create a semantic index that receives each new scene record.
The Node.js index source identifies the continuous understanding run and its scene output explicitly.

Act: connect for live alerts

Open a WebSocket before attaching the alert so matches can reach this client.

Act: define the event

Give the condition a reusable prompt and label.

Act: create and receive the alert

Attach the event to the index, then print the first alert and its playable evidence URL.
The alert includes the event label, confidence, explanation, timestamps, and a playable stream URL for the triggering window.

Stop the live resources

Disable delivery, stop the continuous jobs and stream, then close the WebSocket.
RTStream understanding is continuous, so the first indexed records and alerts can take several time windows to appear. callback_url remains required when WebSocket delivery is enabled. This public sample uses https://example.com as a placeholder; replace it with an endpoint you control before using your own stream. Production applications should also run the same cleanup during shutdown or interruption.

Extend the loop to a live desktop

Desktop capture turns a screen, microphone, or system-audio source into an RTStream - with explicit permission from the person using the device. Your backend keeps the API key; the desktop client receives only a short-lived token. Desktop capture currently supports macOS and Windows. Install the desktop capture runtime:

See: create an authorized capture

Create a CaptureSession on your backend and mint a token that expires after ten minutes. Deliver only the session ID and token to the desktop client through your authenticated application channel.
Run the next block in a separate desktop process with that environment. This keeps the short-lived token out of logs, URLs, and source code. Request screen permission, select the default display, and begin streaming it.
Leave this desktop process running after it prints Capture started. Return to the original backend session and continue with Understand and Act; press Enter in the desktop process only after you finish searching the live capture.

Understand: index the live screen

While the desktop process remains active, fetch the session again on your backend. The captured display is now an RTStream, so it uses the same continuous understanding pipeline as any other live source.

Act: find a captured moment

After a few windows have been indexed, search the live desktop and generate a playable stream for each matching moment.

Stop live desktop processing

Stop the continuous index before its understanding run. Then return to the separate desktop process and press Enter so it stops capture and shuts down its local client.
The same live index can also drive events and alerts. When capture stops, stored channels can be exported as regular VideoDB media for playback and longer-term search.

Continue building

You have now completed the loop with recorded and live media, and seen how a desktop becomes another live source: see the media, turn it into timestamped understanding, and act on evidence.

Understanding artifacts

Configure analyzers, prompts, schemas, and multimodal inputs.

Search and retrieval

Choose semantic search, structured query, aggregation, Search, or Ask.

RTStream understanding

Build continuous understanding, retrieval, and alert workflows.