NoteForge AI
**NoteForge AI** is an autonomous **RAG (Retrieval-Augmented Generation)** knowledge extraction engine that converts YouTube videos and audio streams into interactive **study notes, quizzes, flashcards, and mind maps**. Built with a hybrid routing architecture combining `Gemini Cloud APIs` and local `Ollama` models, it delivers zero-latency transcript slicing and resilient multi-key rate limit management.
Technical Architecture & Engineering Overview
Detailed system design and core implementation
🧠 Autonomous YouTube Knowledge Synthesis Architecture
NoteForge AI addresses the high cost and contextual latency of processing long video transcripts by implementing an Enterprise Hybrid Multi-LLM Router. High-complexity tasks—such as single-shot synthesis of flashcards, deep chapter study guides, and comprehensive quizzes—are routed to Gemini 2.5 Flash. Lightweight structural tasks—such as Table of Contents extraction and mind map branch reorganization—are delegated locally to Ollama (qwen2.5-coder), minimizing cloud API costs while maintaining instant responsiveness.
⏱️ Deterministic Transcript Slicing vs. Vector Overheads
Traditional RAG architectures rely heavily on expensive external vector databases (such as Pinecone or Weaviate) to retrieve relevant chapter context, introducing latency and risk of chunk boundary misalignment. NoteForge AI solves this through Deterministic Timestamp Slicing. By extracting native YouTube chapter timestamps and aligning transcript boundaries mathematically, the system isolates exact transcript segments with zero millisecond latency, zero computational overhead, and guaranteed contextual accuracy without hallucinations.
🛡️ Enterprise Hot-Swap Key Rotation & State Persistence
To handle unpredictable API rate limits during batch playlist processing, NoteForge AI features a Round-Robin Multi-Key Pool with automated exponential backoff powered by Bottleneck. If Key A encounters a 429 RESOURCE_EXHAUSTED error, the engine marks the key with an exhaustedUntil timestamp and seamlessly hot-swaps to Key B without interrupting active generation. Furthermore, job state and chapter progress are persisted locally via Prisma and SQLite, allowing interrupted jobs to resume instantly at the exact missing chapter.
🎨 Dynamic Headless PDF & Mind Map Render Engine
NoteForge AI provides print-ready document exports through an integrated Puppeteer headless rendering pipeline. The system dynamically injects customizable runtime CSS themes (Modern Bento, Academic Serif, Corporate Blue, and High-Contrast Dark Mode) with strict page-break-inside: avoid layout guards for inline code blocks and Mermaid diagrams.
System Diagrams & Flow Visualizations
Interactive Mermaid architecture & execution flows
Core System Features
Key capabilities & architectural features
Autonomous YouTube RAG Processing
Extracts video transcripts and metadata to synthesize deep study guides, key takeaways, and flashcards in parallel.
Hybrid Cloud & Local Model Routing
Intelligently balances workloads between Gemini Cloud API for heavy synthesis and local Ollama models for structural indexing.
Deterministic Timestamp Slicing
Slices transcript chunks precisely matching chapter timestamps without requiring vector database indexing overhead.
Multi-Key Hot-Swap API Pool
Manages round-robin rotation across multiple API keys with automated backoff cooldowns on rate limits.
Dynamic Headless PDF Styling
Renders publication-ready PDF notes with custom glassmorphic, academic, and dark themes using Puppeteer.
Engineering Challenges & Solutions
Problem statements & resolution strategies
Handling API Quota Exhaustion During Long Video Processing
Synthesizing 2-hour video transcripts frequently exceeded single API key rate limits midway through generation.
Built a Bottleneck queue coupled with Prisma state persistence and round-robin key hot-swapping to guarantee uninterrupted resume capability.
Eliminating RAG Chunk Misalignment
Semantic chunking often split code examples and key concepts across arbitrary token boundaries.
Replaced vector chunking with deterministic timestamp slicing using YouTube chapter markers to isolate complete logical sections.
API Reference & Endpoints
REST API surface & route documentation
| METHOD | ENDPOINT PATH | DESCRIPTION | COPY |
|---|---|---|---|
| POST | /api/generate | Triggers autonomous transcript extraction and chapter synthesis pipeline | |
| POST | /api/mindmap | Generates interactive hierarchical mind maps using Ollama local models | |
| POST | /api/quiz | Synthesizes flashcards and multiple-choice quizzes from video context | |
| GET | /api/health | Returns active server status, key pool health, and Ollama connectivity | |
| POST | /api/pdf/export | Renders print-ready PDF notes via Puppeteer headless browser |
Key Code Modules & Architecture
Core file entrypoints and service responsibilities
server/src/services/youtube.jsExtracts raw transcripts and chapter timestamps
server/src/services/chunker.jsSlices transcript text by chapter boundaries
server/src/services/llm-router.jsManages round-robin API key rotation and model fallback
server/src/services/pdf-engine.jsApplies runtime CSS themes and renders print-ready PDFs
System FAQ & Technical Specifications
Frequently asked questions and core architecture details
Q: What technologies are used in NoteForge AI?
NoteForge AI is engineered using modern full-stack frameworks.
Q: What core engineering problem does NoteForge AI solve?
**NoteForge AI** is an autonomous **RAG (Retrieval-Augmented Generation)** knowledge extraction engine that converts YouTube videos and audio streams into interactive **study notes, quizzes, flashcards, and mind maps**. Built with a hybrid routing architecture combining `Gemini Cloud APIs` and local `Ollama` models, it delivers zero-latency transcript slicing and resilient multi-key rate limit management.
Q: How is 'Handling API Quota Exhaustion During Long Video Processing' resolved in NoteForge AI?
Built a Bottleneck queue coupled with Prisma state persistence and round-robin key hot-swapping to guarantee uninterrupted resume capability.
Related Systems & Case Studies
Explore similar technical architectures and projects