SLIDES: 1. System Overview 2. Chunking & Vector Geometry 3. Client DOM Context Scanning
🧬 Cross-Lecture Semantic Vector Search (RAG)
How AI Assistants Retrieve Knowledge Across All Lectures & Readings via 768-D Vector Embeddings
STEP 1: INDEX CURRICULUM
Course Knowledge Ingestion
🎬 Video Transcripts
Lectures 1–11 with Timestamps & Subtitles
πŸ“„ Reading PDFs & Manuals
38 Papers in /Reading/files/ (Kallisto, Sleuth, FastQC)
πŸ’» Master R Scripts
Steps 1–8 (Code, Functions, Pipelines)
βœ‚οΈ Chunked & Vectorized
gemini-embedding-001 (768-D Vector Array)
STEP 2: SEMANTIC SEARCH
Vector Space Matching
Student on Lecture 1:
"How do I run tximport in R?"
πŸ“ Cosine Nearest-Neighbor Search:
β€’ Embeds question to 768-D vector
β€’ Matches semantic angle in Firestore space
β€’ Unlocks concepts across full curriculum
🎯 Top Semantic Match (0.89 Sim):
β€’ Lecture 4: Differential Expression
β€’ Step 2 Script + Soneson 2015 PDF
STEP 3: GENERATE & CITE
Grounded Answer + Links
⚑ Ask DIY (Gemini 2.5 Flash Response):
To import Kallisto transcript abundances into R, use tximport to summarize counts to the gene level:
txi <- tximport(files, type="kallisto", tx2gene=tx2gene)
Verified Citations:
πŸ”— [Lecture 4 - Differential Expression] (Step 2)
πŸ“„ [Soneson2015_tximport.pdf] (Section 2.1)
πŸ“ Mathematical Foundations: Chunking, 768-D Space & Cosine Matching
How continuous curriculum text is segmented, projected into high-dimensional geometric clusters, and matched by angular proximity
STAGE 1: SLIDING WINDOW CHUNKING
Boundary Preservation

Long transcripts are partitioned into overlapping windows so biological thoughts are never split across boundaries:

Chunk 1: Words 1 β†’ 300
"FastQC quality control, adapter trimming..."
50-word overlap βž”
Chunk 2: Words 250 β†’ 550
"...adapter trimming, pseudoalignment with Kallisto..."
50-word overlap βž”
Chunk 3: Words 500 β†’ 800
"...Kallisto index construction, tximport mapping..."
πŸ’‘ Why Overlap Matters:
Prevents sentences explaining key steps (e.g. tximport parameters) from losing context at chunk edges.
STAGE 2: HIGH-DIMENSIONAL SPACE
768-D Semantic Space Clustering
Dim 1 Dim 768 Dim 2 Cluster A: QC & Kallisto Cluster B: tximport & DESeq2 Cluster C: PCA & Heatmaps Cluster D: GSEA & GO Query Vector Q ΞΈ β‰ˆ 25Β°
Concepts with related biological meanings naturally cluster together in 768 dimensions.
STAGE 3: COSINE MATCHING
Angular Distance Metric
COSINE SIMILARITY FORMULA:
cos(ΞΈ) = (A Β· B) / (||A|| Γ— ||B||)
Range: [-1.0 to +1.0] (1.0 = Exact Match)
Query: "How do I run tximport?"
βž” Cluster B (L4 / Step 2): cos(ΞΈ) = 0.892 βœ“
βž” Cluster A (L1 / FastQC): cos(ΞΈ) = 0.412
βž” Cluster C (L6 / PCA): cos(ΞΈ) = 0.185
⚑ IN-MEMORY & FIRESTORE ENGINE:
Ranks all course chunks in <5 milliseconds to assemble the prompt.
🌐 Lecture Companion: Dynamic DOM Context Discovery
How the client-side controller scans the browser Document Object Model (DOM) to ground Ask DIY in the student's active video and section
1. BROWSER DOM (LECTURE PAGE)
Document Object Model Elements
<h1 class="project-title">
Ultra-fast read mapping with Kallisto
PAGE TITLE βž”
<h3 id="part-1">
Part 1 - Step-by-step walkthrough of FastQC
SECTION HEADER βž”
<iframe vimeo-id="410750113">
ACTIVE STREAM βž”
▢️
00:14:22 / 00:32:00
<a href="/Reading/files/FastQC_manual.pdf">
πŸ“„ FastQC User Manual (PDF)
LECTURE COMPANION
πŸŽ“ Tutor Mode: Active
πŸ’¬ Ask DIY
πŸ“ Notes
🎬 Videos
πŸ“š Resources
🎯 Active Context: Part 1 (FastQC Walkthrough) ⏱️ 00:14:22
What does the red line on this FastQC quality score plot mean?
πŸŽ“ Ask DIY Tutor (Grounded in Video @ 00:14:22):
At 00:14:22 in Part 1, the red curve traces the median Phred score across each base position. If it drops below Q20, what does that tell you about base call accuracy?
πŸ”— Source: [Part 1 Video Transcript (00:14:14-00:15:08)]
Ask a question about this lecture...
➀