A modern, interactive AI tutor that combines conversational AI with specialized educational features - completely local and privacy-focused!
- ๐ 100% Private: All processing happens locally - your data never leaves your computer
- ๐ฐ Zero Cost: No API fees or subscriptions required
- ๐ Educational Focus: Specialized for learning with 8+ subjects and 30+ quiz questions
- Double-click
start_ai_tutor.batin the project folder - Open your browser and navigate to
http://localhost:5000 - Start learning! ๐
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py
# Open in browser: http://localhost:5000For enhanced conversational AI capabilities:
-
Install Ollama (recommended):
# Download from https://ollama.ai ollama pull llama3.2 # or llama2, mistral, etc. ollama serve
-
Start AI Tutor:
python app.py
-
Enjoy enhanced conversations with full ChatGPT-like functionality!
๐ Need help with LLM setup? Check out
LLM_SETUP_GUIDE.mdfor detailed instructions.
- Local LLM Integration: Connect with Ollama, llama.cpp, or any OpenAI-compatible API
- Built-in Expertise: Specialized educational knowledge for precise academic responses
- Smart Routing: Automatically selects the best AI system for each type of question
- Fallback System: Works perfectly even without external LLM connections
- ๐ Comprehensive Subjects: 8 major areas including Math, Science, History, and more
- ๐ฏ Intelligent Quizzes: 30+ carefully crafted questions with multiple difficulty levels
- ๐งฎ Math Calculator: Step-by-step solutions for arithmetic and word problems
- ๐ค Common Sense Q&A: Practical knowledge about everyday topics
- ๐ Study Assistance: Homework help and concept explanations
- ๐ฌ Real-time Chat: Instant responses with typing indicators
- ๐ Voice Support: Toggle text-to-speech for audio learning
- ๐ฑ Responsive Design: Perfect experience on desktop, tablet, and mobile
- ๐จ Beautiful Interface: Modern gradient design with smooth animations
- โก Fast Performance: Optimized for quick responses and smooth interactions
- ๐ Python Backend: Built with Flask for reliability and scalability
- ๐ง NLP Processing: Optional spaCy integration for advanced text analysis
- ๐ HTTP API Ready: Easy integration with any LLM service
- ๏ฟฝ Session Management: Maintains context during conversations
- ๐ Privacy First: All data stays on your machine
Open in browser: http://localhost:5000
### **Option 3: With Local LLM (ChatGPT-like)**
For enhanced conversational AI capabilities:
1. **Install Ollama** (recommended):
```bash
# Download from https://ollama.ai
ollama pull llama3.2 # or llama2, mistral, etc.
ollama serve
-
Start AI Tutor:
python app.py
-
Enjoy enhanced conversations with full ChatGPT-like functionality!
| Component | Technology | Purpose |
|---|---|---|
| Backend | Python 3.7+ | Core application logic |
| Web Framework | Flask 2.3+ | HTTP server and routing |
| NLP | spaCy (optional) | Natural language processing |
| TTS | pyttsx3 | Text-to-speech functionality |
| HTTP Client | requests | LLM API communication |
| Frontend | HTML5, CSS3, JavaScript | Modern responsive UI |
| Data | JSON | Knowledge base storage |
๐ง "Explain photosynthesis"
๐ค Detailed explanation with examples and key concepts
๐ง "Quiz me on mathematics easy"
๐ค Interactive quiz with step-by-step solutions
๐ง "What is 25 ร 4 + 10?"
๐ค 110. Here's how I calculated it: (25 ร 4 = 100) + 10 = 110
๐ง "Write a poem about coding"
๐ค Creative poem about programming and technology
๐ง "Explain quantum computing like I'm 10"
๐ค Simple, engaging explanation with analogies
๐ง "Help me brainstorm app ideas"
๐ค Creative suggestions with detailed descriptions
๐ง "Help me understand Newton's laws"
๐ค Comprehensive explanation with real-world examples
๐ง "Common sense: Why do things fall down?"
๐ค Simple explanation of gravity suitable for all ages
aitutor/
โโโ ๐ app.py # Main Flask application
โโโ ๐ main.py # Command-line interface
โโโ ๐ config.py # Configuration settings
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ start_ai_tutor.bat # Windows quick-start script
โโโ ๐ question_answering.py # Advanced Q&A processing
โโโ ๐ data/
โ โโโ ๐ content.json # Educational knowledge base
โโโ ๐ templates/
โ โโโ ๐ index.html # Modern web interface
โโโ ๐ __pycache__/ # Python cache files
- Python 3.7 or higher
- pip (Python package manager)
- Modern web browser
-
Clone the repository:
git clone https://github.com/Harshit057/aitutor.git cd aitutor -
Install Python dependencies:
pip install -r requirements.txt
-
[Optional] Install spaCy for enhanced NLP:
pip install spacy python -m spacy download en_core_web_sm
-
[Optional] Set up local LLM:
- Ollama (recommended): Follow instructions at https://ollama.ai
- llama.cpp: Set up local server
- Other: Any OpenAI-compatible API endpoint
-
Run the application:
python app.py
-
Access the interface: Open your browser and navigate to
http://localhost:5000
| Feature | AI Tutor | ChatGPT Plus | Khan Academy | Wolfram Alpha |
|---|---|---|---|---|
| Privacy | โ 100% Local | โ Cloud-based | โ Cloud-based | โ Cloud-based |
| Cost | โ Free Forever | โ $20/month | โ Free/Premium | โ Subscription |
| Offline Use | โ Yes | โ No | โ No | โ No |
| Educational Focus | โ Specialized | โ Specialized | โ Math Focus | |
| Voice Support | โ Built-in | โ Separate App | โ Limited | โ No |
| Quizzes | โ Interactive | โ No | โ Yes | โ No |
| Math Solver | โ Step-by-step | โ Yes | โ Advanced | |
| Customization | โ Full Control | โ Limited | โ No | โ No |
- Students (middle school to university)
- Self-learners exploring science and technology
- Parents helping with children's homework
- Teachers using interactive classroom tools
- Privacy-conscious users keeping data local
- Budget-conscious learners avoiding subscription fees
- Offline learners in areas with limited internet
- User authentication and progress tracking
- More interactive learning modules
- Advanced quiz analytics
- Multi-language support
- Mobile app development
- Integration with more LLM providers
- Collaborative learning features
- Advanced visualization tools
- Personalized learning paths
- AI-generated practice problems
- Integration with educational platforms
- Voice-first learning experience
- Advanced assessment tools
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes: Add features, fix bugs, improve documentation
- Test thoroughly: Ensure everything works as expected
- Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Submit pull request: Describe your changes clearly
- Follow PEP 8 coding standards
- Add comments for complex logic
- Update documentation for new features
- Test with and without LLM integration
- Ensure mobile responsiveness
App won't start:
# Check Python version
python --version
# Reinstall dependencies
pip install -r requirements.txt --upgrade
# Check for port conflicts
netstat -ano | findstr :5000TTS not working:
- Ensure pyttsx3 is installed correctly
- Check system audio settings
- Try toggling voice on/off in the interface
LLM connection issues:
- Verify LLM server is running
- Check firewall settings
- Review LLM_SETUP_GUIDE.md
spaCy model missing:
python -m spacy download en_core_web_sm- ๐ Check
LLM_SETUP_GUIDE.mdfor detailed setup instructions - ๐ฌ Open an issue on GitHub for bugs or questions
- ๐ง Contact the maintainers for urgent issues
This project is licensed under the MIT License - see the LICENSE file for details.
- spaCy: Advanced natural language processing
- Flask: Lightweight and powerful web framework
- pyttsx3: Cross-platform text-to-speech library
- Ollama: Making local LLMs accessible
- The open-source community: For continuous inspiration and support
โญ Star this project if you find it helpful!
Report Bug โข Request Feature โข Contribute
Made with โค๏ธ for learners everywhere