Inspiration

The night before exams usually looks the same: hundreds of pages of notes, endless highlighting, and passive re-reading that barely sticks.

The real problem isn’t effort — it’s retention.

Research consistently shows that active recall and spaced repetition dramatically outperform passive studying for long-term memory. But creating high-quality flashcards manually takes time students rarely have.

I wanted to build a system that removes that friction completely.

With SnapStudy AI, students can upload handwritten notes, PDFs, or raw text and instantly transform them into AI-generated flashcards powered by Gemini — then review them using scientifically optimized spaced repetition scheduling.

The goal was simple: Turn chaotic notes into a structured learning system in seconds.

What it does

SnapStudy AI converts study material into an AI-powered flashcard system entirely in the browser.

Input Support

  • 📷 Upload handwritten or printed notes using OCR
  • 📄 Upload lecture slides or textbook PDFs
  • ✏️ Paste raw text directly

AI-Powered Learning

Using Gemini Flash, the app automatically generates:

  • Smart flashcards focused on core concepts
  • Concise summaries
  • Understanding-focused Q&A pairs

Instead of memorizing definitions blindly, the generated cards are designed to reinforce conceptual understanding.

Spaced Repetition (SM-2 Algorithm)

SnapStudy AI uses the SM-2 spaced repetition algorithm — the same foundational learning system popularized by Anki.

Cards are rescheduled dynamically based on performance:

Rating Next Review
Again 🔴 < 1 minute
Hard 🟡 < 10 minutes
Good 🟢 1 day
Easy 🔵 4+ days

Cards you struggle with appear more frequently, while mastered cards fade into the background — maximizing retention while minimizing study time.

How I built it

The entire application runs 100% client-side with no backend infrastructure.

Tech Stack

  • ⚛️ React + TypeScript + Vite
  • 🎨 Tailwind CSS
  • 🤖 Gemini Flash API (@google/genai)
  • 🔍 Tesseract.js OCR
  • 📄 PDF.js
  • 🧠 Custom SM-2 spaced repetition engine

Architecture

Input (Image / PDF / Text) ↓ Extraction Layer (OCR / PDF Parsing) ↓ Gemini Flash Prompt Pipeline ↓ Structured Flashcard Generation ↓ SM-2 Scheduling Engine ↓ Interactive Study Interface

A major focus was prompt engineering.

Instead of simply asking Gemini to “generate flashcards,” the system enforces structured output, concept-focused questions, OCR-noise tolerance, and concise educational formatting.

Challenges I ran into

OCR Noise & Handwriting Quality

OCR output is often messy, especially with handwritten notes.

Instead of aggressively preprocessing the text, I used Gemini itself as a semantic cleanup layer by instructing it to gracefully infer and repair OCR inconsistencies.

This dramatically improved output quality while simplifying the pipeline.

PDF.js Worker Issues

PDF.js required a worker configuration that initially failed due to CDN version mismatches.

I resolved this by locally hosting the worker bundle, enabling fully offline PDF extraction directly in the browser.

Gemini Model Reliability

During development, several Gemini models produced:

  • deprecation issues
  • quota edge cases
  • inconsistent availability

To improve resilience, I implemented a typed fallback strategy with prioritized error handling to avoid unnecessary failed requests.

SM-2 Edge Cases

The SM-2 algorithm behaves differently for first-time reviews.

I implemented the standard bootstrap progression: 1 day → 6 days → adaptive interval scaling

to ensure realistic review scheduling from the very first session.

What I learned

  • Prompt engineering is effectively a new layer of software engineering
  • Browser-native AI workflows are now powerful enough for real educational applications
  • OCR + LLM pipelines work surprisingly well even with imperfect input
  • Simple learning algorithms like SM-2 can dramatically improve retention outcomes

What's next

  • 🎤 Voice-to-flashcard generation
  • 📊 Retention analytics & forgetting curves
  • 🤝 Shareable deck exports
  • 🌍 Multi-language support
  • 📱 PWA offline study mode

SnapStudy AI started as a hackathon prototype, but the long-term vision is larger: making effective learning tools accessible instantly, without friction, accounts, or expensive platforms.

Built With

Share this project:

Updates