How harshalwaghare18/ai-math-mentor works
AI Math Mentor is a Streamlit JEE-math tutor with text, image, and audio inputs. The documented workflow turns user input into a parsed problem, routes it, retrieves relevant math knowledge, generates and verifies a solution, then presents an explanation and feedback UI. The README describes that six-stage agent pipeline, while the sampled app excerpt also shows an inline Groq-solving path; it does not show app-to-agent calls. OCR, transcription, knowledge retrieval, and memory are represented by their sampled implementations, but the excerpt does not establish that all are wired into the app’s runtime.
Main entry points: app.py Streamlit app · solver_agent.py Math solver · knowledge_base.py Math knowledge base · ocr_handler.py Image OCR
Components 16
Input and presentation
- Streamlit app
app.py - Image OCR
utils/ocr_handler.py - Audio transcription
utils/audio_handler.py - Trace and feedback
app.py
Solution pipeline
- Problem parser
agents/parser_agent.py - Intent router
agents/router_agent.py - Math solver
agents/solver_agent.py - Solution verifier
agents/verifier_agent.py - Solution explainer
agents/explainer_agent.py
Knowledge and memory
- Math knowledge base
rag/knowledge_base.py - Math reference docs
rag/kb_docs - Attempt memory
memory/memory_manager.py
External services
- Groq LLM and Whisper
- Tesseract OCR
- OpenAI embeddings and LLM
Other components
- Student
Connections 17
- Student → Streamlit app: submits problem
README.md - Streamlit app → Image OCR: extracts image text
README.md - Streamlit app → Audio transcription: transcribes audio
README.md - Streamlit app → Problem parser: passes input
README.md - Problem parser → Intent router: parsed problem
README.md - Intent router → Math solver: selects strategy
README.md - Math solver → Math knowledge base: retrieves context
agents/solver_agent.py - Math knowledge base → Math reference docs: indexes text
rag/knowledge_base.py - Math solver → Solution verifier: solution for review
README.md - Solution verifier → Solution explainer: verified solution
README.md - Solution explainer → Streamlit app: presents explanation
README.md - Streamlit app → Trace and feedback: renders trace
app.py - Streamlit app → Groq LLM and Whisper: requests completion
app.py - Streamlit app → Attempt memory: stores attempts
- Image OCR → Tesseract OCR: runs OCR
utils/ocr_handler.py - Audio transcription → OpenAI embeddings and LLM: requests transcription
utils/audio_handler.py - Math knowledge base → OpenAI embeddings and LLM: embeds documents
rag/knowledge_base.py