Your intelligent study companion powered by multiple AI models and advanced flashcard generation
StudyBuddy is a comprehensive AI-powered study tool designed to help students learn more effectively. It combines the power of multiple Large Language Models (LLMs) with intelligent flashcard generation from lecture recordings, creating a seamless study experience.
- 4 AI Models: Claude (Anthropic), ChatGPT (OpenAI), Gemini (Google), and Groq
- Intelligent Routing: Automatically selects the best AI model based on your question type
- Manual Selection: Choose specific AI models for specialized tasks
- Real-time WebSocket: Fast, responsive communication
- Voice Support: Built-in voice controls for hands-free studying
- Audio Recording: Record lectures directly in your browser
- Auto-Transcription: Convert lectures to text using Whisper AI
- Smart Flashcard Creation: Claude AI generates high-quality study flashcards
- Interactive Study Modes:
- 📖 Review Mode: Flip through cards at your own pace
- ✅ Quiz Mode: Test your knowledge with self-grading
- ✏️ Edit Mode: Customize flashcards to your needs
- Export Options: Download flashcards as Anki-compatible CSV
- Persistent Storage: All flashcards saved to Supabase database
StudyBuddy/
├── backend/ # Python FastAPI backend
│ ├── main.py # Application entry point
│ ├── app/
│ │ ├── routers/ # API endpoints
│ │ │ ├── chat.py # WebSocket chat endpoint
│ │ │ └── flashcards.py # Flashcard CRUD + generation
│ │ ├── services/ # Business logic
│ │ │ ├── llm_router.py # Multi-LLM routing
│ │ │ ├── flashcard_generator.py # AI flashcard creation
│ │ │ └── supabase_client.py # Database operations
│ │ └── models/ # Data models
│ │ └── flashcard.py
│ └── database/
│ └── schema.sql # Supabase database schema
│
└── frontend/ # React TypeScript frontend
├── src/
│ ├── pages/
│ │ ├── ChatPage.tsx # Multi-LLM chat interface
│ │ └── FlashcardPage.tsx # Flashcard management
│ ├── components/
│ │ ├── chat/ # Chat UI components
│ │ └── flashcards/ # Flashcard UI components
│ ├── hooks/
│ │ ├── useWebSocket.ts # WebSocket connection
│ │ └── useFlashcards.ts # Flashcard state management
│ └── types/ # TypeScript definitions
└── public/
- Python 3.11+
- Node.js 16+
- API Keys (at least one):
- Anthropic Claude (Required for flashcard generation)
- OpenAI
- Google AI Studio
- Groq
- Supabase Account: supabase.com (Free tier available)
git clone https://github.com/2AcademicVictims/StudyBuddy.git
cd StudyBuddy# Navigate to backend
cd backend
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Create .env file
copy .env.example .env # Windows
# cp .env.example .env # macOS/Linux
# Edit .env and add your API keys
# ANTHROPIC_API_KEY=your_claude_api_key
# OPENAI_API_KEY=your_openai_api_key
# GOOGLE_API_KEY=your_google_api_key
# GROQ_API_KEY=your_groq_api_key
# SUPABASE_URL=your_supabase_project_url
# SUPABASE_KEY=your_supabase_anon_key- Go to Supabase and create a new project
- Navigate to SQL Editor in your Supabase dashboard
- Copy and run the SQL from
backend/database/schema.sql - Get your Project URL and Anon Key from Settings → API
- Add them to your
.envfile
# Navigate to frontend (in a new terminal)
cd frontend
# Install dependencies
npm install
# Start development server
npm start# In the backend directory
python main.py
# Server will start on http://localhost:8000
# API docs available at http://localhost:8000/docsVisit http://localhost:3000 and you should see:
- Multi-LLM Chat tab with available AI models
- Lecture Flashcards tab for recording and studying
- Navigate to "💬 Multi-LLM Chat" tab
- Choose a mode:
- Auto-Route: Let AI pick the best model
- Manual: Select a specific AI (Claude, ChatGPT, Gemini, or Groq)
- Type your question or use voice input
- Get instant answers from world-class AI models
Example Questions:
- "Explain quantum entanglement in simple terms" → Routes to Claude
- "Write a Python function to reverse a string" → Routes to ChatGPT
- "What are the health benefits of green tea?" → Routes to Gemini
- "Summarize the main themes in Shakespeare's Hamlet" → Routes to Groq
- Navigate to "📚 Lecture Flashcards" tab
- Record a lecture:
- Click "🎙️ Start Recording"
- Speak or play lecture audio
- Click "⏹️ Stop Recording"
- Generate flashcards:
- Enter lecture title
- Choose number of flashcards (5-30)
- Click "✨ Generate Flashcards"
- AI processes transcript and creates study cards
- Study your flashcards:
- Review Mode: Click cards to flip and learn
- Quiz Mode: Test yourself with self-grading
- Edit: Modify questions/answers
- Save: Store to database
- Export: Download as Anki CSV
- FastAPI - High-performance async web framework
- Python 3.11+ - Core programming language
- Anthropic Claude - Advanced AI for flashcard generation
- OpenAI Whisper - Speech-to-text transcription
- Supabase - PostgreSQL database with real-time features
- WebSockets - Real-time bidirectional communication
- React 18 - Modern UI library
- TypeScript - Type-safe development
- React Bootstrap - Responsive UI components
- WebSocket API - Real-time chat functionality
- MediaRecorder API - Browser audio recording
| Model | Provider | Use Case |
|---|---|---|
| Claude 3.5 Sonnet | Anthropic | Complex reasoning, flashcard generation |
| GPT-4 | OpenAI | Code generation, technical questions |
| Gemini 2.5 Flash | General knowledge, fast responses | |
| Llama 3.1 | Groq | Creative content, summarization |
WS /ws # WebSocket chat connection
GET /health # System health check
GET / # API information
POST /api/flashcards/generate # Generate flashcards from transcript
POST /api/flashcards/transcribe # Transcribe audio + generate flashcards
GET /api/flashcards # List all flashcards
POST /api/flashcards # Create flashcard manually
GET /api/flashcards/{id} # Get specific flashcard
PUT /api/flashcards/{id} # Update flashcard
DELETE /api/flashcards/{id} # Delete flashcard
GET /api/flashcards/export/anki # Export as Anki CSV
Full API documentation: http://localhost:8000/docs
cd backend
python test_supabase.pycd frontend
npm testBackend (backend/.env):
# AI Model API Keys
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-proj-...
GOOGLE_API_KEY=AIza...
GROQ_API_KEY=gsk_...
# Database
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=eyJhbGc...- Change AI Models: Edit
backend/app/services/llm_router.py - Adjust Flashcard Count: Modify range in
frontend/src/components/flashcards/LectureRecorder.tsx - Database Schema: Modify
backend/database/schema.sql
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for Claude AI
- OpenAI for GPT and Whisper
- Google for Gemini
- Groq for fast inference
- Supabase for database infrastructure
- Built for the Cursor Hackathon
- Issues: GitHub Issues
- Documentation: See
QUICK_START.mdandFEATURE_DOCUMENTATION.md - API Docs: http://localhost:8000/docs
Created by @2AcademicVictims to make studying more efficient and effective.
Happy Studying! 📚✨