AI Study Tool - Setup Guide
Josh Dula - CS 4800 Capstone Project
An intelligent study tool that automatically generates summaries, flashcards, and AI-powered quiz questions from your documents.
Quick Setup (Professor/Evaluator Guide)
This repository is ready to run immediately. Follow these steps:
git clone https://github.com/jdula02/ai-study-tool.git
cd ai-study-tool
2. Create Virtual Environment (Recommended)
# Create virtual environment
python3 -m venv venv
# Activate it (Linux/WSL/Mac)
source venv/bin/activate
# Or on Windows
# venv\Scripts\activate
pip install -r requirements.txt
Note: If you get an "externally-managed-environment" error, make sure you're using the virtual environment above.
4. Download Required NLTK Data
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('averaged_perceptron_tagger')"
Standard:
For WSL Users:
Open your browser to: http://localhost:8000
WSL users may need to use: http://172.21.19.74:8000
- ** Key**: Claude AI key is already configured in .env
- ** Sample Data**: Database includes uploaded documents for immediate testing
- ** Sample Documents**: PDF and text files ready for upload testing
- ** All Dependencies**: Complete requirements.txt with exact versions
- Upload (/upload) - Drag-and-drop file upload interface
- Documents (/documents) - View all uploaded files with action buttons
- Quiz (/quiz) - NEW: AI-powered quiz generation
- Study (/study) - Spaced repetition flashcard system
- AI Tutor (/ai-tutor) - Interactive chat with Claude AI
AI Quiz Generation (Enhanced Feature):
- Go to /quiz
- Select any document
- Enable "Use AI for smarter questions" (checkbox)
- Choose number of questions (5-20)
- Take the quiz with proper answer feedback
- View detailed results with score percentage and question review
- Retake the same quiz or start a new one
ai-study-tool/
├── simple_app.py # Main FastAPI application
├── simple_config.py # Configuration
├── .env # API keys (included for evaluation)
├── study_tool.db # SQLite database with sample data
├── backend/
│ ├── api/ # REST API endpoints
│ │ ├── simple_questions.py # Question generation API
│ │ ├── ai_tutoring.py # Claude AI integration
│ │ └── ...
│ └── services/ # Core business logic
│ ├── claude_ai_service.py # AI service integration
│ ├── simple_question_generator.py # Basic questions
│ └── ...
├── frontend/
│ ├── templates/ # HTML pages
│ └── static/ # CSS/JS assets
├── uploads/ # Sample uploaded files (included)
└── requirements.txt # All dependencies
- Backend: FastAPI (Python 3.12)
- Database: SQLite with SQLAlchemy ORM
- AI Integration: Claude API (Anthropic)
- NLP: NLTK, Sumy, PyPDF2
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Features: PDF processing, text summarization, spaced repetition
- Document Processing: Upload PDFs/text files with automatic text extraction
- Multiple Summarization: Extractive, abstractive, and hybrid approaches
- Question Generation:
- Basic: Rule-based fill-in-blank, multiple choice, true/false
- AI-Powered: Intelligent questions that test comprehension vs. memorization
- Flashcard System: Spaced repetition algorithm (Anki-inspired)
- AI Tutoring: Interactive Q&A with document context
The repository includes sample documents and a populated database so you can immediately test all features without uploading new content.
Port 8000 in use?
# Change port in simple_app.py or kill existing process
pkill -f simple_app.py
Missing NLTK data?
python -c "import nltk; nltk.download('all')"
AI features not working?
- Claude AI API key is included in .env file
- Check console output for API errors
- If you see "Client.init() got an unexpected keyword argument 'proxies'", upgrade Anthropic:
pip install --upgrade anthropic
Virtual Environment Issues?
- Make sure you activated the virtual environment: source venv/bin/activate
- If you see "externally-managed-environment", you must use a virtual environment
WSL Network Issues?
- Try the WSL-specific server: python run_wsl_server.py
- Access via the IP shown in console output
- Upload Feature: Try uploading a new PDF via /upload
- Basic Questions: Generate questions from any document (uncheck AI option)
- AI Quiz: Enable AI toggle and take a complete quiz with scoring
- Quiz Completion: Complete a full quiz to see the results screen and retake functionality
- Flashcards: Create and review flashcards with spaced repetition
- AI Chat: Ask questions about uploaded documents via /ai-tutor
- AI Summaries: Generate different summary types (extractive, abstractive, hybrid)
This project demonstrates full-stack web development, AI integration, natural language processing, and educational technology concepts.
Contact:
Josh Dula - dulajb@appstate.edu