How emnamastouri/mathtutorai works
MathTutorAI serves verified Tunisian Bac mathematics exercises and Socratic tutoring, with a teacher workspace. The student workflow enters through the Streamlit interface and service, which serves a bank exercise or requests generation through the hybrid bridge; generated content is built from a mathematical skeleton, formulated, then checked before delivery. Separate branches cover tutoring, teacher tools, and learner progress. Relationships reflect the README and source-index references; unsampled implementation details are represented only where documented, so some links are intentionally omitted.
Main entry points: pipeline.py Hybrid generator · service.py Tutor service · teacher.py Teacher tools · streamlit_ui.py Streamlit interface
Components 22
App and service
- Streamlit interface
app/streamlit_ui.py - Tutor service
mtai/service.py - Exercise bank
mtai/bank.py - Hybrid bridge
app/hybrid_bridge.py
Exercise generation
- Hybrid generator
src/pipeline.py - Curriculum resolver
src/curriculum/resolver.py - Generator registry
src/generators/registry.py - Verified skeletons
core/verified_generator.py - LLM formulation
src/llm/formulate.py - Model provider
src/llm/provider.py - Bac example retrieval
src/rag/retriever.py
Verification
- Symbolic verifier
core/sympy_engine.py - Post-formulation gates
src/verification/post_llm.py - Claim verification
src/verification/claims.py - Figures and tables
core/figures.py
Tutoring and learning
- Socratic tutor
src/tutor/socratic_tutor.py - Answer leak guard
mtai/guard.py - Learner memory
src/memory/learner_memory.py
Teacher workspace
- Teacher tools
mtai/teacher.py - Teacher agent
core/teacher_agent.py
Other components
- Student
- Teacher
Connections 25
- Student → Streamlit interface: uses
README.md - Teacher → Streamlit interface: uses
README.md - Streamlit interface → Tutor service: calls
app/streamlit_ui.py - Tutor service → Exercise bank: checks first
mtai/service.py - Tutor service → Hybrid bridge: builds system
mtai/service.py - Hybrid bridge → Hybrid generator: runs generation
app/hybrid_bridge.py - Hybrid generator → Curriculum resolver: resolves scope
src/pipeline.py - Hybrid generator → Generator registry: selects family
src/pipeline.py - Generator registry → Verified skeletons: maps generators
src/generators/registry.py - Hybrid generator → Verified skeletons: builds skeleton
src/pipeline.py - Hybrid generator → Bac example retrieval: retrieves examples
src/pipeline.py - Hybrid generator → LLM formulation: formulates exercise
src/pipeline.py - LLM formulation → Model provider: requests text
src/llm/formulate.py - Hybrid generator → Post-formulation gates: checks output
src/pipeline.py - Post-formulation gates → Symbolic verifier: verifies contract
src/verification/post_llm.py - Post-formulation gates → Claim verification: checks assertions
src/verification/post_llm.py - Student → Tutor service: requests tutoring
README.md - Tutor service → Socratic tutor: delegates dialogue
mtai/service.py - Socratic tutor → Answer leak guard: guards replies
README.md - Socratic tutor → Learner memory: uses memory
src/tutor/socratic_tutor.py - Teacher → Teacher tools: uses
README.md - Streamlit interface → Teacher tools: opens workspace
app/streamlit_ui.py - Teacher tools → Exercise bank: validates exercises
mtai/teacher.py - Teacher tools → Figures and tables: renders figures
mtai/teacher.py - Teacher tools → Teacher agent: delegates generation