Inspiration

Practice problem sets are usually static — the same fixed list of questions for every student, regardless of whether you're breezing through them or stuck. I noticed this firsthand grinding through calc and physics homework: the problems were either too easy to be useful or too hard with no explanation of why an answer was wrong beyond a bare answer key. I wanted something that meets you where you actually are.

What it does

StudyBuddy AI generates an original calculus or physics problem on demand, lets you submit your answer (and optionally show your work), then grades it with a real explanation — not just "correct" or "incorrect," but the specific misconception behind a wrong answer. Two correct answers in a row bump the difficulty up a notch; a miss brings it back down, so the problem set adapts to you in real time instead of staying fixed.

How we built it

The frontend is React and Vite. A Vercel serverless function sits between the frontend and Groq's LLM API (Llama 3.3 70B), which handles both generating each problem and grading the submitted answer — the API key stays server-side so it's never exposed to the browser. The model is prompted to return strict JSON so the frontend can parse problem text and feedback without any fragile string-matching. The UI is a single "board" component that swaps between problem, input, and feedback states, with a small dot indicator showing the current difficulty level (1–5) per topic.

Challenges we ran into

Getting the grading model to be consistent was the hardest part — LLMs will sometimes wrap JSON in explanatory text or code fences, which breaks parsing. I solved this by tightening the system prompt to demand JSON-only output and adding a fallback parser that strips fences and pulls out just the {...} block. Balancing difficulty adjustment was also tricky: too aggressive and it swings wildly after one lucky guess, so it only escalates after two consecutive correct answers but drops immediately on a miss.

Accomplishments that we're proud of

Getting real adaptive difficulty working end-to-end in a single weekend — not just a static quiz, but a loop that actually responds to performance. I'm also proud of the grading quality: instead of a right/wrong stamp, every wrong answer comes back with a named misconception, which is the part that actually helps you learn.

What we learned

How much prompt engineering matters for reliability, not just quality — getting an LLM to behave like a predictable API endpoint (strict JSON, no drift) took more iteration than the actual grading logic. I also got a much better feel for wiring a frontend to a serverless backend and managing API keys safely.

What's next for StudyBuddy AI

Persistent accounts so progress carries across sessions, more subjects (chemistry, algebra), and a teacher-facing dashboard showing which misconceptions come up most often across a class — turning individual practice data into something a teacher could actually act on.

Built With

Share this project:

Updates

Submission history