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
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
Fix: Handle AIMessage in all LLM invoke calls
FocusFlow Assistant
c1ce963
Fix: Handle AIMessage response from ChatHuggingFace
FocusFlow Assistant
220685e
Remove duplicate get_llm() from rag_engine.py - use config.py version
FocusFlow Assistant
01dcc8c
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
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