U9 · Secondary
Video lesson RAG
A course platform for an online school where students ask questions about a lesson and get answers with clickable citations that jump the video to the right moment. Retrieval combines HyDE, hybrid search (vector + full-text) and reranking.
private
Engineering decisions
- Async ingestion: uploads go into a BullMQ queue and a worker in its own container extracts audio with ffmpeg, transcribes it with Deepgram and creates embeddings. PDFs follow the same path.
- Chunks of about 500 tokens with a 50-token overlap, keeping each chunk's start time for citations.
- Multi-stage retrieval: HyDE writes a hypothetical answer and searches with its embedding; vector (HNSW) and full-text (tsvector) results are merged with Reciprocal Rank Fusion; Cohere reranks the top 20 down to 5.
- Citations formatted as [Title, MM:SS] become buttons that seek the player to that point in the lesson.
- When the best score is below 0.65, the answer comes with a low-confidence warning. Repeated questions are served from a 24-hour Redis cache.
- Each stage (HyDE, search, rerank, transcription) is logged as a Langfuse span.
Stack
Next.js 16TypeScriptPostgreSQLpgvectorDrizzle ORMBullMQRedisOpenAICohere RerankDeepgram
What it shows
Online schools and course libraries with a lot of video content that want students to get answers about a lesson without leaving the player.
More projects
U5
ReachantB2B lead-list builder for Brazil and the US. It finds businesses on Google Places by industry and city, then enriches each lead with website, contacts and decision-maker. Includes an API and an MCP server for AI agents.
liveU6NutriAppPractice software for dietitians: patient records, meal plans, lab results and scheduling, with each practitioner's data isolated at the database level. AI reads lab reports, with mandatory review, and drafts a consult-support report.
liveU7DockPlus AI Client WebsitesFast, search-friendly, on-brand websites for small businesses in Brazil and the US, built with a repeatable process I wrote as a Claude Code skill that goes from the client's Instagram and Google Business Profile to deploy.
live