M A T H V I Z
Verified-first math orchestration
MathViz is a conversational math solver that handles any advanced engineering mathematics problem — from Kreyszig-level probability to Fourier series — with every intermediate step verified by SymPy. Ask in natural language, get textbook-quality output with proofs you can trust.
Solve — natural language → symbolic computation pipeline
- Any query dynamically routed through NLP (NVIDIA NIM / Anthropic Claude)
- SymPy verification on every intermediate step — green badges show
VERIFIED - Step-by-step reasoning with numbered walkthrough
Render — textbook-quality math, not plain text
- KaTeX for all equations (inline
$...$and display$$...$$) - TheoremBox components styled like LaTeX
amsthmenvironments - Interactive Desmos and GeoGebra graphs
Stream — real-time gate-by-gate progress
- 6-stage Zod-validated pipeline: Input → Routing → SymPy → Symbol → Verify → Graph
- Live progress indicator as each gate completes
- Engine diagnostics panel with per-gate timing
Upload — scan textbook problems
- Paperclip icon to attach images (JPG, PNG, WebP)
- Vision-capable AI extracts the math problem from photos
┌──────────────┐
│ CommandBar │ natural language + image upload
└──────┬───────┘
│
┌──────▼───────┐
│ NLP Router │ NIM / Anthropic / Stub
└──────┬───────┘
│
┌────────────┼────────────┐
│ │ │
┌─────▼─────┐ ┌───▼────┐ ┌─────▼─────┐
│ SymPy │ │ Verify │ │ Graph │
│ Sidecar │ │ Steps │ │ Builder │
│ (8100) │ │ │ │ │
└─────┬─────┘ └───┬────┘ └─────┬─────┘
│ │ │
└────────────┼────────────┘
│
┌──────▼───────┐
│ Renderer │ KaTeX + Desmos + GeoGebra
└──────────────┘
Prerequisites: Node.js 20, Yarn, Python 3.10+
# Clone
git clone https://github.com/stussysenik/math-explainer-redwood.git
cd math-explainer-redwood
# Install JS dependencies
yarn install
# Set up the database
yarn rw prisma migrate dev
# Set up the Python sidecar
cd sidecar
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cd ..
# Configure environment
cp .env.example .env
# Add your API keys to .env:
# NVIDIA_NIM_API_KEY=...
# ANTHROPIC_API_KEY=...
# DESMOS_API_KEY=...
# Run everything (sidecar + Redwood dev server)
./scripts/dev.shOpen localhost:8920 and start solving.
Computation — step-by-step with verification |
Theory — KaTeX-rendered definitions |
Integration — symbolic result + graph |
Landing — minimal, focused input |
| Layer | Technology | Role |
|---|---|---|
| Framework | RedwoodJS 8.9 | Full-stack React + GraphQL + Prisma |
| Frontend | React 18 + Tailwind CSS 3 | Component rendering |
| Math | KaTeX | LaTeX equation rendering |
| Graphs | Desmos API + GeoGebra | Interactive graphing |
| NLP | NVIDIA NIM / Anthropic Claude | Natural language understanding |
| Symbolic | SymPy (Python FastAPI sidecar) | Computation + verification |
| Database | SQLite + Prisma ORM | Conversation persistence |
| Validation | Zod | Gate-by-gate schema validation |
math-explainer-redwood/
├── api/ # GraphQL API + pipeline
│ ├── src/lib/pipeline/ # 6-gate orchestrator (Zod-validated)
│ ├── src/lib/nlpRouter/ # NIM, Anthropic, Stub adapters
│ ├── src/lib/engines/ # SymPy client
│ └── src/services/ # Solve mutation + streaming
├── web/ # React frontend
│ ├── src/components/
│ │ ├── math/ # KaTeXBlock, MathText, DesmosGraph, GeoGebraGraph
│ │ └── solve/ # CommandBar, StepByStep, TheoremBox, GateProgress
│ └── src/hooks/ # useSolveStream, useExternalScript
├── sidecar/ # Python FastAPI (port 8100)
│ └── math_sidecar/
│ ├── routers/ # SymPy, Wolfram, Octave endpoints
│ └── services/ # DSPy router, clients
└── scripts/
└── dev.sh # One-command dev startup




