Inspiration

Math is taught with abstract symbols long before kids build intuition for what those symbols actually mean. Physical manipulatives like Legos are proven to help children feel concepts like volume and area before naming them. But physical blocks don't scale: there's no way to digitize the build, automatically derive the math from it, or give a teacher a window into 30 kids' understanding at once. We wanted to keep the hands-on "build it yourself" magic and add exactly the two things physical blocks can't do: instant math derivation, and a tutor that reasons with the child.

What it does

BrickMind is a browser-based, Lego-style brick builder. A student places 1×1×1 bricks on an isometric grid and stacks them across layers. As they build:

  1. The math is derived live from the structure Volume (number of bricks) and Surface Area (faces not touching another brick) update on every placement. The numbers come from a deterministic geometry engine, never from the AI.
  2. A Socratic AI tutor grounds itself in the actual build. Pressing "Ask BrickMind" sends the structured brick coordinates plus the computed math* to the model, which replies with exactly one guiding question and one small hint — age-appropriate, and never the direct answer. For example: "You've got 6 bricks if you stacked them into a tower instead of a flat row, would the volume change? Hint: volume is just how many bricks there are."

The core loop is: build → auto-compute → AI asks a question → student reasons → repeat. One scripted lesson anchors the demo: "Build a structure with exactly 6 bricks. Can you find its volume without counting one by one — and what happens to the surface area when you stack them differently?"

How we built it

  • Front end: Next.js 14 (App Router) + React. The builder is a hand-rolled isometric grid rendered in SVG — each brick is drawn as three cube faces with a painter's-algorithm depth sort, so structures read as 3D without the setup cost of Three.js.
  • Geometry engine: a pure, deterministic module. Volume = brick count. Surface area = for every brick, count the faces (of 6) with no adjacent brick. This is unit-tested against known shapes (a single cube = 6, a 2×2×2 solid = 24, and compacting bricks provably lowers surface area).
  • AI tutor (/api/tutor): a Next.js route handler that sends the structured state to Google Gemini's free API with a tight Socratic system prompt (one question + one hint, under ~55 words, no jargon, never the answer). It also ships with a built-in "demo mode" a deterministic fallback tutor so the app is fully live with zero configuration, and it automatically falls back if a live call ever fails.
  • State: everything lives in React state no database, no auth.

Challenges we ran into

  • Making a 2D canvas feel 3D. Getting the isometric projection, cube-face geometry, and depth sorting right so stacked bricks look correct from every arrangement took careful math and the same projection had to power the clickable placement cells, including only allowing bricks where they're supported.
  • Keeping the AI in its lane. We deliberately kept all math deterministic and client-side, and used the model only for Socratic tutoring on top of structured state. That's what makes the tutoring trustworthy and fast.
  • A demo that can't fail. Hackathon demos die on missing API keys and flaky networks. The mock-fallback tutor means the whole experience works offline, out of the box, while still upgrading to a real model the instant a key is present.

Accomplishments that we're proud of

  • A genuinely novel loop: the AI tutors a student about a spatial object the student physically constructed, using the exact coordinate data not a screenshot, not a generic prompt.
  • Real, tested geometry derived from arbitrary 3D placements, not a hardcoded answer key.
  • A kid-friendly, clean UI with real-time feedback that a child could actually use.
  • Zero-config resilience it runs live for any judge, immediately.

What we learned

  • Structured state beats screenshots for grounding an LLM: giving the model the coordinate JSON and pre-computed values makes its questions specific and reliable.
  • Scope discipline wins hackathons. Doing volume + surface area flawlessly in one scripted scenario beats half-building five features.
  • Designing for graceful degradation (mock fallback) is as important as the happy path when you're being judged live.

What's next for BrickMind

  • Teacher dashboard the real path to classroom adoption: see every student's build and understanding at a glance across a class of 30.
  • More concepts symmetry and pattern detection (the symmetry engine is already stubbed in the code), then fractions and area for younger grades.
  • Saved progress, accounts, and a library of lesson scenarios authored by teachers.
  • Adaptive difficulty, where the tutor tunes its questions to the individual student over time.

Built With

Share this project:

Updates

Submission history