MathCrew

An open-source AI math tutor for kids, Grade 1–6.
Self-host today, cloud version coming soon.

4 AI Agents 3 Curricula 15 Badges Real-time Feedback Privacy-First
View on GitHub Quick Start
MathCrew Dashboard

Why MathCrew?

A multi-agent AI tutor that adapts to your child's learning pace, identifies mistakes, and makes math fun.

🤖

4 AI Agents

Manager analyzes history, Creator generates problems, Helper gives feedback, Analyst identifies misconceptions — all working together.

🎯

Adaptive Scaffolding

Wrong answers trigger error analysis (computational, conceptual, procedural, careless) and auto-generated practice problems.

📚

3 Curriculum Styles

Common Core, RSM (Russian Math), or Singapore Math — each with grade-specific scope and pedagogy.

🏆

Gamification

XP, 50 levels, streaks, 15 unlockable badges, and confetti celebrations keep kids motivated.

Problem Bank

Caches generated problems to save LLM calls. Same conditions? Instant problem, zero API cost.

📊

Dashboard & Analytics

Accuracy trends, per-topic performance, achievement overview — all visualized with Chart.js.

AI Agent Pipeline

Four specialized agents collaborate in sequence, powered by Google Gemini and Ollama.

🧠
Manager
Gemini 2.5 Flash
✍️
Creator
Gemini 2.5 Flash
💬
Helper
Ollama (local)
🔍
Analyst
Gemini 2.5 Flash

See It in Action

From login to dashboard — every step designed to keep kids engaged.

Login screen with student profiles New student setup with grade and curriculum selection Math problem displayed AI agent pipeline in progress Wrong answer with error analysis and scaffolding Correct answer with XP and achievement

Track Progress

Charts, stats, and achievements at a glance.

Dashboard with accuracy trends and topic breakdown 15 unlockable achievements

Get Started in 5 Minutes

All you need is Python and a free Gemini API key.

# Clone the repo
git clone https://github.com/freesoft/MathCrew.git
cd MathCrew

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install "crewai[google-genai]" starlette sse-starlette uvicorn python-dotenv

# Add your Gemini API key
echo "GEMINI_API_KEY=your_key_here" > .env

# Run!
python web_tutor.py
# → Open http://localhost:8000

🔒 Privacy-First Design

US federal law (COPPA, FERPA) places strict limits on how children's data can be collected and used in educational software. MathCrew is built from the ground up to give parents and schools full control.

🏠 Full Local Mode

Run all 4 agents on Ollama — student names, grade levels, answers, and learning history never leave your machine. No external servers, no data transmission, no legal gray area.

☁️ Cloud Mode

Gemini API paid tier does not use your data for model training and supports US region selection (free tier data may be used for product improvement). When cloud is necessary, use the paid tier to keep data private.

🛡️ Compliance-Ready

COPPA protects children under 13 from unauthorized data collection. FERPA ensures K-12 student data is used only for education. MathCrew's local mode and data controls are designed with both in mind.

Local Model Guide

Upgrade your local LLM for stronger math reasoning. No cloud required.

Model VRAM Math Best For
gemma3:4b ~3 GB Basic Low-end hardware
qwen3:8b ~6 GB Good 8 GB GPU
qwen3:14b ~10 GB Strong 16 GB GPU, recommended
deepseek-r1:14b ~10 GB Strong Math-specialized
qwen3:32b ~20 GB Closest to Gemini 24 GB GPU (RTX 4090)

Built With

Python
Starlette async
CrewAI
Multi-agent orchestration
Gemini 2.5
Primary LLM
Ollama
Local LLM
SQLite
Database
Chart.js
Visualizations