Inspiration
The report card said "Nested JSON Parsing: 3/10". His mother had no idea what that meant, or what to do about it.
That is the whole problem, in one line.
Every Pakistani student has three people in their corner, and two of them are flying blind. The teacher has forty submissions and two hours, so she can grade them but cannot work out why one student keeps failing the same way. She writes a number and moves on. The parent gets that number, and for a lot of parents in this country, and we mean this without any condescension, "Nested JSON Parsing: 3/10" is not information, it is noise. They cannot help, because nobody told them what to help with. So the conversation at home becomes "parho, tumhare number kharab hain," which helps nobody.
And the student sits in the middle, holding a score with no diagnosis attached to it.
We built MindRion to put an actual brain between those three people. The same student submission, read once, and spoken back to all three in three completely different registers: what the teacher should fix, where the student went wrong, and one thing a mother can actually do about it tonight. That third one is the reason this project exists.
What it does
MindRion is a Flutter app with three dashboards, and Gemma 4 does a different job in each.
For the teacher. She uploads material and assignments. When submissions come in, Gemma does not grade them one at a time, it reads the entire class at once and writes her a report: which student is stuck on what, and which mistakes are showing up across the whole room. That second signal matters more than the first, because a mistake forty students share is usually not forty failures, it is one bad lecture. She finds that out the same day instead of at the end of term.
For the student. Instant feedback on submission, not a grade but a breakdown of where the reasoning actually broke. Then an adaptive assessment: Gemma asks a question, and if you get it right the next one gets harder, and if you get it wrong the next one gets easier, until it finds the exact floor of what you truly understand. At the end it writes a cognitive profile across ten dimensions: learning speed, confidence, critical thinking, exam readiness, weak subjects, next steps. There is also a tutor chat that switches to Urdu when the student needs it.
For the parent. Gemma takes the raw performance data and rewrites it as one human being talking to another. No jargon. One thing to do tonight.
How we built it
Every intelligent action in MindRion goes through Gemma 4 (google/gemma-4-31b-it), served via OpenRouter. Nothing in the app talks to a model directly, every call is routed through one Dart module, AIService, which turned out to be the most important decision we made.
We used prompt engineering, not fine-tuning, and it was the right call for a hackathon. Fine-tuning would have meant a labelled dataset of student submissions and graded feedback that we did not have and could not build responsibly in the time. Instead each AI feature is a named, versioned system prompt in one file, so when an output came back wrong we knew exactly which prompt to fix and could diff it. Three disciplines made it reliable:
- Temperature 0.2 to 0.3, not the default. This is an education app. A creative answer is a wrong answer. Lowering the temperature cut more nonsense than any prompt rewrite.
- Enforced JSON for anything Flutter renders as UI, parsed defensively on the client.
- Versioned prompts so the whole thing stayed debuggable under time pressure.
Gemma is not doing "chatbot" five times. It performs five genuinely different cognitive tasks:
| Module | What Gemma does | Output |
|---|---|---|
| Bulk Submission Analyzer | Reads a whole class at once, finds per-student weaknesses and class-wide error patterns | Markdown |
| Student Feedback | Diagnoses the conceptual and logical failure in one submission | Markdown |
| Adaptive Assessment | Generates the next question at calibrated difficulty from the previous answer | JSON |
| Cognitive Profiler | Synthesises a full assessment run into a 10-dimension profile | JSON |
| Parent Translator | Rewrites performance data as plain language with one concrete action | Plain text |
The stack: Flutter (one codebase → iOS, Android, Web), Supabase across twelve relational tables with Postgres Row Level Security keyed on auth.uid(), so the database itself refuses to return another user's rows. That matters here, because these rows describe the psychology of a child, and that guarantee belongs in the database, not a where clause a tired developer can forget.
Challenges we ran into
We built too much, and then deleted most of it. The first version had cognitive heatmaps, XP points, streaks, OCR scanners, gamification. It was a mess, nothing finished and nothing good. We cut eight modules and kept only the ones where Gemma was doing real cognitive work instead of decorating a screen. The app got better the day we started removing things, which is not the lesson we expected to learn.
We tried to run Gemma locally, and Pakistan stopped us. We wanted a system that profiles children to keep their data on-device, so we started with gemma4:12b locally through Ollama. The 7.4GB model crashed our laptops. We moved it to a desktop PC behind a secure tunnel, which worked right up until the load shedding hit, and then it worked again, and then the power went out again. You cannot demo a system that depends on WAPDA. So we pivoted to OpenRouter, and we won't dress that up as a design choice, it was a constraint. But because every call already went through AIService, swapping the endpoint back to a local server is a config change, not a rewrite.
Gemma kept breaking our parser. The adaptive assessment needs machine-parseable output because Flutter renders each question as UI, and Gemma kept wrapping its JSON in markdown code fences, crashing the parser mid-test. Fixing it in the prompt got us to roughly 80% clean, not good enough for a student halfway through an assessment. A defensive stripping layer inside AIService took us to 100%.
The parent report failed, and fixing it taught us the most. Our first translator prompt still produced sentences like "the student demonstrates suboptimal schema comprehension." The prompt literally said "use plain language," and Gemma ignored the intent, because "plain language" is an instruction with no reader attached to it. What finally worked was naming the reader:
"Write this for a parent who did not finish high school and just wants to know how to help their child tonight."
The output changed completely. It stopped reporting grades and started giving actionable empathy. That one line is the difference between a feature and the entire point of the product, and we only found it by failing first.
Accomplishments that we're proud of
- The parent translation layer. Most edtech builds another tutor. We built the thing nobody builds: the bridge that turns a score a parent cannot read into a sentence they can act on tonight.
- The teacher's class-wide view. Not forty grades, but the one pattern across forty students that tells a teacher she needs to reteach something, on the same day, not at term's end.
- Making Gemma do five distinct cognitive jobs from one clean
AIServicelayer: comparative analysis, diagnosis, adaptive difficulty calibration, psychological synthesis, and plain-language translation. - Row Level Security on a child's data, enforced by the database itself, not by application code we could forget to write.
- The discipline to delete eight modules and ship a smaller thing that actually works.
What we learned
The biggest lesson was that the hardest part was not building features, it was deleting them. Every problem we hit was a temptation to add one more screen. The version that works is the version where Gemma does a small number of things completely, and every one of them speaks to a real person who needed it.
We also learned that a prompt is not an instruction, it is a reader. "Use plain language" did nothing until we told Gemma exactly who was reading. The moment we named the parent, the output became human. And we learned that the failures that matter in a tool people rely on are the quiet ones, a JSON code fence that crashes a test mid-way, a model that ignores a formatting rule, because those do not announce themselves, they just break trust.
What's next for MindRion
- Self-hosted Gemma 4 on school infrastructure, so no student's psychological data ever leaves the building. The
AIServiceabstraction already makes this a config change, and Gemma's open weights are what make it possible at all. Load shedding delayed this, it did not cancel it. - Full Urdu across the entire interface, not only inside the tutor chat.
- Offline mode for the student dashboard, because the students who need this most have the worst connectivity.
- A longitudinal view for parents, tracking a child's cognitive profile over a term instead of a single snapshot.
An open model is what makes all of this affordable enough to actually reach a government school. The API call is the prototype. The open weights are the product.
Built With
- ai
- dart
- edtech
- education
- flutter
- gemma
- gemma-4
- llm
- machine-learning
- material-design
- openrouter
- postgresql
- prompt-engineering
- python
- rest-api
- supabase
Log in or sign up for Devpost to join the conversation.