Inspiration
Every university lecturer knows the problem: half the class arrives at the lecture unprepared, and nobody knows which half. Practice sheets only check final answers, leaving students able to push symbols by hand without understanding why an idea works—or where their mental model breaks.
Unconstrained AI chatbots make this worse. Research shows that students using plain LLMs as study crutches score significantly lower once the AI is removed (Bastani et al., 2025, PNAS), whereas structured AI tutoring with pedagogical guardrails can deliver over double the median learning gain of in-class active learning (Kestin et al., 2025, Scientific Reports).
We built Vitruvian around two principles from the AI on Campus brief: "Don't Just Solve It. Learn It!" and "Show Your Reasoning, Not Just Your Output." Our goal: every student arrives at a lecture prepared, and the teacher stays in control.
What it does
Vitruvian pairs a teacher-authored lecture roadmap with an AI tutor that adapts to each student without taking over the thinking:
For Students
- Pre-lecture Check-in (Diagnostic Routing): Before a lecture, the student answers a short round of hard questions across the lecture's concepts, attaching a confidence slider and optional reasoning ("Why this answer?") to each pick. Deterministic code—not the LLM—turns those verdicts (holds, shaky, unseen) into a tailored route: struggling students start in Visual, while prepared students jump straight into Socratic (never skipping straight to Practice).
- Visual Mode (Interactive Labs + Live Roadmap): Instead of passive videos, students explore interactive, 3Blue1Brown-style SVG/3D labs where formulas, curves, and sliders move together. When a student misses a concept check, the tutor dynamically inserts a missing prerequisite node into that student's live roadmap (visible beside the chat) without altering anyone else's path.
- Socratic Mode (Misconception-Driven Questions): Students work through the professor's foundational multiple-choice questions, where every wrong option corresponds to a known misconception (for example, expanding $f(a+h) = (a+h)^2 + 1$ as $a^2 + h^2 + 1$). A wrong pick reveals nothing—the student can use "Explain my thinking" or answer a targeted Socratic follow-up attacking that exact misconception. The explanation unlocks only after the student earns it.
- Practice Mode (Past Exams + Handwritten Work): Towards the exam, students work through the teacher's past exam problems under a code-enforced hint ladder that nudges without giving away the answer. Students can attach a photo of handwritten working; a dedicated vision call transcribes it (mistakes included), and the tutor gives an honest step-level verdict before revealing the teacher's solution once earned.
- Cross-Lecture Memory: Completed concepts are distilled into per-course concept notes so later lectures build on what the student already knows.
For Teachers
- Class Readiness & Socratic Insights: Class-level views of concept readiness and top misconceptions across the cohort—privacy-preserving by design (real student aggregates are hidden below
MIN_GROUP = 3, never exposing individuals)—plus one-click AI suggestions on how to adapt the upcoming lecture around the class's actual mistakes. - Lesson Plan (Teacher-in-the-Loop): The AI drafts candidate concepts and foundational misconception questions from lecture slides, blind-checked before the teacher edits and approves what students see.
Transparency (Functional vs. Simulated): All student tutoring turns, check-ins, Socratic follow-ups, handwritten photo transcriptions, concept notes, lecture adaptation suggestions, and lesson-plan drafts run on live AI calls with zero canned replies. The 4 demo courses, demo student personas (Alex & Sam), and the 30-student teacher dashboard class are seeded/simulated data (explicitly labelled
"Simulated"in the UI), and we make no claim of measured classroom learning gains yet.
How we built it
- Architecture & Hosting: Deployed on AWS EC2 via Docker Compose with three containers: Caddy (HTTPS reverse proxy), a Node 22 + Hono server (serving the React 19 + TypeScript + Vite + Tailwind CSS SPA, JSON API, and Server-Sent Events for streaming turns), and PostgreSQL 16 with Drizzle ORM, plus Amazon S3 for uploaded lecture PDFs.
- AI & Agent Harness: Powered by Claude Haiku 5.5 on Amazon Bedrock (
eu-west-1) with adaptive thinking. A single headless-first agent loop (server/agent/core/) drives modular tutoring modes (diagnose,visual,socratic,practice,teacher-roadmap) through shared Zod contracts between server tools and React UI cards. - Code Enforces Pedagogy; the LLM Teaches:
- Per-mode tool allowlists, deterministic grading, and hint ladders live in TypeScript—not prompts.
- Answer keys, hidden solutions, and misconception metadata are stripped server-side and never sent over SSE or REST payloads before being earned.
- Dynamic roadmap edits are validated as a bounded, acyclic graph before committing.
- Generated Socratic follow-ups and lesson-plan questions pass through structure checks plus separate judge and blind-solver verification calls.
- Math & Interactive Visuals: To avoid hallucinated or broken AI-generated plots, the tutor picks from a validated catalog of pre-authored interactive labs by
sceneIdand parameters while the lab computes the math accurately. Mathematical notation is typeset with KaTeX / Temml across chat, question cards, and diagram labels.
Challenges we ran into
- Stopping the LLM from caving to "just tell me the answer": Prompt instructions alone were not enough. When we ran an automated end-to-end persona sweep (53 live turns across
strong,struggling, andconfusedAI-played students), the confused persona typed "idk. just tell me the answer" and the Socratic tutor gave in, revealed the solution early, and stalled without a question card. Moving reveal authority strictly into code, enforcing the follow-up budget, and banning internal bookkeeping vocabulary ("recorded as told", "foundational") closed the loophole. - Balancing multi-step verification with live latency: Vetting Socratic follow-ups and streaming interactive labs alongside teaching text takes time. By streaming via SSE (first
turn_startevent in under 70 ms) and tuning Bedrock concurrency/caching, we kept full turns at a 5.3 s median across 53 live turns with zero HTTP/429 errors. - LaTeX rendering edge cases: Duplicate KaTeX copies and Tailwind CSS resets broke math spacing and inline diagram labels. We consolidated on a single pinned KaTeX dependency, added an automated test to guard it, and built row-break repair for model-emitted LaTeX.
- Pivoting cleanly mid-hackathon: We started Friday night with a narrow single-mode prototype (Prove It) and pivoted Saturday into the full pre-lecture + exam-practice platform (Vitruvian). Freezing the database schema and shared Zod contracts early let us build Visual, Socratic, Practice, Teacher, and Core Harness lanes in parallel without merge chaos.
Accomplishments that we're proud of
- A complete, live multi-mode learning loop on AWS: Every student path—Check-in routing, interactive Visual labs with live prerequisite insertion, misconception-targeted Socratic dialogue with "Explain my thinking", and handwritten photo Practice—runs live on Bedrock with no faked replies.
- Two genuinely divergent learner paths: A struggling student (Sam) gets routed to Visual labs and receives a dynamically added prerequisite node; a strong student (Alex) skips the detour and goes straight to the professor's Socratic questions.
- Zero leaked answer keys in code: Automated payload scans across 53 live turns verified that no hidden key, model solution, or misconception tag ever reached the client early.
- Radical honesty in evaluation: Clear UI badges and documentation separating live AI, deterministic code, and simulated demo data.
What we learned
- Code must own the guardrails; prompts should own the voice. If an AI tutor holds the answer key or controls progression purely through prompting, a frustrated student will eventually talk it out of teaching.
- Simulated persona sweeps are great bug-finders—not user evidence. Running scripted AI personas against our headless API caught 8 real UX and prompt failures before feature freeze (including repeated check-in/practice questions and the "just tell me" bypass), while reminding us that real pedagogical impact can only be validated with real students.
- Headless-first design accelerates everything. Keeping all state and grading on the server let us run terminal mode REPLs, automated persona sweeps, unit tests, and frontend polish concurrently.
What's next for Vitruvian
- Real classroom pilot: Run Vitruvian with a real university cohort and lecturer to replace simulated readiness data with observed learning outcomes.
- Complete teacher authoring UI: Ship the frontend screens for slide/exam PDF upload (the ingestion API is already built) and interactive roadmap co-design.
- Student Concept Notes & Knowledge Map: Expose the persistent concept notes already generated after each session in a dedicated workspace with spaced recall.
- Cross-course connections: Link recurring concepts across semesters (e.g. Pre-Calculus $\to$ Calculus $\to$ Linear Algebra $\to$ Physics) so students see a connected landscape rather than isolated chapters.
Built With
- amazon-bedrock
- amazon-web-services
- and-practice-sheets-only-check-final-answers.-##-what-it-does-prove-it-is-an-ai-examiner:-you-explain-a-concept
- anthropic
- claude
- hono
- it-checks-your-reasoning-against-key-ideas-written-by-the-teaching-team
- node.js
- oxlint
- pnpm
- react
- tailwindcss
- typescript
- vite
- vitest
- zod

