DEV Community

Cover image for I built a strict local AI for my friend so he could actually learn to code
Mahima
Mahima

Posted on AI-assisted

I built a strict local AI for my friend so he could actually learn to code

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

I built RootCause for my friend, Ojju. Ojju is learning how to code and kept getting stuck on logic problems. Every time he asked AI tools for help, they would just hand him the entire correct code. It solved the problem, but it ruined his learning process because it didn't teach him how to think.

RootCause is an AI learning companion that strictly refuses to give you the answer. Instead, you paste your broken code and explain your thought process. It diagnoses exactly why you are stuck (e.g., a logic flaw, a missing concept, or a missed edge case) and guides you back to the right path with progressive Socratic hints. It also tracks your weak spots and generates micro-exercises in a "Logic Gym" so you can practice your mistakes.

Code

GitHub logo lohanmahima / RootCause

AI learning companion that diagnoses WHY you're stuck on coding problems instead of handing you answers. Socratic hints, targeted micro-exercises, and learning memory. Runs locally with Ollama + Gemma.

RootCause

RootCause is a coding companion that diagnoses why you are stuck instead of giving you the answer.

I built this for a friend, Ojju, who was learning to code but kept getting stuck on logic errors. When he used standard tools, they handed him the corrected code immediately, which solved the problem but didn't help him learn how to fix it himself next time. RootCause forces you to explain your approach first, reads your broken code, and points out the specific conceptual or logic gap you are missing.

[TODO: one real thing Ojju said after trying it]

Live Demo

You can access the live version of this application here ?? Live Demo (Note: Initial startup may show a security warning. Click "Continue" to proceed. This URL requires the host laptop to be online).

Screenshots

Home Solve

What it does

  • Solve flow: You explain your approach, paste your broken code, and provide…

How I Built It

RootCause is built entirely around local inference using open-weight models.

Frontend & App Logic: Python with Streamlit. I built a custom sandboxed Python environment to safely evaluate the user's Logic Gym code using subprocess and ast.
AI Engine: Google's Gemma 3 (4B) model, running locally via Ollama.
Data Persistence: SQLite for tracking topics, XP, and daily streaks locally.

The app uses Gemma 3 through Ollama's Python client to act as a strict tutor. I designed specific system prompts to force the model to output JSON judgments ({"met": false, "feedback": "...", "thinking_trick": "..."}) instead of free text. If the local Ollama instance crashes or runs out of memory, I built a silent fallback mechanism that automatically switches the Logic Gym to a verified offline bank of hand-written exercises so the user's workflow is never interrupted.

Why Does Open Innovation Matter?

Open innovation made RootCause possible because a learning tool for students needs to be free and private. If I built this on a closed API, Ojju would eventually have to pay per prompt, or I would have to pay a server bill to keep it running for him. By using an open model like Gemma 3 running locally via Ollama, it costs absolutely nothing. Ojju can use it offline on an airplane, and his messy, broken code never leaves his laptop.

Prize Categories
Open Innovation

Top comments (0)