Skip to content

Sandman-R/AML-final-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personalized ML Learning Agent

An Applied ML course project featuring an agent with context-aware memory, a reasoning planner, and adaptive inference stopping.

Features

  • 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.

Prerequisites

  1. Python 3.9+
  2. 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.
  3. Google Gemini API Key
    • You need a valid API key for Gemini 1.5 Flash.

Setup Instructions

1. Clone the Repository

git clone https://github.com/Sandman-R/AML-final-Project.git
cd AML-final-Project

2. Set up Virtual Environment (Recommended)

python -m venv venv
# Mac/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a file named .env in the root directory and add your Google API key:

# Create .env file
touch .env

Content of .env:

GOOGLE_API_KEY=your_actual_api_key_here

5. Run the Application

You can start the server using uvicorn or directly via Python:

# Option 1 (Recommended)
uvicorn main:app --reload

# Option 2
python main.py

The server will start at: http://127.0.0.1:8000

How to Use

  1. Open the UI: Navigate to http://127.0.0.1:8000 in your browser.
  2. Upload Slides (Optional):
    • Click "Upload PDF" in the sidebar.
    • Upload your course slides (e.g., Lecture1_Intro.pdf).
    • Wait for the "Index Rebuilt" notification.
  3. 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)
  4. Battle Mode:
    • Click the "Battle Mode" toggle.
    • Propose a concept (e.g., "I think overfitting is good.") and see the agent challenge you.
  5. 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.

About

Source files for final project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors