Bypass YouTube CORS/blocking by fetching transcripts through
the public Invidious API server-side.
Changes:
- Added get_youtube_transcript using Invidious to rag_engine.py
- Added /ingest_youtube endpoint to backend/main.py
- Refactored app.py URL parsing to hit backend directly
- Removed browser-side JS component and youtube_transcript.html
feat: browser-side YouTube transcript fetching
FocusFlow Assistant
dcf165e
YouTube transcripts are now fetched from the user's browser via JS,
bypassing HuggingFace Spaces outbound network restrictions.
Changes:
- New: frontend/youtube_transcript.html - browser-side JS component
- New: POST /ingest_text endpoint for raw text ingestion
- New: ingest_text() in rag_engine.py (reuses chunking pipeline)
- Updated: app.py URL section uses browser-side fetch for YouTube
- Removed: _fetch_youtube_transcript() server-side function
- Removed: youtube-transcript-api, google-api-python-client deps
- Simplified: ingest_url() now handles only web pages
fix: pre-download embedding model during Docker build to avoid DNS failures on HF Spaces
FocusFlow Assistant
3c23e28
- Pre-cache sentence-transformers/all-MiniLM-L6-v2 model in Docker image
- Set TRANSFORMERS_OFFLINE=1 and HF_HUB_OFFLINE=1 to prevent runtime downloads
- Add DNS warmup delay in startup script
- Increase health check timeout to 90 seconds
- Add .dockerignore to exclude venv/ and local data dirs
- Update embeddings config with explicit CPU device and normalization
Replace YouTube fetch with timedtext API - no API keys needed, works from any server
FocusFlow Assistant
cecb03b
Add YouTube Data API v3 for cloud-reliable transcript fetching with local fallback
FocusFlow Assistant
f723af8
Add auto-generated caption support for YouTube: multi-priority fetch, shorts URLs, transcript cleanup
FocusFlow Assistant
80a8392
Fix YouTube transcript API: migrate to v1.x instance-based API (fetch + t.text)
FocusFlow Assistant
ec090b6
Add OCR fallback for scanned/image PDFs using pytesseract + pdf2image
FocusFlow Assistant
2c32e38
Fix PDF upload empty embeddings error: add validation for scanned/image-only PDFs
FocusFlow Assistant
4adfbc0
fix: Use langchain_core.documents instead of deprecated langchain.schema
FocusFlow Assistant
6649259
fix: Define logger before use in import error handler
FocusFlow Assistant
325edbc
fix: Move youtube-transcript-api imports to top level
FocusFlow Assistant
09826dd
- Fixed ImportError by moving imports to module level
- Added HAS_YOUTUBE_API flag for graceful degradation
- Removed duplicate imports from function
- Better error message if library not installed
feat: Enable YouTube URLs in cloud with youtube-transcript-api
FocusFlow Assistant
d270665
- Added youtube-transcript-api for reliable transcript fetching
- Implemented retry logic with exponential backoff
- Works in both local and cloud (HF Spaces)
- Better error messages for no captions, invalid URLs
- Increased timeout to 120s for YouTube processing
- Removed cloud mode restriction - feature now universal
fix: Add logger and fix imports for URL ingestion
FocusFlow Assistant
5b913e8
fix: Add missing logger import
FocusFlow Assistant
78d63c0
fix: Improve URL ingestion error handling and connectivity check
FocusFlow Assistant
19f586f
Add health check endpoint
FocusFlow Assistant
740d386
Add multi-user support with session-based student IDs
FocusFlow Assistant
3e0882a
- Modified StudentProfileManager to accept student_id parameter
- Updated all FastAPI endpoints to use dependency injection
- Each browser session gets unique student_id
- Data isolated per user in Supabase
- Backward compatible with local mode
Fix: Ensure current_state exists before saving plan
FocusFlow Assistant
6dab24d
Add Supabase persistent storage support
FocusFlow Assistant
479eeb5
- Created supabase_storage.py adapter with comprehensive error handling
- Modified student_data.py to conditionally use Supabase or local JSON
- Added USE_SUPABASE env var to Dockerfile
- Maintains backward compatibility with local deployments
- Graceful fallback if Supabase unavailable
Fix: Handle AIMessage in all LLM invoke calls
FocusFlow Assistant
c1ce963
Fix: Handle AIMessage response from ChatHuggingFace
FocusFlow Assistant
220685e
Fix: Use ChatHuggingFace wrapper for chat models
FocusFlow Assistant
cb292b6
Fix: Remove unsupported task parameter from HF API
FocusFlow Assistant
37f781f
Remove duplicate get_llm() from rag_engine.py - use config.py version
FocusFlow Assistant
01dcc8c
Fix: Use max_new_tokens instead of max_length for HF API
FocusFlow Assistant
f5d9c37
Fix: Use HuggingFace embeddings in cloud mode
FocusFlow Assistant
df3e7e5
- Added get_embeddings() function to config.py
- Replaced all OllamaEmbeddings with get_embeddings()
- Supports both local (Ollama) and cloud (HF) deployments
- Fixes file upload error on HF Spaces
Add hybrid deployment: Ollama (local) + Hugging Face (cloud)
FocusFlow Assistant
8cab7c7
- Created backend/config.py for LLM provider switching
- Added get_llm() function with environment-based configuration
- Supports LLM_PROVIDER env var (ollama/huggingface)
- Updated requirements.txt with HuggingFace dependencies
- Replaced all hardcoded Ollama calls with get_llm()
Local mode (default): Uses Ollama llama3.2:1b for offline
Cloud mode: Uses HF Llama-3-8B via Inference API for demo
Features:
- Auto-detects new calendar day on app startup
- Advances current_study_day when date changes
- Auto-unlocks topics for the new day
- Shows correct day's topics in 'Today's Topics' section
Changes:
- app.py: Added date detection logic, updated Today's Topics to use current_study_day
- backend/student_data.py: Added current_study_day and last_access_date to profile
- backend/main.py: Updated save_progress endpoint for new fields
Fixes issue where Jan 7 topics wouldn't appear after completing Jan 6
Production code cleanup - remove debug statements and duplicates
FocusFlow Assistant
ea52e8c
Cleanup Summary:
- Removed duplicate query_knowledge_base function (37 lines)
- Removed 19 debug print statements across all files
- Kept only essential error logging
- Code is now production-ready and deployment-optimized
Files cleaned:
- backend/rag_engine.py: Removed duplicate function + 14 prints
- app.py: Removed 3 debug prints
- backend/student_data.py: Removed 2 debug prints
- Overall: ~60 lines of unused code eliminated
Add data persistence and comprehensive citation system
FocusFlow Assistant
6d15ebb
Major Features Added:
- Data Persistence: JSON-based student profile storage in ~/.focusflow/
- Auto-save on plan generation and quiz completion
- Session resumption with progress restoration
- Tracks quiz scores, mastery levels, and incomplete tasks
- Citation System: Comprehensive source references for verifiability
- Chat responses show expandable source citations (filename + page)
- Lesson content includes inline citations and References section
- Citations in both main chat and Focus Mode
- UI Improvements:
- Toast notifications for save/load feedback
- Enhanced error handling with user-visible messages
- Better source formatting with numbered lists
Files Modified:
- app.py: Added profile loading, auto-save, citation display
- backend/main.py: Added 7 profile API endpoints
- backend/rag_engine.py: Enhanced with source extraction and citations
- backend/student_data.py: New StudentProfileManager class
Major improvements: Multi-subject plan generation, enhanced quiz/lesson quality, fixed UI layout
FocusFlow Assistant
a689464
- Restructured plan to create multiple topics per day (one per subject)
- Improved lesson generation with comprehensive 600-800 word content
- Enhanced quiz generation with realistic answer choices and context-based fallbacks
- Fixed Study Assistant layout: contained chat and scrollable lesson panel
- Removed multilingual support and reverted to English-only
- Fixed analytics subject tab extraction
- Removed dialog decorator error
- All topics now unlock automatically after quiz completion
feat: Implement AI Plan Generator (Lite Mode) and Focus Mode Layout
FocusFlow Assistant
e60bafd
Update backend RAG logic, app UI, and add documentation