Generate learning tasks from YouTube video transcripts and get AI feedback on answers. Uses Hugging Face models (Inference API) and RAG over the transcript.
- Transcript: YouTube URL → transcript (and optional language detection) via
youtube-transcript-apiand a small LangChain chain. - RAG: Transcript split into chunks, embedded with
sentence-transformers(multilingual MiniLM), stored in FAISS; retriever used for evaluation and Q&A. - Task generation: LLM (Hugging Face Inference API) produces structured tasks: comprehension, multiple choice, fill-in-the-blanks, vocabulary, reflection.
- Answer evaluation: User answer + task + RAG context → same LLM → short feedback and suggestions.
- Agent: Follow-up questions answered using transcript search + LLM (no separate tool-calling agent).
- UI: Streamlit app: paste URL → generate workbook → answer tasks → submit for feedback; optional follow-up question per task.
- In the sidebar, paste a YouTube URL (video must have captions).
- Set number of tasks and language (e.g.
en,ru). - Click Generate. After loading, tasks appear on the main page.
- Use ← Previous / Next → to switch between tasks. Type your answer and click Submit answer to receive feedback.
- Use the Follow-up question field and click Ask to get an answer based on the video transcript.
Build and run the Streamlit app in a container:
docker build -t edutube-tasks .
docker run -p 8501:8501 -e HUGGINGFACEHUB_API_TOKEN=your_token edutube-tasksOpen http://localhost:8501. The image runs flake8 at build time; tests are not run in the default CMD (run them in CI or locally).
- Clone the repo and create a virtual environment:
python -m venv .venv source .venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Copy env and set your token:
cp .env-example .env
- Run the app (from project root):
PYTHONPATH=. streamlit run src/app.py
All optional; see .env-example.
| Variable | Description |
|---|---|
HUGGINGFACEHUB_API_TOKEN |
Required for task generation and evaluation (Hugging Face Inference API). Alternative env names: HUGGINGFACE_API_TOKEN, HF_TOKEN. |
EDUTUBE_LLM_MODEL_API |
LLM model ID (default: HuggingFaceH4/zephyr-7b-beta). |
EDUTUBE_LLM_PROVIDER |
Optional Inference API provider (e.g. together, fal-ai). |
EDUTUBE_MAX_TRANSCRIPT_CHARS |
Max transcript length for generation (default: 12000). |
EDUTUBE_EMBEDDING_MODEL |
Sentence-transformers model for RAG (default: multilingual MiniLM). |
EDUTUBE_RAG_CHUNK_SIZE, EDUTUBE_RAG_CHUNK_OVERLAP, EDUTUBE_RAG_RETRIEVER_K |
RAG splitter and retriever settings. |
- Lint:
flake8 src(seesetup.cfg). - Tests:
PYTHONPATH=. pytest tests/ -v - CI: GitHub Actions runs flake8 and pytest on push/PR to
main/master.

