A terminal-based AI study companion supporting OpenAI (ChatGPT) and Google Gemini.
- ✅ Multi-AI Support: Switch between OpenAI (ChatGPT) and Gemini
- ✅ Ask Questions: Get instant answers to academic questions
- ✅ Study Plans: Generate customized study schedules
- ✅ Concept Explanation: Explain topics in different styles
- ✅ Motivation: Get motivational advice and tips
- ✅ Progress Tracking: View learning statistics
- ✅ Profile Management: Customize your profile
- ✅ History Export: Save conversation history
- Java 11 or higher installed on your system
- An API key from at least one AI provider:
- OpenAI (ChatGPT) - Get API key
- Google Gemini - Get API key
-
Download the project files (StudyMentor.java, Profile.java, AIProvider.java, DataHandler.java, ProgressTracker.java)
-
Compile the Java files
javac *.java -
Set up your API key (choose one or both)
For Windows (Command Prompt):
set OPENAI_API_KEY=your-openai-api-key-here set GOOGLE_API_KEY=your-gemini-api-key-here
For Windows (PowerShell):
$env:OPENAI_API_KEY='your-openai-api-key-here' $env:GOOGLE_API_KEY='your-gemini-api-key-here'
For Linux/Mac:
export OPENAI_API_KEY='your-openai-api-key-here' export GOOGLE_API_KEY='your-gemini-api-key-here'
-
Run the application
java StudyMentor
When you run StudyMentor for the first time:
- Enter your name, grade, email (optional), and subjects
- Choose your preferred AI provider (OpenAI or Gemini)
- Start using the features!
- 1. 💬 Ask a Question - Get answers to any academic question
- 2. 📋 Create Study Plan - Generate personalized study schedules
- 3. 🧠 Explain Concept - Get explanations in different styles (ELI5, Technical, Visual, Analogy)
- 4. 💪 Get Motivation - Receive motivational advice
- 5. 📈 View Progress - See your learning statistics
- 6. 👤 Manage Profile - Update your profile information
- 7. 💾 Export History - Save conversation history to a text file
- 8. 🔄 Change AI Provider - Switch between OpenAI and Gemini
- 9. 📊 View Statistics - Detailed statistics view
- 0. 🚪 Exit - Save and exit
StudyMentor stores data locally:
studymentor_config.json- Your profile informationstudy_history.json- Conversation historystudy_stats.json- Statistics and progressstudy_history_*.txt- Exported conversation logs
You can switch between AI providers at any time:
- Select option 8 from the main menu
- Choose OpenAI or Gemini
- Make sure the corresponding API key is set
- Continue learning!
Your profile includes:
- Name
- Grade/Level
- Email (optional)
- Subjects you're studying
- Preferred AI provider
⚠️ Warning: OpenAI API key not found!
Solution: Make sure you've set the API key in your terminal before running the program.
❌ Error: API Error: 401
Solution:
- Verify your API key is correct
- Check if you have sufficient API credits/quota
- Ensure you're using the correct environment variable name
error: cannot find symbol
Solution:
- Ensure all Java files are in the same directory
- Make sure you're using Java 11 or higher:
java -version - Compile all files:
javac *.java
💬 Ask Your Question
──────────────────────────────────────────────────────────────
Your question: Explain the Pythagorean theorem
🤖 OpenAI is thinking...
📝 Response:
──────────────────────────────────────────────────────────────
The Pythagorean theorem states that in a right triangle...
📋 Study Plan Generator
──────────────────────────────────────────────────────────────
Subject/Topic: Organic Chemistry
Duration (days): 30
Daily study time (hours): 2
Current knowledge level: Beginner
🤖 Gemini is thinking...
📝 30-Day Organic Chemistry Study Plan Generated!
- Be Specific: The more detailed your questions, the better the AI can help
- Use Study Plans: Structure your learning for maximum efficiency
- Export History: Keep records of important explanations
- Try Both AIs: Test which provider works best for your needs
- Regular Sessions: Consistent practice improves learning
This is a 50-60% implementation featuring:
- ✅ Core functionality (Ask Questions, Study Plans, Concept Explanation, Motivation)
- ✅ Profile management
- ✅ Progress tracking
- ✅ History export
- ✅ Dual AI provider support (OpenAI & Gemini)
Not yet implemented (for future versions):
- ⏳ Quiz Mode
- ⏳ Flashcard Generator
- ⏳ Problem Solver
- ⏳ Advanced analytics
- ⏳ Spaced repetition
This project is open source and available for educational purposes.
- OpenAI for ChatGPT API
- Google for Gemini API
Happy Studying! 🎓