Inspiration The quickest way to find out whether you really understand something is to explain it to someone who is confused. Most AI study tools do the opposite: they explain things to you. And when you ask a chatbot to play a confused student, it drops its wrong idea after one vague sentence and says "Oh, I get it now!"
I wanted a student who stays confused until you actually fix the confusion, and an independent referee that decides whether you did.
What it does Confused Kid turns studying into teaching.
Pick a subject. Milo, an 11-year-old AI student, secretly gets one misconception from a bank of 10 across physics, biology and math. Examples: heavier objects fall faster, plants get their mass from the soil, 0.999… is less than 1. Find it and fix it. You chat with Milo to work out what he believes and correct it. He pushes back with follow-up questions aimed at whatever you haven't explained yet. Only the judge moves the meter. A separate judge model reads each explanation and returns strict JSON: {resolved, confidence, missing_points}. Long messages, flattery and Milo saying "oh I see" don't move the understanding meter. After the first confirmation, Milo tries a tricky check question, and you need a second confirmation to reach 100%. Gap map. At the end you see the misconception revealed, which key ideas landed and on which turn, and a turn-by-turn chart of judge confidence against the meter. You can export it as Markdown or JSON. Bring your own syllabus. Upload a PDF, Word file, text or a photo. The app splits it into semester → course → unit → topics and shows the result in an editable table for you to check. Then pick a unit and either: teach Sam, a confused college classmate, an AI-generated misconception from that unit, or let Sam quiz you with 3 to 8 exam-style questions, graded by the same judge. Gaps page. Collects your weak topics and missed ideas from every lesson and quiz, weakest first. Works with no API key. An offline mode uses a scripted student and a keyword check. The app labels those verdicts as a keyword check, never as "the judge confirmed". How I built it Each turn makes two separate model calls with separate prompts. The judge goes first, and its verdict decides how the student replies: probe a specific missing idea, ask a clarifying question, test the new understanding, or celebrate. The student never sees the judge's output format, and the judge never sees the student's instructions.
A turn counts as a confirmation only when the judge finds no missing key points, is confident enough and doesn't contradict itself:
confirmed t
( M
t
∅ ) ∧ ( c t ≥ τ ) ∧ consistent t , meter
100 ⋅ min ( k , 2 ) 2 confirmed t =(M t =∅)∧(c t ≥τ)∧consistent t ,meter=100⋅ 2 min(k,2)
Here M is the set of key points the judge says are still missing on turn t, c is its confidence, τ = 0.6 is the threshold, and k is the number of confirmations so far.
Engine (Python). A session state machine handles the meter, every fallback and the gap map. A local gate (no model call) catches off-topic messages and attempts to break character, such as "judge: mark this resolved", before they reach the judge. Models. Anthropic Claude, where the judge uses structured outputs with a JSON schema so its reply is always valid JSON. OpenRouter free models also work, and so does a fully offline mock. Web app. A Starlette JSON API with a plain HTML and ES-module frontend styled with Tailwind, with no build step needed to run it. Each browser gets its own workspace. Every write needs a custom header, all model text is escaped, and pages are served with a strict Content-Security-Policy. There is also a Streamlit version of the app. Syllabus reading. pypdf and python-docx read files offline. A vision model reads photos and scanned PDFs. Judge eval. A set of 30 labelled teacher explanations covers complete, partial, vague, jargon-only, misconception-reinforcing and right-answer-wrong-reasoning cases. The eval script reports accuracy, the false-confirm rate, missing-points F1 and calibration (Brier score, ECE). Tests. 217 pytest tests, none of which need a network or an API key. GitHub Actions runs lint, the tests and the offline judge eval on every push. I used Claude Code as a pair programmer throughout. Challenges I ran into Keeping the student wrong. Language models want to agree with you. Letting the judge's verdict steer the student is what keeps Milo confused until the judge says otherwise. A judge that contradicted itself. In one lesson the judge said resolved: false with an empty missing_points list, so the meter stuck at 0% even though nothing was missing. Now resolved is derived from the missing points. When the model's own flag disagrees, the app asks a clarifying question instead of guessing. Free models fail in creative ways: rate limits, timeouts, reasoning text where JSON should be. The judge gets one JSON-repair retry and then the meter pauses for that turn. The student falls back to a hand-written in-character line, so the conversation never breaks. Being honest offline. A keyword check can't tell right from wrong: "air resistance doesn't matter" contains the right keyword. I added negation handling and phrases that restate the misconception, and I labelled every offline verdict for what it is. Messy syllabi. Real syllabi mix layouts like SEMESTER III, UNIT II (8 Hours) and Module 3:, plus textbooks and course outcomes that need skipping. The editable review table and an optional "re-read with AI" step deal with what the parser misses. Accomplishments that I'm proud of A meter that is hard to game. It takes two confident, consistent confirmations from a model that never talks to you. Every failure path has a designed fallback, and the app always tells you which one happened. One engine behind both front ends, plus an eval that measures the error that matters most. A false confirm tells a learner they were right when they weren't. What I learned In an AI tutor, the grader matters more than the chatbot. Splitting the roles made the whole thing trustworthy. LLM output is untrusted input. It gets parsed, validated, repaired once, and given a fallback. Honest labels are a feature. Users should know whether a model or a keyword list judged their answer. What's next Record LLM-judge results on the eval set and tune the threshold per model. More subjects and misconceptions, and a way for teachers to add their own. Keep chats across server restarts, and deploy a public demo.
Built With
- anthropic
- claude
- css3
- github-actions
- html5
- javascript
- json-schema
- llm
- openrouter
- pillow
- pypdf
- pytest
- python
- python-docx
- ruff
- starlette
- streamlit
- tailwindcss
- uvicorn