Skip to content

nehraa/Learning_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ RFAI (Routine Focus AI)

Your Intelligent Time-Block Learning System with Real Content & Progress Tracking

RFAI is an AI-powered learning companion that structures your day into focused learning blocks, fetches actual educational content, and tracks your progress through quizzes and analytics.

πŸŽ‰ What's New (v2.1)

βœ… Real Content Fetching

  • YouTube Videos: Actual videos from YouTube API (not just topics!)
  • Research Papers: Real papers from ArXiv based on your interests
  • Movies: Curated recommendations from IMDB
  • Auto-Display: Content shows automatically on dashboard per time block

βœ… AI-Powered Study Plans

  • Perplexity Integration: Get personalized recommendations from your study plan
  • Smart Discovery: AI finds best videos, papers, books for your goals
  • Context-Aware: Recommendations adapt to your learning progress

βœ… Progress Testing & Quizzes

  • Quiz Generation: Create tests for any topic (Quantum Computing, ML, etc.)
  • Auto-Grading: Instant feedback with explanations
  • Progress Tracking: View scores, weak areas, improvement trends
  • Subject Analytics: Track progress per topic

✨ Core Features

  • ⏰ Time-Block System - 3 daily blocks: Science (3h), Self-Help (1h), Movies (1.5h)
  • πŸ”’ Soft-Lock Access Control - Content restricted during active blocks for focus
  • πŸ“Ή Multimodal Attention - Camera, mic, keyboard, mouse tracking
  • 🎨 Dynamic Themes - Visual themes change per time block
  • πŸ“Š Real-Time Dashboard - Shows content, attention score, progress
  • πŸ’Ύ Session Management - Track learning sessions with analytics
  • πŸ”’ Privacy-First - All data local, camera/mic optional

πŸš€ Quick Start (2 Minutes)

1. Configure API Keys

# Copy example configuration
cp .env.example .env

# Edit and add your API keys
nano .env

Get Free API Keys:

2. Customize Your Interests

Edit interests.json with your learning preferences:

  • YouTube topics (Quantum Mechanics, Philosophy, etc.)
  • Research paper fields and ArXiv categories
  • Movie preferences (directors, genres, style)

3. Run the Application

macOS / Linux:

./run.sh

Windows:

run.bat

4. Open Dashboard

Navigate to: http://localhost:5000/dashboard

πŸ“– How It Works

Your 3-Hour Daily Learning Plan

RFAI implements a structured learning schedule based on daily_3hr_plan.md:

Time Block Duration Content Purpose
YouTube 1 hour Educational entertainment Animated history, philosophy, self-help
Papers 1 hour Academic research ArXiv papers on your topics
Movies 1-2 hours Artistic films Film-school quality cinema

Content Intelligence

YouTube Filtering:

  • βœ… Educational - Pure learning (lectures, tutorials)
  • βœ… Learning-Borderline - What you want (educational entertainment)
  • ❌ Entertainment - Excluded (vlogs, reactions, gaming)

Movie Classification:

  • 🎬 Artistic - Film school worthy (Tarkovsky, Kubrick, etc.)
  • ⭐ Good Generic - Well-rated commercial films
  • 🚫 Pure Entertainment - Excluded

After each movie, the system prompts you to reflect:

  • What was the central theme?
  • How did cinematography enhance the story?
  • What techniques stood out?
  • What did you learn?

Dashboard Features

  • πŸ“Š Time Allocation Chart - Visual breakdown of daily hours
  • πŸ“ˆ Focus Over Time - Track your attention levels
  • βœ… Progress Tracker - See completion towards 3-hour goal
  • 🎯 Current Position - Know your week and day in the plan
  • πŸ“ Content Recommendations - Direct links to videos, papers, films

πŸ“š Documentation

πŸ”Œ API Endpoints

Schedule & Content

  • GET /api/schedule/daily - Get today's 3-hour schedule
  • GET /api/schedule/current-block - Get active content block
  • POST /api/content/rate - Rate content (1-5 stars)
  • POST /api/movie/post-review - Submit movie review

Learning Plans

  • GET /api/plans - List all plans
  • POST /api/plans/generate - Generate new plan
  • GET /api/plans/<id>/current-day - Get current day

Activity & Stats

  • GET /api/stats/daily - Daily statistics
  • GET /api/activity/today - Activity logs
  • GET /api/focus/current - Current focus state

🎯 Configuration

Environment Variables (.env)

# Required
YOUTUBE_API_KEY=your_key
PERPLEXITY_API_KEY=your_key
OMDB_API_KEY=your_key

# Optional
NOTION_API_KEY=your_key
GEMINI_API_KEY=your_key
OLLAMA_BASE_URL=http://localhost:11434

Learning Interests (interests.json)

{
  "youtube_interests": {
    "topics": ["Quantum Mechanics", "Philosophy"],
    "content_style": "learning_borderline_entertainment"
  },
  "research_paper_interests": {
    "fields": ["Physics", "Neuroscience"],
    "arxiv_categories": ["quant-ph", "q-bio.NC"]
  },
  "movie_interests": {
    "style": "artistic_film_school",
    "directors": ["Tarkovsky", "Kubrick"],
    "post_viewing_review": true
  }
}

πŸ› οΈ Advanced Options

Disable Background Daemons

NO_DAEMONS=1 ./run.sh

Custom Database Location

export RFAI_DB_PATH="/path/to/database.db"
./run.sh

Enable Debug Logging

DEBUG=1 ./run.sh

Export Focus Data for ML Analysis

# Via API
curl http://localhost:5000/api/activity/today > focus_data.json

# Or click "Export Focus Data" in dashboard

πŸ“Š Data Collection

RFAI collects data locally for your analysis:

  • Activity logs (apps, websites, duration)
  • Focus states (when daemons enabled)
  • Content ratings and reviews
  • Time allocation breakdown

All data stays on your machine. Export anytime for your own ML experiments.

πŸ› Troubleshooting

Problem Solution
API keys not working Check .env file, restart server
Learning plan shows 0 hours Verify daily_3hr_plan.md format
No content recommendations Test API keys, check interests.json
Focus data empty Enable daemons, check platform support

Full troubleshooting guide: SETUP_GUIDE.md

πŸ”’ Privacy & Security

  • βœ… API keys never logged or printed
  • βœ… .env in .gitignore - safe from commits
  • βœ… Camera/screen tracking is opt-in
  • βœ… All data stored locally
  • βœ… No cloud uploads without explicit config

πŸ“¦ Dependencies

Core dependencies are listed in requirements.txt:

  • Flask - API server
  • ArXiv - Paper search
  • Chart.js - Dashboard visualizations
  • ChromaDB - Vector storage (for advanced features)
  • Sentence Transformers - Content embeddings

πŸ—‚οΈ Project Structure

Learning_AI/
β”œβ”€β”€ rfai/
β”‚   β”œβ”€β”€ api/           # API server
β”‚   β”œβ”€β”€ ai/            # AI components (scheduler, parser, RL)
β”‚   β”œβ”€β”€ integrations/  # YouTube, ArXiv, EdX, IMDb
β”‚   β”œβ”€β”€ ui/            # Dashboard UI
β”‚   └── config/        # Configuration loaders
β”œβ”€β”€ database/          # SQLite schema and init
β”œβ”€β”€ .env.example       # API key template
β”œβ”€β”€ interests.json     # User preferences
β”œβ”€β”€ daily_3hr_plan.md  # 52-week learning plan
└── SETUP_GUIDE.md     # Complete setup docs

πŸŽ“ Legacy Version

The original Learning_AI demo is preserved in legacy/learning_ai_basic/ for reference.

🀝 Contributing

This is a personal learning system, but suggestions are welcome! Please ensure:

  • API keys remain secure
  • Privacy features stay opt-in
  • Documentation is updated

πŸ“„ License

MIT License - See LICENSE file

πŸ†˜ Need Help?

  1. Read SETUP_GUIDE.md
  2. Check rfai.log for errors
  3. Test API endpoints: http://localhost:5000/api/status
  4. Verify API keys are valid

Made with 🧠 for structured, intentional learning

About

An open-source, self-hosted system that automatically finds, rates, and learns your taste for deep research papers and advanced free courses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors