CoolFace
Apppublic

Apurv255/Ai-productivity-coach

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes
App README

๐Ÿง  AI Productivity Coach (RL-Based)

A Reinforcement Learning-based AI system that helps users optimize focus, reduce distractions, and manage fatigue dynamically.


๐Ÿš€ Features

  • โ€”Reinforcement Learning Agent (Q-Learning)
  • โ€”Real-world productivity simulation environment
  • โ€”Dynamic reward system (focus, fatigue, distractions)
  • โ€”FastAPI backend
  • โ€”Interactive frontend (HTML/CSS/JS)
  • โ€”Dockerized deployment

๐Ÿง  Environment

Observation Space

  • โ€”focus_level (0โ€“1)
  • โ€”fatigue (0โ€“1)
  • โ€”distractions (list)
  • โ€”time_spent
  • โ€”deadline

Action Space

  • โ€”continue
  • โ€”take_break
  • โ€”block_distraction

๐ŸŽฏ Reward Design

  • โ€”Positive reward for focus improvement
  • โ€”Penalty for fatigue and distractions
  • โ€”Bonus for clean environment (no distractions)
  • โ€”Time pressure penalty near deadline

๐Ÿ”Œ API Endpoints

  • โ€”/reset โ†’ Initialize environment
  • โ€”/step_rl โ†’ Run RL step (returns state, reward, done)
  • โ€”/step โ†’ UI-based AI advice
  • โ€”/score โ†’ Get agent performance score
  • โ€”/health โ†’ Health check

โ–ถ๏ธ Run Locally

bash
uvicorn app.main:app --reload

๐Ÿณ Run with Docker

bash
docker build -t focusforge .
docker run -p 7860:7860 focusforge

๐Ÿงช Run Inference

bash
python inference.py

๐Ÿ“Š Evaluation

Score range: 0 โ†’ 1

AgentScore
Random agent~0.21
Trained Q-agent~0.74

Based on average focus, total reward, and distractions managed.


๐Ÿ“ Project Structure

focusforge/
โ”‚
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ env.py
โ”‚   โ”œโ”€โ”€ agent.py
โ”‚   โ”œโ”€โ”€ models.py
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ script.js
โ”‚   โ””โ”€โ”€ style.css
โ”‚
โ”œโ”€โ”€ inference.py
โ”œโ”€โ”€ openenv.yaml
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ””โ”€โ”€ README.md

๐Ÿ‘จโ€๐Ÿ’ป Author

Apurv