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.
- 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
- 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
- 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
- β° 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
# Copy example configuration
cp .env.example .env
# Edit and add your API keys
nano .envGet Free API Keys:
- YouTube API - For video recommendations
- Perplexity API - For web search
- OMDb API - For movie data
Edit interests.json with your learning preferences:
- YouTube topics (Quantum Mechanics, Philosophy, etc.)
- Research paper fields and ArXiv categories
- Movie preferences (directors, genres, style)
macOS / Linux:
./run.shWindows:
run.batNavigate to: http://localhost:5000/dashboard
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 |
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?
- π 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
- Complete Setup Guide - Detailed configuration and troubleshooting
- API Documentation - All available endpoints
- Configuration Reference - Full
.envandinterests.jsonoptions
GET /api/schedule/daily- Get today's 3-hour scheduleGET /api/schedule/current-block- Get active content blockPOST /api/content/rate- Rate content (1-5 stars)POST /api/movie/post-review- Submit movie review
GET /api/plans- List all plansPOST /api/plans/generate- Generate new planGET /api/plans/<id>/current-day- Get current day
GET /api/stats/daily- Daily statisticsGET /api/activity/today- Activity logsGET /api/focus/current- Current focus state
# 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{
"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
}
}NO_DAEMONS=1 ./run.shexport RFAI_DB_PATH="/path/to/database.db"
./run.shDEBUG=1 ./run.sh# Via API
curl http://localhost:5000/api/activity/today > focus_data.json
# Or click "Export Focus Data" in dashboardRFAI 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.
| 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
- β API keys never logged or printed
- β
.envin.gitignore- safe from commits - β Camera/screen tracking is opt-in
- β All data stored locally
- β No cloud uploads without explicit config
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
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
The original Learning_AI demo is preserved in legacy/learning_ai_basic/ for reference.
This is a personal learning system, but suggestions are welcome! Please ensure:
- API keys remain secure
- Privacy features stay opt-in
- Documentation is updated
MIT License - See LICENSE file
- Read SETUP_GUIDE.md
- Check
rfai.logfor errors - Test API endpoints: http://localhost:5000/api/status
- Verify API keys are valid
Made with π§ for structured, intentional learning