Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RecallAI β€” AI-Powered Flashcard Learning System

RecallAI Header Typing SVG

Live Demo Deploy on Vercel


✨ RecallAI transforms your study materials into interactive flashcard decks instantly

Powered by advanced AI models β€’ SM-2 Spaced Repetition β€’ Real-time Analytics


πŸš€ Quick Start

git clone https://github.com/kinshukkush/recallai.git
cd recallai
npm install
npm run dev

Open http://localhost:3000 in your browser.


🎯 Core Features

Feature Description
πŸ“„ PDF Upload & Parsing Drag and drop any PDF β€” textbooks, notes, papers with automatic text extraction
πŸ€– AI Flashcard Generation Advanced AI creates targeted Q&A with dynamic difficulty levels
πŸ”„ Active Recall Practice Animated 3D flip cards test your knowledge one question at a time
⚑ Spaced Repetition (SM-2) Proven algorithm schedules reviews at optimal intervals
πŸ“Š Progress Dashboard Track mastery, weak spots, and cards due today with beautiful analytics
πŸ’‘ "Explain Better" AI Mode Ask AI to simplify complex answers with plain language

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          RecallAI Processing Pipeline                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  [PDF Upload] β†’ [Parse & Extract] β†’ [AI Generation]     β”‚
β”‚                                         ↓               β”‚
β”‚                                  [Supabase DB]          β”‚
β”‚                                         ↓               β”‚
β”‚          [Review Practice] ← [SM-2 Algorithm]           β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Next.js React TypeScript Tailwind CSS Supabase Framer Motion


πŸ€– AI Integration

Primary Model: Google Gemma-4 (via Ollama)

RecallAI leverages Ollama with Gemma-4 for local, privacy-first AI processing:

Why Ollama + Gemma-4?

  • πŸ” Privacy: All processing happens locally on your machine
  • ⚑ Performance: Lightning-fast inference with optimized models
  • πŸ’° Cost-effective: No expensive API calls
  • 🎯 Specialized: Fine-tuned for reasoning and code generation

Setup Instructions

  1. Install Ollama from ollama.ai

  2. Pull the Gemma-4 model:

    ollama pull gemma4
  3. Alternative models available:

    ollama pull gemma4:26b      # Mixture of Experts (4B active)
    ollama pull gemma4:e4b      # Efficient 4B variant
    ollama pull gemma4:e2b      # Efficient 2B variant (mobile)
  4. Run with Claude Code (optional IDE integration):

    ollama launch claude --model gemma4
  5. Environment Configuration:

    # .env.local
    OLLAMA_API_URL=http://localhost:11434
    OLLAMA_MODEL=gemma4

Model Specifications

Model Size Context Best For
gemma4:latest 9.6GB 128K Balanced performance
gemma4:26b 18GB 256K High-quality output
gemma4:31b 20GB 256K Frontier performance
gemma4:e4b 7.2GB 128K Efficient inference
gemma4:e2b 5.1GB 128K Mobile/Edge devices

Key Capabilities

βœ… Reasoning - Multi-step problem solving
βœ… Coding - Generate and explain code
βœ… Vision - Image understanding (supported models)
βœ… Audio - Audio processing (supported models)
βœ… Tools - Native function-calling support
βœ… Native System Prompts - Structured conversations

Performance Benchmarks

Benchmark Gemma-4 31B Gemma-4 E4B
MMLU Pro 85.2% 69.4%
AIME 2026 89.2% 42.5%
LiveCodeBench 80.0% 52.0%
Codeforces ELO 2150 940

πŸ“¦ API Endpoints

Endpoint Method Purpose
/api/generate-cards POST Process PDF and generate AI flashcards
/api/review-card POST Submit review and apply SM-2 algorithm
/api/explain POST Simplify complex flashcard answers
/api/decks GET Retrieve all user decks
/api/decks DELETE Delete deck and associated cards
/api/decks/[id] GET Fetch specific deck with cards

πŸ”§ Configuration & Setup

Prerequisites

  • Node.js 18+ & npm
  • Ollama (for local AI processing)
  • Supabase account

Environment Variables

Create a .env.local file:

# Ollama Configuration
OLLAMA_API_URL=http://localhost:11434
OLLAMA_MODEL=gemma4

# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_anon_key
SUPABASE_DB_PASSWORD=your_db_password

Database Setup

  1. Create a Supabase project
  2. Run the schema from supabase/schema.sql
  3. Configure RLS policies (included in schema)

Installation Steps

# 1. Clone repository
git clone https://github.com/kinshukkush/recallai.git
cd recallai

# 2. Install dependencies
npm install

# 3. Start Ollama (in separate terminal)
ollama serve

# 4. Pull Gemma model
ollama pull gemma4

# 5. Configure environment variables
cp .env.example .env.local
# Edit .env.local with your settings

# 6. Start development server
npm run dev

πŸ“Š Data Flow

User PDF Upload
       ↓
   PDF Parse
       ↓
   Extract Text
       ↓
  Ollama/Gemma-4 AI
       ↓
Generate Q&A Cards
       ↓
Store in Supabase
       ↓
  User Reviews
       ↓
   SM-2 Algorithm
       ↓
Update Intervals

🎨 UI/UX Features

  • ✨ 3D Card Animations - Smooth flip and tilt effects
  • 🌌 Glassmorphism Design - Modern frosted glass aesthetic
  • 🎯 Responsive Layouts - Mobile-first design
  • ⚑ Framer Motion - Smooth entrance and hover animations
  • 🌈 Gradient Accents - Eye-catching color transitions

πŸš€ Performance Optimizations

  • Image Optimization - Next.js automatic image compression
  • Code Splitting - Dynamic imports for faster load times
  • Caching Strategy - Efficient cache headers
  • Database Indexing - Optimized Supabase queries

πŸ” Security

  • βœ… Row-Level Security (RLS) in Supabase
  • βœ… Environment variable protection
  • βœ… Secure API route handling
  • βœ… Input validation and sanitization

πŸ“ˆ Learning Analytics

RecallAI provides comprehensive insights:

  • Mastery Percentage - Overall progress tracking
  • Due Cards - Cards scheduled for today
  • Learning Streak - Consistent practice motivation
  • Difficulty Breakdown - Identify weak areas
  • Time Analytics - Study duration trends

πŸŽ“ How It Works

  1. Upload - Drag and drop your PDF
  2. Parse - RecallAI extracts and cleans text
  3. Generate - Gemma-4 AI creates smart questions
  4. Review - Practice with animated flashcards
  5. Learn - SM-2 adapts to your pace

🀝 Contributing

Contributions are welcome! Please follow our code style and submit PRs with clear descriptions.

# Fork the repo, then:
git checkout -b feature/your-feature
git commit -m "Add your feature"
git push origin feature/your-feature

πŸ“ License

MIT License - see LICENSE file for details


πŸ‘¨β€πŸ’» Developer

Kinshuk Saxena

Typing SVG

GitHub LinkedIn Portfolio Email Phone


Made with ❀️ and passion for education by Kinshuk Saxena

⭐ Star this repo if you found it helpful! ⭐

GitHub Followers

Footer

Footer

About

AI-powered flashcard learning app that converts PDFs into adaptive study decks using spaced repetition (SM-2) and NVIDIA LLMs. Built with Next.js, Supabase, and Tailwind.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages