Skip to content

chingizof/soru.ai

🧠 Soru.ai

Your AI-Powered Copilot for Education

Transform your handwritten notes and YouTube lectures into interactive flashcards using cutting-edge AI

Python Reflex License Google Gemini

Demo β€’ Features β€’ Quick Start β€’ Documentation β€’ Contributing


πŸ“– Overview

Soru.ai is an intelligent educational platform that leverages state-of-the-art AI models to revolutionize how students learn. Upload your handwritten notes or paste a YouTube lecture URL, and watch as our AI generates personalized, high-quality flashcards tailored to your learning style.

🎨 How It Works

Soru.ai System Architecture

Quick Flow:

  1. πŸ“€ Upload your handwritten notes or paste a YouTube lecture URL
  2. πŸ” AI Processing extracts text via OCR (TrOCR) or transcript (YouTube API)
  3. 🧠 Smart Generation creates flashcards using Google Gemini Pro
  4. πŸƒ Interactive Learning study with clickable, flippable flashcards

🎯 Problem Statement

Students spend countless hours manually creating flashcards from their notes and lectures. This process is:

  • ⏰ Time-consuming: Hours spent on card creation instead of actual studying
  • πŸ“ Inconsistent: Quality varies based on note-taking skills
  • πŸ”„ Redundant: Same content reformatted repeatedly across different courses

πŸ’‘ Our Solution

Soru.ai automates flashcard generation using:

  • OCR Technology: Microsoft's TrOCR model for handwritten text recognition
  • AI Generation: Google Gemini Pro for intelligent question-answer pair creation
  • Multi-source Support: Process both images and YouTube video transcripts
  • Interactive UI: Beautiful, responsive interface built with Reflex

✨ Features

πŸ–ΌοΈ Handwritten Note Processing

  • Upload images of your handwritten notes
  • Advanced OCR powered by Microsoft's TrOCR model
  • Supports various handwriting styles and formats
  • Automatic text extraction and parsing

πŸŽ₯ YouTube Video Integration

  • Paste any YouTube lecture URL
  • Automatic transcript extraction (supports English and Russian)
  • AI-powered summarization and concept extraction
  • Perfect for MOOC courses and online lectures

πŸƒ Smart Flashcard Generation

  • Intelligent question-answer pair creation
  • Context-aware content analysis
  • Optimized for active recall and spaced repetition
  • Character limits for optimal learning (100 chars per side)

🎨 Modern User Interface

  • Beautiful gradient design with smooth animations
  • Drag-and-drop file upload
  • Interactive card flipping
  • Real-time processing indicators
  • Responsive design for all devices

πŸ”’ Enterprise-Grade Security

  • Environment-based configuration
  • API key protection
  • Secure file handling
  • No data retention beyond session

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Input    β”‚
β”‚  (Image/URL)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        Soru.ai Platform             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚     OCR Processing           β”‚   β”‚
β”‚  β”‚  (TrOCR Handwritten Model)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚             β”‚                        β”‚
β”‚             β–Ό                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   YouTube Transcript API     β”‚   β”‚
β”‚  β”‚   (Multi-language Support)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚             β”‚                        β”‚
β”‚             β–Ό                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚    Google Gemini Pro         β”‚   β”‚
β”‚  β”‚  (Flashcard Generation)      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚             β”‚                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚  Interactive   β”‚
     β”‚  Flashcards    β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Component Technology Purpose
Frontend Framework Reflex 0.4.8+ Reactive Python-based UI
AI Model Google Gemini Pro Flashcard content generation
OCR Engine Microsoft TrOCR Handwriting recognition
Video Processing YouTube Transcript API Lecture content extraction
Backend Python 3.11+ Core application logic
State Management Reflex State Real-time UI updates

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/soru.ai.git
    cd soru.ai
  2. Create and activate virtual environment

    python -m venv venv
    
    # On macOS/Linux
    source venv/bin/activate
    
    # On Windows
    venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    cp .env.example .env

    Edit .env and add your API keys:

    GOOGLE_API_KEY=your_google_gemini_api_key_here
    HUGGINGFACE_API_KEY=your_huggingface_api_key_here
  5. Initialize Reflex

    reflex init
  6. Run the application

    reflex run
  7. Open your browser

    Navigate to http://localhost:3000
    

πŸ“š Documentation

Project Structure

soru.ai/
β”œβ”€β”€ lahacks_24/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── lahacks_24.py          # Main application logic
β”œβ”€β”€ assets/                     # Static assets (images, icons)
β”œβ”€β”€ uploaded_files/            # Temporary file storage (gitignored)
β”œβ”€β”€ .env                       # Environment variables (gitignored)
β”œβ”€β”€ .env.example              # Environment template
β”œβ”€β”€ .gitignore                # Git ignore rules
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ rxconfig.py              # Reflex configuration
└── README.md                # This file

Usage Examples

πŸ“ Generate Flashcards from Notes

  1. Click on the upload area or drag-and-drop your image
  2. Select an image of your handwritten notes (JPG, PNG)
  3. Click "Upload" button
  4. Wait for AI processing (usually 10-30 seconds)
  5. View and interact with your generated flashcards

πŸŽ₯ Generate Flashcards from YouTube

  1. Copy a YouTube video URL (e.g., https://www.youtube.com/watch?v=VIDEO_ID)
  2. Paste it into the YouTube link input field
  3. Click "Generate YouTube Notes"
  4. AI extracts transcript and creates flashcards
  5. Study your personalized flashcards

API Reference

State Management

class State(rx.State):
    img: list                    # Uploaded image filenames
    cards_list: list[tuple]      # (front, back) flashcard pairs
    visual_cards_list: list      # Currently visible card sides
    processing: bool             # Processing status indicator
    complete: bool               # Completion status

Key Functions

  • create_flashcard_prompt(): Processes uploaded images via OCR and generates flashcards
  • create_youtube_prompt(): Extracts YouTube transcripts and generates flashcards
  • swap_card(): Flips flashcard between front and back
  • split_flashcards_list(): Parses AI output into structured flashcard pairs

🎨 Screenshots

Main Interface

Beautiful gradient interface with dual input options

Flashcard Generation

Real-time processing with elegant loading indicators

Interactive Learning

Click any card to flip between question and answer


πŸ§ͺ Development

Running in Development Mode

reflex run --env dev

Environment Variables

Variable Description Required
GOOGLE_API_KEY Google Gemini Pro API key βœ… Yes
HUGGINGFACE_API_KEY Hugging Face API token βœ… Yes
APP_NAME Application identifier No
DEBUG Enable debug mode No

Code Quality

The project follows Python best practices:

  • Type hints for better code clarity
  • Async/await for efficient I/O operations
  • Clean separation of concerns
  • Environment-based configuration
  • Secure credential management

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Areas for Contribution

  • 🌐 Multi-language support
  • πŸ“± Mobile app development
  • 🧠 Additional AI model integrations
  • 🎯 Spaced repetition algorithm
  • πŸ“Š Learning analytics dashboard
  • 🎨 UI/UX improvements

πŸ“‹ Roadmap

  • Handwritten note OCR processing
  • YouTube video transcript integration
  • Google Gemini flashcard generation
  • Interactive card flipping interface
  • User authentication and profiles
  • Flashcard deck management
  • Spaced repetition scheduling
  • Export to Anki/Quizlet
  • Mobile app (iOS/Android)
  • Collaborative study groups
  • Performance analytics
  • Multi-language UI support
  • PDF document processing
  • Audio lecture transcription

πŸ›‘οΈ Security

  • No API keys in code: All credentials managed via environment variables
  • Secure file handling: Temporary uploads cleaned automatically
  • No data persistence: User content not stored on servers
  • HTTPS enforced: Secure communication in production

To report security vulnerabilities, please email: [email protected]


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘₯ Team

Soru.ai was created at LA Hacks 2024 by passionate developers who believe in making education more accessible and efficient.


πŸ™ Acknowledgments


πŸ“ž Contact & Support


Made with ❀️ and β˜• by students, for students

Star ⭐ this repo if you find it helpful!

About

AI-engine making education more fun by transforming your notes into flashcards

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages