An Applied ML course project featuring an agent with context-aware memory, a reasoning planner, and adaptive inference stopping.
- Adaptive Stopping: Simple questions bypass heavy reasoning to save tokens and time.
- Session Memory: Remembers your learning level and past topics.
- Gemini Integration: Uses Google's Gemini 1.5 Flash for high-speed ML explanations with low cost.
- RAG: Implements the slides from Applied Machine Learning and Applied Deep Learning as RAG and allows for uploading new slides.
- Secure Code Execution: Uses Docker sandboxing to safely run and verify Python code generated by the agent.
- Learning Dynamics: Record and Visualize Users' weaknesses in certain topics.
- Battle Mode and Interview Mode: Creative modes that test and challenge users' understandings.
- Python 3.9+
- Docker Desktop (Required for the code execution feature)
- Download and install Docker Desktop.
- IMPORTANT: Ensure Docker is running in the background before starting the app.
- Google Gemini API Key
- You need a valid API key for Gemini 1.5 Flash.
git clone https://github.com/Sandman-R/AML-final-Project.git
cd AML-final-Projectpython -m venv venv
# Mac/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activatepip install -r requirements.txtCreate a file named .env in the root directory and add your Google API key:
# Create .env file
touch .envContent of .env:
GOOGLE_API_KEY=your_actual_api_key_hereYou can start the server using uvicorn or directly via Python:
# Option 1 (Recommended)
uvicorn main:app --reload
# Option 2
python main.pyThe server will start at: http://127.0.0.1:8000
- Open the UI: Navigate to
http://127.0.0.1:8000in your browser. - Upload Slides (Optional):
- Click "Upload PDF" in the sidebar.
- Upload your course slides (e.g.,
Lecture1_Intro.pdf). - Wait for the "Index Rebuilt" notification.
- Ask Questions:
- Try asking for code: "Write a PyTorch training loop." (Triggers Code Mode)
- Try asking for math: "Derive the gradient for Log Loss." (Triggers Math Mode)
- Battle Mode:
- Click the "Battle Mode" toggle.
- Propose a concept (e.g., "I think overfitting is good.") and see the agent challenge you.
- Check Analytics:
- Watch the Mastery Curve on the right update as you interact.
- Click on any Weakness Tag to simulate an interview question for that topic.