← All work

Teach Me This File

An AI tutor that turns a file and a teacher’s prompt into a chat that teaches: one small step at a time, with hints, sources and a progress path. The interface runs in Hebrew and in English.

Type
Independent product, deployed
Stack
React, Vite, Tailwind, Node, Claude, OpenAI, Gemini, Groq, OpenRouter
Status
Live demo - bring your own API key
Link
GitHub repository ↗
Teach Me This File - the lesson chat

Overview

A teacher uploads a file and writes a short prompt. The app opens a chat where an AI tutor teaches the file to a student. It teaches one small step at a time, asks one question, waits, gives a hint when the answer is wrong, and shows the part of the file behind each message. It does not summarize the file or paste it.

What I built

  • Lesson plan. One AI call turns the file and the teacher prompt into a plan: steps, each with a goal, one check question and the passages it uses. The plan and the student progress live in app state, not in the chat history.
  • Tutor chat. Streaming answers, a Stop button, a progress path, a Hint button with two levels, and a Source button that shows the passages behind a message.
  • File reader. Reads PDF, Word, slides, spreadsheets, EPUB, text and images in the browser. Scanned pages and photos, including iPhone HEIC, go to a vision model.
  • Providers. Anthropic, OpenAI, Gemini, Groq, OpenRouter or a custom address, with three model choices each. The key is sent with each request and is never stored or logged by the server.
  • Lesson options. Length, difficulty and language buttons, plus a free text box for extra requests. A Hebrew/English toggle switches the whole interface and its direction.

Design choices

  • Sources come from the plan. Each step lists the IDs of its passages, so the Source button cannot show something that the model invented. I did not use embeddings: they add a service, a cost and a way to fail.
  • The attempt limit is in code. The tutor ends each reply with a hidden control line. After three wrong answers the reducer ends the step, so a model that forgets the line cannot trap a student.
  • Scans are checked, not trusted. A page that is mostly one picture goes to the vision model, even if it has a short text such as a scanner stamp. If a scan has a long text layer, the model reads the picture too, and a layer that does not match is replaced.

How I tested it

  • 847 automated tests, written before the code. They cover the lesson state, the control line, every file reader, every screen and the key handling.
  • A 16-scenario eval with a real model. Claude Haiku 5.5 is the tutor. Fixed checks look for leaked answers and contradictions. A judge model applies written rules. A simulated student runs whole lessons. 14 of 16 scenarios pass in the final run.
  • What the eval found. After three wrong answers the tutor asked a new question instead of explaining. It said "advance" and then asked a follow-up. It gave a sad student an emergency number that was not needed. It used masculine Hebrew forms. Each one is fixed in the prompts and has a test.

Screenshots