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.
Set up VideoDB
Get an API key
- Go to the VideoDB Console.
- Copy your API key.
- Add it to your environment:
Install the SDK
.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.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.
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: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 returnedShot includes timestamps and the matched index text in its metadata.
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 opensmain() 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 namedscene for each five-second window.
Understand: index the scene output
Create a semantic index that receives each newscene record.
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.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.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.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.