Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Reviewed c9c2f57 against its stacked base 9a201f0. Two reproducible issues in the new index path:
Verification: executed the actual TypeScript index module locally with mocked generation, including a 132-card happy path, omissions, stale source rejection, gap-local anchoring, unavailable citations, cancellation and isolated repair. Both findings reproduced without paid calls. Independently confirmed Verify #416 succeeded, including platform type/unit checks and integration. I did not rerun the full suite or live model comparison locally. The documentation appropriately distinguishes the single-video token comparison, incomplete topic coverage, preparation cost and estimated pricing from production evidence. |
Problem / Motivation
Whole-video summaries need both broad coverage and citations that land where each explanation begins. The React tutorial experiments showed that choosing a few relevant passages from a hierarchy could lose later lessons or point to an earlier, related exercise.
This PR adds an opt-in local implementation of the source-linked overview approach developed from those experiments. It depends on #178 and targets that branch. The application controls passage selection, coverage slots and citation validation. Fireworks generates the summaries and answers.
How the experiments led to this design
We started with RAPTOR-style recursive clustering and summarization. The React transcript produced 132 source passages, 25 semantic summaries and five top-level groups. The tree retained the source material, but selecting top-ranked nodes and representative source passages did not preserve every topic needed for an overview.
The final Alert exercise illustrates the problem. Its introduction is at segment 1996, about 1:14:21. A semantic group combined earlier Alert work, the Button exercise and the later Alert solution. Retrieval could supply the Button introduction or the solution around 1:16:28 while omitting the actual Alert introduction. The model could therefore return a valid caption ID that started at the wrong explanation.
Giving each group a representative passage and strengthening the prompt still left gaps. Another problem appeared even with the full transcript: some answers filled the twenty-block response limit with early lessons and stopped before the ending. A single capped outline could repeat that behavior. The application therefore needs to allocate coverage before answer generation, rather than relying entirely on relevance ranking or a prompt.
The resulting design separates three jobs: preserving source coverage, reducing it into a bounded whole-video outline, and resolving individual citation anchors. RAPTOR's retrieval implementation informed the initial experiment. GraphRAG global search provided a precedent for a separate whole-dataset synthesis path. This PR implements our transcript-specific adaptation, without embeddings or the UMAP/GMM clustering layer. The experiments did not establish that semantic clustering improved this overview path.
What changed
Added
platform/scripts/experimental-overview/index.tsfor construction, validation, retrieval and citation resolution, andcli.tsfor explicit local execution throughnpm run experiment:overview.Index construction
cl100k_basetokens and otherwise closing a passage once it reaches 160 tokens. A caption is never split merely to meet that target. The React fixture produces 132 passages.Retrieval and answers
Overview mode supplies all outline lessons plus up to ten original captions beginning at each anchor, deduplicated. The React run supplied eighteen lessons and 180 captions. Model-facing summary cards expose their citable anchor without source-range boundaries, avoiding the earlier prototype's confusion between a range boundary and a citation ID.
The answer returns one starting segment ID per block. The application rejects IDs outside the permitted anchors and resolves accepted IDs to exact original text, millisecond timestamps and a YouTube link at the segment's start. Summaries are derived evidence used for coverage; exact caption matching does not prove that every summary claim is correct. Missing outline anchors are reported as a structural diagnostic, not a semantic quality score.
%%{init: {"themeVariables": {"actorBkg": "#eef2ff", "actorTextColor": "#111827", "actorBorder": "#475569", "signalColor": "#475569", "sequenceNumberColor": "#ffffff"}}}%% sequenceDiagram autonumber participant App as Experimental command participant Model as Fireworks participant Source as Saved transcript App->>Source: Read original captions and hash source App->>Model: Source passages and local anchor neighborhoods Model-->>App: Source-linked cards App->>App: Validate coverage, anchors and quotes App->>Model: Cards in six chronological portions Model-->>App: Up to eighteen overview lessons App->>Model: Question, outline and original anchor captions Model-->>App: Answer blocks with starting IDs App->>Source: Resolve exact captions and playback linksThe experimental path prepares and reuses an outline before answering. The existing production path is retained unchanged.
Running and reusing the experiment
buildmakes paid model calls and saves the validated index. Source/model/format identity and prompt/schema/input fingerprints protect checkpoint reuse.retrievevalidates the saved index and exports overview input offline.answer --mode overviewuses that input.--mode fullsupplies the full usable transcript as a same-model control.--mode cardssupplies every source card with four captions per anchor for focused diagnostics; it is not top-k semantic search.Calls use the existing model factory, defaulting to DeepSeek V4.1 Flash with reasoning disabled. The command records usage, corrections and failures, propagates cancellation, and bounds each request to 150 seconds. Local checkpoints support resumed builds. Production lexical search, timestamp tools, routing, billing and storage are unchanged. Storyboards and production index lifecycle management are outside this PR.
Design and commands contain the limits and reproduction instructions.
Tests
The platform build passed. The unit suite passed 1,701 tests, including 26 new regressions covering source coverage, local anchor bounds, exact quotes, stale indexes, omissions, bounded correction, citation resolution and cancellation. Rebuilding and retrieving with credentials removed reused checkpoints without additional model calls.
A fresh live smoke comparison used the saved React transcript and the same question, model and answer schema for both arms:
This is the packaged command's isolated comparison, not a deployed-production or full agent/finalizer benchmark. It used about 76% less input and 22% more output. All eighteen overview citations matched the original caption text and timestamps.
The completed build retained twenty generation stages, including three card-correction calls: 53,718 input and 15,741 output tokens, estimated at $0.04107. All twenty-four recorded build/development calls, including earlier rejected outputs, cost approximately $0.05164. Checkpoints were reused across development runs, so this was not a clean-cache benchmark. At the observed answer costs and cache rates, the retained build cost would take roughly eight similar overviews to recover. One answer including index construction costs more than one full-transcript answer.
Remaining limitations: the overview still omitted Node/editor setup and Vite project creation despite their presence in the outline. Some lessons combine multiple topics under a broad starting citation. Structural coverage and exact caption resolution do not establish complete topic coverage or perfect semantic attribution. This remains an opt-in experiment pending broader evaluation and production lifecycle design.
Detailed validation and cost accounting distinguish earlier experiments from this implementation's checks. No new GLM, multi-video, Workers integration or production evaluation was performed for this PR, and nothing was deployed.