Skip to content

sanskaryo/RL-Tutor-Project

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

RL-Based Personalized Educational Tutor ๐ŸŽ“๐Ÿค–

A full-stack intelligent tutoring system that uses Reinforcement Learning (Q-Learning) to personalize educational content delivery based on individual student performance and learning patterns.

๐ŸŽฏ Overview

This university mini-project demonstrates a practical application of reinforcement learning in education. The system adapts to each student's knowledge level and learning style, recommending appropriate content in real-time using a Q-Learning agent.

Key Features

  • ๐Ÿง  Q-Learning Agent - Adaptive content recommendation
  • ๐Ÿ“Š Real-time Analytics - Track progress and performance
  • ๐ŸŽจ Modern UI - Beautiful landing page with Aceternity UI
  • ๐Ÿ” Secure Authentication - JWT-based with refresh tokens
  • ๐Ÿ“ˆ Progress Tracking - Detailed learning analytics
  • โšก Fast Backend - FastAPI with async support
  • ๐ŸŽฎ Interactive Demo - Try the system without signup
  • ๐Ÿ” RL Visualization - See how Q-Learning works
  • ๐Ÿงช Comprehensive Tests - 90%+ test coverage

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.8+
  • npm or yarn

1. Frontend (Next.js)

# Install dependencies
npm install

# Run development server
npm run dev

Visit: http://localhost:3000

2. Backend (FastAPI)

# Navigate to backend
cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment (Windows)
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Seed database
python seed_db.py

# Run server
  
  python -m uvicorn main:app --host 0.0.0.0 --port 8002

Visit: http://localhost:8000/docs (API Documentation)

๐Ÿ“ Project Structure

mini_project/
โ”œโ”€โ”€ app/                      # Next.js Frontend
โ”‚   โ”œโ”€โ”€ components/ui/       # Aceternity UI components
โ”‚   โ”œโ”€โ”€ lib/                 # Utilities
โ”‚   โ””โ”€โ”€ page.tsx            # Landing page
โ”œโ”€โ”€ backend/                 # FastAPI Backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ api/            # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ core/           # Configuration
โ”‚   โ”‚   โ”œโ”€โ”€ models/         # Database models
โ”‚   โ”‚   โ””โ”€โ”€ services/       # RL Agent & Student Model
โ”‚   โ”œโ”€โ”€ main.py             # FastAPI app
โ”‚   โ””โ”€โ”€ seed_db.py          # Database seeding
โ”œโ”€โ”€ INTEGRATION.md          # Integration guide
โ”œโ”€โ”€ PROJECT_SUMMARY.md      # Detailed project info
โ””โ”€โ”€ TODO.txt               # Project checklist

๐Ÿ”Œ API Endpoints

Authentication

  • POST /api/v1/auth/register - Register new student
  • POST /api/v1/auth/login - Login and get JWT token

Learning Sessions

  • POST /api/v1/session/start - Start session, get recommended content
  • POST /api/v1/session/answer - Submit answer, get feedback
  • GET /api/v1/session/progress - Get learning progress

Analytics

  • GET /api/v1/analytics/dashboard - Complete dashboard data
  • GET /api/v1/analytics/rl-stats - RL agent statistics

๐Ÿง  RL Agent

Q-Learning Algorithm

  • State Space: 4D knowledge vector (algebra, calculus, geometry, statistics)
  • Action Space: Content selection from available pool
  • Reward Function:
    • Correctness (+1.0 correct, -0.5 wrong)
    • Time efficiency (bonus for quick answers)
    • Difficulty appropriateness (bonus for matching level)
  • Exploration: Epsilon-greedy (ฮต = 0.1)
  • Learning Rate: ฮฑ = 0.1
  • Discount Factor: ฮณ = 0.95

๐Ÿงช Testing

The project includes comprehensive test coverage:

Unit Tests (20+ tests)

cd backend
pytest test_rl_agent.py -v

Integration Tests

cd backend
python test_integration.py

End-to-End Tests (13 scenarios)

cd backend
python test_e2e.py

Test Credentials

  • Username: testuser
  • Password: test123

Interactive Testing

Visit http://localhost:8000/docs for Swagger UI

Documentation

See TESTING.md for complete testing guide

๐Ÿ“Š Database

Content Available

  • Algebra: 5 questions (difficulty 1-4)
  • Calculus: 4 questions (difficulty 1-4)
  • Geometry: 4 questions (difficulty 1-3)
  • Statistics: 4 questions (difficulty 1-3)

Models

  • Students, Content, LearningSession, StudentKnowledge, PerformanceMetrics

๐Ÿ“š Documentation

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 16 + React 19
  • TypeScript
  • Tailwind CSS v4
  • Framer Motion (as 'motion')
  • Aceternity UI Components
  • Lucide Icons

Backend

  • FastAPI
  • SQLAlchemy
  • Pydantic
  • JWT Authentication
  • NumPy, Pandas, Scikit-learn

Database

  • SQLite (development)
  • PostgreSQL (production ready)

๐ŸŽฏ Current Status

โœ… COMPLETED

  • Backend API fully functional
  • RL Agent implemented
  • Database seeded with content
  • Landing page with animations
  • Authentication system
  • Learning session management
  • Analytics endpoints

โณ IN PROGRESS

  • Frontend-backend integration
  • Dashboard UI
  • Learning session interface

๐Ÿ”— URLs

๐Ÿ‘ฅ Team

  • Sanskar Khandelwal - AI Research Lead
  • Ayush Saroj - Full stack
  • Krishna mittal- devops

๐Ÿ“ Next Steps

  1. Create API client in Next.js
  2. Build login/register pages
  3. Create student dashboard
  4. Build quiz interface
  5. Add progress visualization
  6. Deploy to production

๐Ÿ“– Learn More


University Mini-Project | Reinforcement Learning Application | Educational Technology


๐Ÿ“š Documentation


๐ŸŽฎ Demo Features

Interactive Demo

Visit /demo to try a 5-step walkthrough of the system without creating an account.

RL Visualization

Visit /rl-viz to see how the Q-Learning agent makes decisions in real-time.


Project Status: 98% Complete โœ…
Last Updated: October 22, 2025

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Aceternity UI setup

This project is prepared to use components from Aceternity UI (Tailwind-based components).

Installed/required packages:

  • Tailwind CSS v4 (already configured via @tailwindcss/postcss and @import "tailwindcss" in app/globals.css)
  • motion (Framer Motion v11)
  • clsx
  • tailwind-merge
  • lucide-react (icons)

Utility:

  • lib/utils.ts exports a cn helper for merging class names with Tailwind-merge.

Optional install (if any of the above are missing):

npm i motion clsx tailwind-merge lucide-react

Usage example:

import { cn } from "@/lib/utils";

export function Example({ active }: { active?: boolean }) {
	return (
		<button className={cn("px-4 py-2 rounded-md", active && "bg-black text-white")}>Click</button>
	);
}

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 51.1%
  • TypeScript 46.2%
  • Shell 0.9%
  • CSS 0.6%
  • HTML 0.5%
  • JavaScript 0.3%
  • Other 0.4%