2026-04 · AI · Agents · Education · RAG · Video

AI Learning Assistant — Text-to-Video Tutor

AI Learning Assistant — Text-to-Video Tutor

The problem

Two pain points sit on either side of "I want to learn this":

  1. The reader's side. A textbook chapter or a stack of PDFs is fine for a determined student, but most people don't know what to learn first. There's no learning path baked into the material.
  2. The teacher's side. Good teachers spend hours turning notes into a lecture video — scripting narration, finding diagrams, timing pacing, cutting captions. The step from "I know what I want to teach" to "I have a video of it" is where the energy runs out.

The idea

Treat written notes — or even a plain-text prompt — as a source, not a script. Build two cooperating systems:

  • A learning-path builder that reads documents, extracts knowledge points without duplicates, sequences them, and outputs a personalised plan with milestones.
  • A video tutor that takes any one of those knowledge points and turns it into a fully narrated, illustrated, bilingual lecture video.

What it does

  • Document → personalised course. Upload PDFs or DOCX. The system chunks them, embeds them into FAISS, extracts knowledge points, deduplicates them, sequences them into a learning path with milestones and assessments, and stores everything for later use.
  • Knowledge point → on-demand content. Click a KP; the system runs semantic search against the FAISS store for that source and a "Senior Teacher" persona generates explanation, examples, and practice material grounded in the original document.
  • Knowledge point → tutorial video. A multi-agent pipeline turns the KP into a narrated, illustrated Manim video — bilingual (EN/中文), with synced captions and exportable SRT/MP4/VTT.
  • KYC-driven personalisation. A LangGraph-based KYC pipeline tracks learner state across sessions: known concepts, knowledge gaps, learning style, available time.

How it's built

  • Pure LangChain backend. Document loaders (PyMuPDF, Docx2txt) → RecursiveCharacterTextSplitter (2000 / 100) → FAISS vector store with OpenAI embeddings → MMR semantic search.
  • Hybrid Contextual Batching for KP extraction. Small documents go through a single holistic LLM call; large ones go through context-aware batches where each batch is prompted with the previous batch's extracted KPs so duplicates fail at extraction time, not after.
  • Multi-agent video generation. Separate agents own Content (script + structure), Visual (Manim scenes, diagrams), and Error Handling (Manim syntax validation, retries). An MCP-style server ecosystem gives them one shared tool surface for rendering, audio synthesis, storage, and curriculum tooling.
  • AsyncIO streaming pipeline. Slide generation, audio synthesis, and scene rendering run in parallel through a dynamic worker pool — what used to take ~10 minutes drops to under 2.
  • Multi-model orchestration. GPT-5 / GPT-4 / Claude / Whisper, each routed where they're strongest, with fallback routing, exponential backoff, and AI-driven syntax correction for Manim errors.
  • FastAPI service. Endpoints for single-file processing, multi-file ingestion, KP content generation, learning-path retrieval, and processing status.

What I learned

  • De-duplicate at extraction time, not after. Cleaning up duplicate KPs post-hoc is fighting against the wrong layer; feeding context into the prompt is what actually fixes it.
  • The hardest part is pacing. A video that generates "perfectly" at double speed is unwatchable. Pacing is a first-class design concern, not an output setting.
  • Teachers care about structure, not voice. They tolerate a synthetic voice — they don't tolerate missing pauses, missing callouts, or "let's come back to this later" never coming back.
  • Export real formats from day one. SRT, MP4, VTT, JSON learning paths — exporting to real production formats turns a demo into a tool.

Where it goes next

Pause-to-quiz moments embedded inside the video, generated from the same source notes. A KYC-aware "next lesson" recommender that uses the Track Record of completed milestones to choose what to show next.

© Yuhan Cheng — Personal Portfolio