Retrieve a precise spoken or visual moment while retaining timestamps, speakers and media-version identity.
Audio and video retrieval with timecoded evidence
Make time part of the passage ID
Audio and video retrieval uses timed segments, transcript words and sometimes frame descriptions as searchable evidence. A transcript paragraph without a start and end time cannot support a jump to the original recording. Store media asset ID, version, track, speaker label, start and end milliseconds on every segment. Re-captioning or editing the recording changes the time map; keep the old version rather than silently reusing stale links. Asset identity must survive storage moves but change when the underlying cut changes.
Separate modalities in candidate generation
Transcript search works for spoken terms; frame descriptions or image embeddings may find a visual action with no spoken mention. Run each path within a budget, then combine candidates using calibrated ranks and overlap rules. A camera view of a valve does not prove that the narrator's pressure number belongs to that valve. Preserve which modality supplied each clue. Federated budgets prevent one long transcript from consuming every result slot.
Account for timing errors
Automatic speech recognition can mishear part numbers, names and negation. Speaker diarization can swap labels after cross-talk. Store word-level confidence or review status where available, and include a small playback margin around candidate spans. Avoid letting margins turn a thirty-second citation into an unrelated ten-minute clip. When the spoken answer is uncertain, retrieve nearby segments or abstain rather than silently repairing the transcript. Abstention should remain available after a high ranking score.
Check the answer at playback time
A timestamp is a pointer, not proof. The final claim should be checked against the media span and any displayed text within it. For a question about who approved a release, both speaker attribution and the words of approval matter. If the text says 'not approved', a frame showing a green button cannot reverse it. Keep transcript and frame citations separate when both are needed. Support checks must inspect the exact moment behind each claim.
Evaluate with time tolerance
Judge answer-bearing intervals, not just media IDs. Measure whether the right asset entered the candidate set, whether an overlapping interval appeared in the top window, and whether the final answer cited a span narrow enough to inspect. Include edits, repeated phrases, noisy speech, overlapping speakers and purely visual evidence. Report timing error and missing-evidence abstention separately. A result that finds the correct meeting but points nine minutes late should fail the timestamp test.
Worked contract
from dataclasses import dataclass
@dataclass(frozen=True)
class MediaSegment:
asset_id: str
version: str
start_ms: int
end_ms: int
speaker: str
transcript: str
def timed_matches(segments: list[MediaSegment], asset_id: str,
version: str, phrase: str) -> list[tuple[int, int, str]]:
matches = []
for segment in segments:
if segment.start_ms < 0 or segment.end_ms <= segment.start_ms:
raise ValueError("invalid media interval")
if segment.asset_id == asset_id and segment.version == version \
and phrase.casefold() in segment.transcript.casefold():
matches.append((segment.start_ms, segment.end_ms, segment.speaker))
return matches
meeting = [MediaSegment("release-briefing", "cut-3", 83000, 97000,
"release-lead", "The patch remains blocked."),
MediaSegment("release-briefing", "cut-2", 79000, 93000,
"release-lead", "The patch is approved.")]
assert timed_matches(meeting, "release-briefing", "cut-3", "blocked") == [
(83000, 97000, "release-lead")]
assert timed_matches(meeting, "release-briefing", "cut-3", "approved") == []Performance and operating cost
The baseline scans S segments in O(S) time and stores O(K) matches. A transcript term index narrows spoken candidates; visual embeddings add frame-sampling, index storage and ranking costs. Higher sampling density improves access to brief events but increases storage and search work. Evaluate timestamp recall against that cost, rather than indexing every frame by default.
Common Mistakes
- Returning a meeting title without a timecoded supporting span.
- Mixing transcript timestamps from one cut with video from another.
- Treating noisy automatic captions as verified words.
- Using a visual match to assert a speaker's words without checking the audio.
Validation drill
Judge 39 questions over six edited recordings. Include repeated phrases, overlapping speakers and silent visual events; measure asset recall, interval overlap, speaker accuracy and cited-span width.
