// post · ai-tutor-that-teaches-and-actually-understands-you
I Built a Full-Stack AI Tutor That Talks, Teaches, and Actually Understands You (NexTutor)

And honestly, it lowkey changed how I think about education forever
So picture this: it's 2 AM, I'm staring at my laptop screen, and my brain is absolutely fried. I've been trying to wrap my head around this one concept for like, four hours. Watched every YouTube video. Read every article. My tabs are a mess. And I'm sitting there thinking...
Bro, why can't I just have a smart friend who explains this to me right now? Someone who actually gets my vibe, won't judge me for asking the dumbest questions, and can literally draw stuff out on a whiteboard while talking?
And then it hit me. What if I built that friend?
Spoiler alert: I did. And it's honestly the coolest thing I've ever made.
So what even is NexTutor?
Okay so imagine ChatGPT, but it actually teaches. Not just spits out answers. I'm talking about an AI tutor that talks to you with real voice convos, draws on a whiteboard while explaining stuff, remembers what you learned and builds on it, actually adapts to your pace and learning style, and is available 24/7 because your brain doesn't have office hours.
And the craziest part? I built the whole thing from scratch and dropped it for free.

The problem that was eating me alive
Let's be real for a second. Education is absolutely broken in like, a million ways.
One-size-fits-all that fits no one. Teachers are out here doing the absolute most, juggling 40-50 students at once. Some kids get it in 5 minutes, some need 2 hours. And it's not the teachers' fault, they're literally superheroes working with what they've got. But the system is lowkey a mess.
The raise your hand anxiety. Not everyone feels comfortable asking questions in front of a whole class. I've been that kid sitting there confused as heck but too shy to speak up because embarrassment hits different when everyone's staring at you.
No instant feedback. You study something, get stuck, send an email to your prof, and wait 3 business days for a reply. By then you've either given up, forgotten the question, or moved on to something else. The momentum is gone.
Passive learning equals passive brain. Sitting and watching lectures is not active learning. We all know this. But most platforms still act like YouTube is a complete learning solution. It's 2025 and education still feels like it's stuck in the 90s.
Zero personalization. If I learn visually, why am I reading a 400-page textbook? If I need real-world examples, why am I only getting definitions? It makes no sense.
I was tired of it. So I built something better.

The vision: education that actually works
I wanted to flip the entire script. Imagine a platform where you are in control of your learning, AI adapts to you not the other way around, learning is active and interactive and actually fun, progress is visible and celebrates your small wins, and it's accessible to anyone with an internet connection with no paywalls.
That's NexTutor.
Okay but what actually makes it special?
Here's where I start geeking out because the tech behind this is genuinely clean.
Live AI lectures with a face. Forget chatbots with their boring text responses. NexTutor connects you to a live AI session with real-time voice interaction. You talk, the AI talks back. It's like having a tutor sitting right next to you.
But I didn't stop at voice. I gave the AI an actual personality, a Live2D animated character that moves its mouth while talking with real-time lip sync powered by WebAudio, has 30 plus voice options ranging from cool professor to chill study buddy to energetic teacher, and maintains eye contact and feels human-ish.
It's subtle but makes the experience 10x more engaging than talking to a blank screen. Trust me, when the character's mouth moves in sync with the voice, your brain lowkey forgets it's not human.

RAG-powered contextual teaching. Here's the thing, generic AI models like ChatGPT hallucinate. They make stuff up confidently. And when you're teaching someone, you cannot have that. Imagine asking a question and the AI just invents an answer. Nightmare.
So I built a full retrieval-augmented generation system. Every chapter's content gets chunked into embeddings, 768-dimensional vectors if you're into that nerdy stuff, stored in a Neon PostgreSQL database with HNSW indexing for lightning-fast semantic search. When you start a lecture, the AI retrieves only the relevant content chunks and teaches from your actual curriculum, not from random internet data.
Basically, the AI can't make stuff up. It has to answer from the source material. And if the content isn't there, it says I don't know instead of hallucinating. Game changer for education.
Structured curriculum because chaos isn't learning. I organized content the way schools should be organized. Educational Board to Class to Subject to Unit to Chapter.
Each chapter has main content, author bio so you know who's teaching you, workshop questions to test yourself, and estimated duration so you can plan your time.
It gives students a clear path forward. No more jumping around randomly wondering what do I study next.
Interactive whiteboard. Some things you just can't explain with words. I added a whiteboard tool that lets you draw your doubts visually, the AI draws explanations back, sketch diagrams formulas and flowcharts, all in real-time during the lecture.
Ever seen someone draw a free-body diagram and actually get it? That's what I wanted. Visual learning hits different.

Progress tracking because seeing green bars equals dopamine. I'm a sucker for progress bars not gonna lie. Seeing that green 100 percent makes my brain release the happy chemicals.
NexTutor tracks chapters completed, time spent studying, topics mastered, and performance metrics. It even gives personalized recommendations based on your weak areas. So instead of guessing what to study next, the AI literally tells you. No more wasting time on stuff you already know.

The tech stack for the fellow devs
I know some of you are reading this for the code, so let me cook real quick.
Frontend: Next.js 15 with App Router, React 19, TypeScript 5 strict mode with no anys allowed in my house, Tailwind CSS 4 for that clean modern UI, Radix UI for accessible components, and Framer Motion plus React Spring because animations make everything better.
Backend and database: tRPC 11 for end-to-end type safety, Drizzle ORM for TypeScript-first SQL-like queries, Neon Database for serverless Postgres so I don't need to manage infrastructure, and Better Auth for authentication with multiple providers.
AI and real-time: Google Gemini for the actual tutoring magic, WebRTC for real-time audio coming soon with multi-user sessions, and TanStack Query for caching and data fetching.
Dev tools: Zod for schema validation, ESLint for code quality, and Docker for containerized deployment.
Architecture highlights that make me proud
Let me flex a bit on the system design because I genuinely love how this came together.
Live AI session layer:
The LiveSession class handles session resumption so you can pick up exactly where you left off even after a disconnect, ephemeral tokens so API keys never touch the client which is a big security win, automatic reconnection so if the connection drops it reconnects and restores context, and GoAway handling so server-initiated disconnects are handled gracefully.
Basically, you can run a 4-hour lecture and the AI won't forget what you were talking about. That continuity is huge for deep learning.
Tool registry pattern
I built a modular system where AI tools self-register. Add a new tool, just create a file in the tools folder. No need to touch the core session logic. Clean af.
Clean, extensible, and zero spaghetti code. Adding new features doesn't break existing ones.
Embedding pipeline. The entire knowledge base is embedded using a text embedding model. Each chapter gets broken into chunks, converted to vectors, and stored with HNSW indexing. Fast semantic search equals fast AI responses. No waiting around.