Building a Video Q&A System with RAG and Speaker Detection

vimeo · Media & Entertainment · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Video knowledge retrieval

Vimeo wanted viewers to ask natural-language questions of long knowledge-sharing videos and receive grounded answers, playable references, speaker-aware context, and follow-up questions without requiring full-video viewing.

Constraints:

Architecture

Vimeo built a transcript-first RAG system for video Q&A. It registers transcripts into a vector database at multiple levels: 100-200 word chunks, 500-word chunks summarized to 100 words, and a whole-video description. At query time, it retrieves relevant context for answer generation, uses a separate quote-finding prompt to produce playable references, detects speaker names through transition-based LLM votes, and generates answerable related questions with RAG.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  viewer[Viewer] --> video-qa-interface[Video QA Interface]
  video-transcript[Video Transcript] --> bottom-up-registration[Bottom Up Registration]
  bottom-up-registration --> vector-database[Vector Database]
  video-transcript --> speaker-detection[Speaker Detection]
  video-qa-interface --> retrieval-pipeline[Retrieval Pipeline]
  retrieval-pipeline --> vector-database
  retrieval-pipeline --> answer-generator[Answer Generator]
  retrieval-pipeline --> reference-finder[Reference Finder]
  retrieval-pipeline --> question-generator[Question Generator]
  answer-generator --> video-qa-interface
  reference-finder --> video-qa-interface
  question-generator --> video-qa-interface
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Viewer User asking questions, clicking generated questions, and playing cited video moments. Video QA Interface
Video QA Interface Chat interface that returns answers, references, playable moments, and suggested questions. Viewer, Retrieval Pipeline, Answer Generator, Reference Finder, Question Generator
Video Transcript Textual source derived from automatic captions and used instead of visual content for the initial implementation. Bottom Up Registration, Speaker Detection
Bottom Up Registration Creates bottom-level chunks, middle summaries, and whole-video descriptions with timing metadata. Video Transcript, Vector Database
Vector Database Stores transcript text, summaries, embeddings, word timings, and start/end timestamps. Bottom Up Registration, Retrieval Pipeline
Retrieval Pipeline Embeds viewer questions or answers and retrieves relevant transcript/summarized context. Video QA Interface, Vector Database, Answer Generator, Reference Finder, Question Generator
Answer Generator LLM prompt that answers the user's question from retrieved context. Video QA Interface, Retrieval Pipeline
Reference Finder Second prompt that finds transcript quotes and playable moments supporting the answer. Video QA Interface, Retrieval Pipeline
Speaker Detection LLM-vote system over speaker transitions to map numerical speaker IDs to names without facial recognition. Video Transcript
Question Generator RAG-based generator for initial and related questions that remain answerable from video context. Video QA Interface, Retrieval Pipeline

Data flow

A video transcript is chunked into bottom, middle, and video-level representations, embedded with timing metadata into a vector database, queried by the viewer's question, and passed to an LLM for answer generation. A second prompt locates transcript quotes for references, while speaker detection and related-question generation reuse retrieved/transcript context to improve navigation.

4 supporting quotes
“Figure 2. Diagram of how the Q&A system works. The video transcript is processed and saved in a vector database. When we get a question from the user, we retrieve the relevant context from the database and show it to the LLM to generate the final answer.”article, stated
“We start by a standard chunking of the transcript to groups of sentences containing 100 to 200 words (corresponding to 1–2 minutes of playback time).”article, stated
“Finally, we take all the textual representations we get from all levels and register them into one large vector database.”article, stated
“We use two prompts: one prompt that answers the question, followed by a second prompt that finds the relevant quotes in the transcript”article, stated

Why this architecture

The system uses RAG because video answers must be grounded in private/specific video content and because long transcripts are too slow and expensive to pass wholesale on every question. The multi-level registration exists because different viewer questions require different context windows.

3 supporting quotes
“It prevents you from generating hallucinated responses, since the answer is grounded in the context provided to the LLM.”article, stated
“The alternative would require the LLM to be provided with the full-length text for each instance of text processing.”article, stated
“answering the first two types of questions requires using large portions of the video or perhaps even the entire video”article, stated

Models used: large language models · ChatGPT 3.5 · vector embeddings

Scale

Alternatives considered (roads not taken)

Use visual information in the initial implementation

Rejected because: Vimeo chose transcripts first because captions already existed and knowledge-sharing videos were mostly answerable from speech.

“We decided to rely solely on the transcript of the spoken words in the video. We currently don’t use any visual information to build the summary, although we plan to add this in the future to enhance our product.”article, stated

Flat small overlapping chunks only

Rejected because: General and speaker questions require large portions or entire-video context, while detail questions need small context.

“answering the third type of question typically requires a small portion of the video, maybe just a couple sentences”article, stated

Facial recognition for speaker identity

Rejected because: The system intentionally uses transcript/audio transition evidence instead of facial recognition.

“we’re using only the transcript of the video to feed our video RAG and want to avoid using facial recognition methods”article, stated

One prompt for both answering and finding references

Rejected because: Testing showed better performance by separating answer generation from quote/reference extraction.

“separating the tasks of answering questions and finding references to the answers leads to a much better performance than trying to perform both tasks in the same prompt.”article, stated

Generate related questions from only the user's question

Rejected because: Closed-world video QA needs generated questions to be answerable from retrieved video context.

“if we just ask the LLM to create related questions given only the user question, we have no guarantee that those can be answered by our RAG-based chatbot.”article, stated

Patterns

rag-retrieval (retrieval)

Video transcripts are embedded into a vector database and retrieved as context for grounded video answers.

“the matches form a context for the LLM, which uses it to generate an answer to the question.”article, stated

context-compaction (retrieval)

Long transcript context is summarized into middle-level and whole-video representations to support broad questions.

“Then we take all the summaries and generate a description of the entire video, which focuses on the most important topics.”article, stated

prompt-chaining (generation)

The system uses separate prompts for answering and quote/reference extraction.

“one prompt that answers the question, followed by a second prompt that finds the relevant quotes in the transcript”article, stated

confidence-thresholding (speaker identification)

Speaker names are assigned only when aggregated LLM votes reach high confidence; otherwise the name is left unspecified.

“We prefer to leave the speaker’s name unspecified rather than attributing an incorrect name.”article, stated

synthetic-data-generation (engagement)

The system generates pregenerated and related questions from retrieved video context to guide viewers.

“we populate our chatbot with several pregenerated questions and answers.”article, stated

Tradeoffs

Initial video representation

Chose Transcript-only RAG over Immediate multimodal visual understanding.

Rationale: Automatic captions already existed, and transcripts answered most knowledge-sharing video questions.

“so there’s no need to implement anything new.”article, stated

Context representation

Chose Bottom-up multi-level transcript chunks and summaries over One fixed transcript chunk granularity.

Rationale: Different question types require detail, section, or whole-video context.

“at each level of analysis, you effectively enlarge the size of the context window.”article, stated

Speaker identification precision

Chose Leave speaker names unspecified when confidence is low over Always assign the most likely name.

Rationale: Wrong speaker attribution is worse than missing names for video Q&A trust.

“assigning a name to a speaker ID should only be done when there is a high degree of certainty in the accuracy of the identification.”article, stated

Reference extraction architecture

Chose Answer prompt followed by quote-finding prompt over Single prompt doing both tasks.

Rationale: Separating tasks improved performance and let the second prompt use original transcript text for exact quotes.

“The second prompt uses the original transcript text that was stored for it in the database, since it’s designed to find quotes that actually appear in the video.”article, stated

Gotchas (what bit them)

A single chunk size cannot answer all video-question types well.

Root cause: Some questions need details from a few sentences, while summaries and speaker questions need section- or whole-video context.

Resolution: Use bottom-up multi-level transcript registration with small chunks, summarized middle chunks, and full-video descriptions.

“The lower and middle levels are good for answering questions about specific details, whereas the middle level can also answer questions about entire sections or topics”article, stated

Speaker names are hard to infer from unstructured transcripts.

Root cause: Transcripts do not say who is speaking, and free speech includes names that may refer to non-speakers or nicknames.

Resolution: Cluster speaker turns, analyze transitions with multiple prompts, aggregate votes, and leave names blank when uncertain.

“Unstructured transcripts consisting of free speech often feature multiple name references in a single sentence or mention a speaker who isn’t included in the conversation.”article, stated

Combining answering and reference finding in one prompt degraded reference quality.

Root cause: The team suspected ChatGPT 3.5 capacity limits when performing both tasks together.

Resolution: Split answer generation and quote/reference extraction into two prompts sharing the same retrieved context.

“This is at least our observation when testing it on ChatGPT 3.5. We assume that the LLM suffers here from some capacity issues when trying to perform both.”article, stated

Related-question generation can suggest unanswerable questions.

Root cause: A closed-world video chatbot cannot answer questions that are merely related to the user's topic but absent from the video.

Resolution: Use RAG for related-question generation and require questions to be answerable from retrieved context.

“The questions can be answered from the given retrieved context. We don’t want to suggest an unanswerable question.”article, stated

Evaluation

Vimeo evaluated the system through experiments on question types, transcript versus visual content, chunking levels, speaker-name voting confidence, answer/reference prompt separation, and related-question answerability in closed-world video context.

Metrics: Question type coverage · Speaker-name identification confidence · Reference quote alignment · Playable moment relevance · Related-question answerability · Prompt-task separation quality

3 supporting quotes
“Several question types consistently popped up in our testing:”article, stated
“We prefer to leave the speaker’s name unspecified rather than attributing an incorrect name.”article, stated
“separating the tasks of answering questions and finding references to the answers leads to a much better performance”article, stated

Outcomes

The article provides architectural and qualitative details but not traffic, latency, or user-adoption metrics.

“The Vimeo video Q&A system can summarize the content of a lengthy video instantly, link to key moments, and suggest additional questions.”article, stated
“We currently don’t use any visual information to build the summary, although we plan to add this in the future”article, stated