Project · Quintessence

MathStar

The fifth essence, distilled into a senior maths teacher.

Essence

For the students who use it

MathStar is an AI tutor built for high-school mathematics — South African matric, Cambridge IGCSE and A-level, IB Diploma and UK GCSE — designed to behave less like a chatbot and more like a senior teacher who happens to be available at eleven o'clock at night.

Two modes shape every interaction. In Answer mode, MathStar produces a complete worked solution, every step laid out and reasoned. In Guide mode, it refuses to give the answer at all and instead asks the questions a teacher would ask, walking the student through their own reasoning until they arrive at the answer themselves. The first mode is for checking work; the second is for actually learning.

Upload a textbook chapter or a past paper and the tutor knows your context. Submit a hand-written attempt at a past paper and the system marks it, returning an annotated image with marks awarded, deductions and corrections. A wallet/credit system keeps cost predictable for families. The goal is the quality of a senior tutor, available the moment a student is stuck.

Visit MathStar Currently in development

Construction

For the engineers

Stack

Frontend
Next.js 15 · React 19 · TypeScript · KaTeX
API
ASP.NET Core 10 minimal API on .NET 10
Admin
Blazor Server (16-page management dashboard)
Database
SQL Server 2025 — with the new VECTOR data type for embeddings
AI
Google Vertex AI · Cloud Vision · Document AI
Imaging
SkiaSharp for annotated marked-paper rendering
Data access
Dapper · resilience via Polly
Testing
xUnit integration tests via WebApplicationFactory

Architecture

Clean, layered, interface-first. Domain → Application → Infrastructure → Data → API. Every external boundary is behind an interface, so the test rig can substitute fakes for Vertex, Cloud Vision, Document AI or SQL Server without ceremony. Public APIs return Result<T> rather than throw; exceptions are reserved for genuine, exceptional failure.

No-magic configuration. Every behavioural setting — tutoring tone, model selection, safety thresholds, credit pricing — lives in the database and is editable at runtime through the Blazor admin. Changing how the tutor speaks does not require a redeploy. This is essential for a system whose quality has to be tuned daily.

Three-tier cache against Vertex spend. Each question is served by walking three caches in order. First, a precomputed answer table — verified solutions for known past-paper questions. Second, a fuzzy semantic match against previously answered, near-equivalent questions using the SQL Server 2025 VECTOR column. Third, Vertex CachedContent for prompt-prefix reuse, so generation calls only carry the delta. Together these reduce per-question Vertex cost dramatically and tighten latency for the most common queries.

Safety-first content path. A topic classifier and content guardrails filter both inbound queries and generated output. A sampled human-review queue inspects a slice of each day's traffic so quality drift is caught before students see it. A nightly evaluation harness runs a fixed corpus against the current configuration and reports regressions against the baseline.

Notable details