How AI Tutoring Works: A Technical Look at SketchMind
SketchMind is an AI tutoring platform that generates lessons as a live stream of structured commands — not a static response, but a sequence of rendering instructions that arrive in real time as the AI reasons through your question.
The lesson streaming model
When you submit a question, SketchMind sends it to a large language model (LLM) with a structured output format. The LLM generates a lesson as newline-delimited JSON (NDJSON), where each line is a command:
write_text— renders an HTML paragraph, heading, or list with a typewriter animationdraw— streams SVG chunks that assemble into a diagram, revealed only when completespeak— triggers ElevenLabs TTS narration synchronized to the text appearing on screenwrite_latex— renders a mathematical expression using KaTeX
These commands arrive over a server-sent event (SSE) stream. The frontend processes each one sequentially, maintaining the narrative order the AI intended.
Why stream instead of returning a finished answer?
Three reasons:
- Cognitive load. Watching a proof draw itself forces active tracking of the logic. Reading a finished proof lets you skim past steps you didn’t fully understand.
- Perceived responsiveness. The first words appear within ~1 second. Users start learning before the full lesson is generated.
- Pacing control. The AI can vary the density of information — a complex diagram followed by a pause, then narration — in ways a static block of text cannot.
The infinite canvas
SketchMind renders lessons onto a 2D canvas with pan and zoom. Elements are placed in a grid of “spaces” and “columns” — the AI assigns each element a position, and the canvas grows to accommodate it. You can zoom out to see the full lesson structure, or zoom in on a specific diagram.
Sessions are serialized and stored so you can reload any lesson exactly as it was rendered.
Subjects and accuracy
SketchMind currently handles mathematics, physics, computer science, chemistry, history, economics, languages, and philosophy. Like all LLM-based systems, it can make errors — particularly in advanced mathematics. Always verify critical calculations with a second source.