DEV Community

Gourav
Gourav

Posted on

PrepWise AI: An Open-Source Current Affairs Tutor for Exam Prep

What I Built & Who I Built It For

My friend Geet is rigorously preparing for competitive exams, and one of her biggest daily struggles is keeping up with "Current Affairs." Every day, she spends hours hunting for relevant news across portals and then tries to test herself. It’s a tedious, manual process that eats into her core study time.

To solve this, I built PrepWise AI for her. It’s a fully automated, open-source-powered platform that fetches the daily top news, stores it, and generates dynamic, on-demand mock tests. When Geet finishes a test, the AI doesn't just give him a score—it evaluates her answers and explains why a specific option is correct based on the latest news context.

Live Demo: https://shawty-prepwise.vercel.app/
GitHub Repository: https://github.com/bluea1855/prepwise

Screenshots

demo screenshot

Why Open Innovation Matters for This Project

For an education tool meant for students, closed-ecosystem AI models are often too expensive and opaque. By using Google's open-weight Gemma model, I achieved three critical things:

  1. Cost-Efficiency: Students can't afford expensive API calls for daily practice. Open-weight models like Gemma allow us to generate high-quality MCQ evaluations at zero or near-zero cost.
  2. Transparency: In competitive exams, facts matter. With an open-source AI, I have complete control over the system prompt and temperature, ensuring the AI relies strictly on the fetched news context rather than hallucinating answers.
  3. Future Fine-Tuning: As Geet's exams get closer, I plan to fine-tune this Gemma model specifically on historical exam papers, something that is incredibly restrictive with closed models.

How It Works (The Architecture)

I had a tight 12-hour window to build this, so I utilized an automated microservices approach:

  • The Automation: A Python script runs via a GitHub Actions Cron Job every midnight. It uses SerpApi to fetch the top 10 daily current affairs (India & International).
  • The Data Layer: The fetched news is instantly securely stored in a MongoDB Atlas collection, serving as our zero-latency knowledge base.
  • The Backend: A fast, lightweight Python backend deployed on Render using FastAPI.
  • The AI Brain: When Geet submits her test, the backend pulls the relevant news context from MongoDB and passes it to the Gemma 2B model to evaluate the answers and generate detailed explanations.
  • The Frontend: A responsive React application providing a distraction-free testing environment.

Prize Categories I'm Entering

  • Best Use of Render: The FastAPI backend handling the AI evaluations and database connections is hosted seamlessly on Render.
  • Best Use of Gemma: Used as the core evaluation engine to provide natural language explanations for the generated mock tests.
  • Best Use of SerpApi: Powers the automated daily data-pipeline to fetch high-quality, real-time Google News results without manual intervention.
  • Best Use of MongoDB Atlas: Acts as the reliable data layer holding our daily current affairs repository.
  • Best Use of GitHub Copilot: I heavily utilized Copilot to rapidly prototype the React UI components and write the GitHub Actions workflow YAML file for the midnight cron job.

Building this for a friend made this weekend hackathon incredibly fulfilling. I can't wait to see how it improves his mock scores!

Top comments (0)