How amantulsiyan/seekho-math-tutor works
MathMind is a web tutor that finds the first incorrect line in a student’s maths working, diagnoses a likely misconception, and guides the student through a leak-checked hint ladder. The photo workflow transcribes handwriting for student confirmation before deterministic SymPy verification; typed input can start directly. The tutor also supports adaptive practice and English, Hindi, and Hinglish. Edges reflect the sampled callers and README-documented UI flow; unsampled UI details and other internal calls are not inferred.
Main entry points: tutor.py Tutor state machine · main.py Web API · extractor.py Photo extractor · groq_provider.py Groq provider
Components 16
Student experience
- Web interface
static/app.js - Web API
app/main.py
Photo reading
- Photo extractor
app/extractor.py - Ink line locator
app/lines.py - LLM interface
app/llm/base.py - Groq provider
app/llm/groq_provider.py
Math reasoning
- Math line parser
app/parser.py - Solution verifier
app/verifier.py - Misconception diagnoser
app/diagnoser.py - Buggy rule library
app/malrules.py
Adaptive tutoring
- Tutor state machine
app/tutor.py - Hint ladder
app/hints.py
Language and safety
- Hint translation
app/i18n.py - Answer leak guard
app/leakguard.py
Other components
- Student
- Groq API
Connections 18
- Student → Web interface: uploads and replies
README.md - Web interface → Web API: calls endpoints
README.md - Web API → Photo extractor: extracts photos
app/main.py - Photo extractor → LLM interface: requests transcription
app/extractor.py - Photo extractor → Ink line locator: assigns photo boxes
app/extractor.py - Photo extractor → Math line parser: checks transcribed lines
app/extractor.py - Web API → Groq provider: creates provider
app/main.py - Groq provider → LLM interface: implements
app/llm/groq_provider.py - Groq provider → Groq API: sends model requests
app/llm/groq_provider.py - Web API → Tutor state machine: starts and updates
app/main.py - Tutor state machine → Math line parser: parses student work
app/tutor.py - Tutor state machine → Solution verifier: checks solution steps
app/tutor.py - Tutor state machine → Misconception diagnoser: requests diagnosis
app/tutor.py - Misconception diagnoser → Buggy rule library: tests candidate rules
app/diagnoser.py - Misconception diagnoser → Solution verifier: compares solution sets
app/diagnoser.py - Tutor state machine → Hint ladder: builds hint turns
app/tutor.py - Tutor state machine → Hint translation: localises messages
app/tutor.py - Tutor state machine → Answer leak guard: checks shown messages
app/tutor.py