Inspiration

The name "Medha" (from Sanskrit, meaning "intellect/wisdom") reflects our core mission: making intelligent, personalized education accessible to everyone. Traditional learning is one-size-fits-all — learners waste time on content they already know or get overwhelmed by unstructured material. We built MedhaSpark AI to solve this by combining AI-generated structured learning paths with proven study science (spaced repetition, active recall, cognitive load theory).

What We Built

MedhaSpark AI is a full-stack, AI-powered learning platform that takes any topic a user wants to learn and transforms it into a structured, interactive learning experience. Features include:

  • AI-Generated Learning Roadmaps — Upload a topic or syllabus (PDF/DOCX), and the AI generates a hierarchical roadmap with topics and subtopics ordered from foundational to advanced.
  • Spaced Repetition Flashcards — AI-generated flashcards scheduled using the SM-2 algorithm to maximize long-term retention.
  • AI-Powered Quizzes — Multiple-choice or fill-in-the-blank quizzes with automatic grading and score tracking.
  • AI Studio — Text analysis suite with summaries, key concept extraction, ELI5 explanations, Mermaid diagram generation, and contextual Q&A.
  • Conceptual Weaver — Connects new concepts to a learner's existing knowledge to build meaningful bridges between ideas.
  • Cognitive Load Modulator — Breaks complex content into digestible chunks and suggests adaptive presentation strategies.
  • Secure Authentication — Email/password with Firebase, Google OAuth, and JWT-based sessions.
  • Gamification — Daily focus items, learning streaks, points, and activity tracking.

How We Built It

The backend is built with FastAPI (Python) using async SQLAlchemy for database operations. All AI features route through a unified AI provider service that manages Cerebras AI (primary), Groq, and Google Gemini with automatic failover and rate-limit cooldown tracking. The frontend uses server-rendered HTML with Jinja2 templates, vanilla JavaScript, and a custom "Quest Theme" design system with light/dark mode. Deployed on Render.com with PostgreSQL (Aiven) for production.

Challenges

  1. Multi-provider AI reliability — Different providers have different formats and failure modes. Building a unified layer with automatic failover and JSON parsing (handling markdown fences, inconsistent formatting) was a major challenge.
  2. Syllabus-to-roadmap parsing — Converting unstructured text from PDFs/DOCX into well-structured JSON roadmaps required careful prompt engineering and validation.
  3. Spaced repetition correctness — Implementing SM-2 with proper ease factor bounds and interval capping required deep understanding of the underlying cognitive science.
  4. Security hardening — SSRF prevention, prompt injection prevention, XSS protection, CORS, and JWT validation all needed careful implementation.

What We Learned

  • Architecting a production-ready FastAPI application with proper separation of concerns
  • Advanced prompt engineering for structured JSON output from LLMs
  • Building resilient multi-provider AI systems with graceful degradation
  • Implementing spaced repetition algorithms with real-world edge cases
  • Security best practices for modern web applications
Share this project:

Updates

Submission history