Tokai
No student left behind
About The Project
# Tokai ### Your own Socratic AI teacher — voice, whiteboard, and all.
Tokai is an immersive, one-on-one AI classroom. You tell the teacher what you want to learn — and it takes over. It speaks to you in a **Socratic style**, draws diagrams on a **live whiteboard** in real-time, connects concepts with arrows, and adapts based on what you say and how you react.
You can interrupt with voice questions, circle something confusing on the board, or flash a thumbs-up to say "got it, move on." When the lesson ends, the teacher auto-generates a **flashcard quiz** and a **spoken session summary**.
> **No slides. No passive videos. Just a great teacher, built for you.**
---
## The Problem
Online learning is broken in a fundamental way: **it's passive**. Lecture videos, slide decks, and static notes all put the student in "receive-only" mode. The best learning happens in conversation — when a teacher draws something out, asks you a question, and adjusts when you're lost.
That kind of teaching doesn't scale. Until now.
### Accessibility Tokai also tackles a gap most edtech ignores: accessibility. * **Narrated Actions:** The teacher narrates every mark it makes on the board. * **Spatial Audio:** Sound maps to the canvas — content drawn on the left is heard from the left — giving non-sighted students a sonic model of the whiteboard. * **Hands-Free:** The entire interface is operable via voice and gesture.
---
## How We Built It
Tokai is wired together across four core services:
### 🎙️ Voice Pipeline — Agora Conversational AI Agora's ConvoAI handles the full real-time voice loop: * **Speech-to-Text** from the student. * **Routing** to the Custom LLM Server. * **Text-to-Speech** back to the student with sub-second latency over Agora's SD-RTN.
### 🧠 Brain — Custom LLM Server (Python + Gemini) Our Custom LLM Server sits between Agora and **Gemini 3 Flash**. It wraps each student message in a Socratic teacher system prompt, injects live context (gesture state, canvas annotations, lesson history), and calls Gemini with whiteboard tool definitions. When Gemini fires a tool call like `draw_shapes(...)`, the server pushes commands to the frontend via **Agora RTM**.
### 🎨 Whiteboard — tldraw + Next.js The frontend is a **Next.js 16 / React 19** app. The whiteboard is built on **tldraw** — an infinite canvas that renders the teacher's shapes and labels in real-time. Students can annotate directly; the frontend detects these shapes, captures a screenshot, and feeds it back to the LLM as visual context so the teacher can "see" what is being pointed at.
### ✋ Body Language — Gesture Server (Python + MediaPipe) A lightweight Python WebSocket server runs **MediaPipe** hand tracking locally, classifying gestures (thumbs up, open palm, head shake). The state is injected into every prompt so the teacher knows when to slow down or move on.
### 🔊 Spatial Audio — Web Audio API A `StereoPannerNode` is applied to the Agora remote audio track. As the teacher draws at different X positions on the canvas, the audio pans to match, giving the whiteboard a physical presence in sound.
---
## Technical Stack **Next.js 16** · **React 19** · **Tailwind v4** · **excalidraw** · **Agora RTC/RTM/ConvoAI** · **Gemini 3 Flash** · **Python Flask** · **MediaPipe** · **Web Audio API**
Reviews
- No written reviews yet.