{"id":32720583,"url":"https://github.com/aliahmad552/youtube-transcript-rag","last_synced_at":"2026-04-09T08:13:54.358Z","repository":{"id":320570033,"uuid":"1082593753","full_name":"aliahmad552/youtube-transcript-rag","owner":"aliahmad552","description":"This is a YouTube Q\u0026A Chatbot powered by a Large Language Model (LLM) and FastAPI. Users can enter a YouTube video URL and ask questions — the system generates accurate answers using the video transcript.","archived":false,"fork":false,"pushed_at":"2025-10-24T13:51:27.000Z","size":493,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-24T15:33:10.883Z","etag":null,"topics":["data-science-projects","deep-learning","fastapi","genai","generative","generative-ai","langchain","langchain-huggingface","machine-learning","projects","rag","retrieval-augmented-generation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliahmad552.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T13:25:13.000Z","updated_at":"2025-10-24T14:14:15.000Z","dependencies_parsed_at":"2025-10-24T15:33:13.193Z","dependency_job_id":null,"html_url":"https://github.com/aliahmad552/youtube-transcript-rag","commit_stats":null,"previous_names":["aliahmad552/youtube-transcript-rag"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aliahmad552/youtube-transcript-rag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fyoutube-transcript-rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fyoutube-transcript-rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fyoutube-transcript-rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fyoutube-transcript-rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliahmad552","download_url":"https://codeload.github.com/aliahmad552/youtube-transcript-rag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliahmad552%2Fyoutube-transcript-rag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282349848,"owners_count":26654800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-02T02:00:06.609Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science-projects","deep-learning","fastapi","genai","generative","generative-ai","langchain","langchain-huggingface","machine-learning","projects","rag","retrieval-augmented-generation"],"created_at":"2025-11-02T20:01:07.674Z","updated_at":"2026-04-09T08:13:54.352Z","avatar_url":"https://github.com/aliahmad552.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎥 YouTube Q\u0026A Chatbot with LLM\r\n\r\nThis is a **YouTube Q\u0026A Chatbot** powered by a Large Language Model (LLM) and FastAPI.  \r\nUsers can enter a YouTube video URL and ask questions — the system generates accurate answers using the video transcript.\r\n\r\n---\r\n\r\n## 🔹 Features\r\n\r\n- Ask questions about any YouTube video.\r\n- Extracts video transcript automatically.\r\n- Generates answers using an LLM (Hugging Face API or other supported models).\r\n- **Clean and responsive UI** similar to ChatGPT:\r\n  - Fixed input box at the bottom\r\n  - Scrollable chat messages\r\n  - Enter key or send button to submit queries\r\n- Frontend built with **HTML, CSS, and JavaScript**\r\n- Backend built with **FastAPI** and Python\r\n- CORS enabled for frontend-backend communication\r\n\r\n---\r\n\r\n## 📂 Project Structure Repo\r\n\r\nyoutube-transcript-rag/\r\n│\r\n├─ frontend/\r\n│   ├─ index.html         # Chatbot UI\r\n│   ├─ style.css          # Stylesheet\r\n│   └─ script.js          # JS logic\r\n│\r\n├─ utils/\r\n│   ├─ youtube_utils.py   # Functions to extract video ID \u0026 transcript\r\n│   └─ qa_pipeline.py     # Functions to generate answers from transcript\r\n│\r\n├─ model/\r\n│   └─ Youtube_RAG_System.ipynb   # Notebook for initial experimentation\r\n│\r\n├─ main.py                # FastAPI backend\r\n├─ requirements.txt       # Python dependencies\r\n└─ .env                   # Hugging Face API token (local only, not pushed)\r\n\r\n## ⚡ How it Works\r\n\r\n1. **User enters a YouTube URL** and their question in the chatbot UI.\r\n2. Frontend sends a POST request to the FastAPI backend at `/youtube_qa`.\r\n3. Backend uses `youtube_utils.py` to:\r\n   - Extract the video ID from the URL\r\n   - Fetch the transcript of the video\r\n4. The transcript and user query are sent to `qa_pipeline.py` which:\r\n   - Uses an LLM to generate a relevant answer\r\n5. Backend returns the answer as JSON\r\n6. Frontend displays the user question and bot answer in the chat window.\r\n\r\n---\r\n\r\n## 🖼️ Screenshots\r\n\r\n### Chatbot UI Form Example 1\r\n![Chatbot Form 1](static/images/form.png)\r\n\r\n### Chatbot UI Form Example 2\r\n![Chatbot Form 2](static/images/form1.png)\r\n\r\n---\r\n\r\n## 💻 Installation\r\n\r\n### 1. Clone the repository:\r\n```bash\r\ngit clone https://github.com/aliahmad552/youtube-transcript-rag.git\r\ncd youtube-transcript-rag\r\n```\r\n### 2.Create a virtual environment:\r\n```bash\r\npython -m venv myenv\r\nmyenv\\Scripts\\activate   # Windows\r\n```\r\n\r\n\r\n### 3.Install dependencies:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n### 4.Create a .env file in the root folder and add your Hugging Face API token:\r\n```bash\r\nHUGGINGFACEHUB_API_TOKEN=hf_your_token_here\r\n```\r\n\r\n### 5.Run FastAPI backend:\r\n```bash\r\nuvicorn main:app --reload\r\n```\r\n\r\n### 6.Open frontend/index.html in your browser or serve via a local server.\r\n\r\n## 🚀 Usage\r\n\r\nOpen the chatbot UI\r\n\r\nPaste a YouTube video URL\r\n\r\nType your question\r\n\r\nPress Enter or click the send icon\r\n\r\nChatbot generates answer in real-time\r\n\r\n## 🛡️ Security Note\r\n\r\nDo NOT commit .env or API tokens to GitHub.\r\n\r\nAdd .env to .gitignore to avoid accidental exposure.\r\n\r\n## 📝 Technologies Used\r\n\r\nPython 3.10+\r\n\r\nFastAPI\r\n\r\nJavaScript, HTML, CSS\r\n\r\nHugging Face LLM APIs\r\n\r\nYouTube Transcript API\r\n\r\nChatbot UI inspired by ChatGPT\r\n##📌 Future Improvements\r\n\r\nDark mode UI\r\n\r\nMulti-language support\r\n\r\nSave conversation history\r\n\r\nDeploy as a full web application\r\n\r\nSupport for multiple LLM providers\r\n\r\n## Author\r\n\r\nAli Ahmad – BS Software Engineering\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliahmad552%2Fyoutube-transcript-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliahmad552%2Fyoutube-transcript-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliahmad552%2Fyoutube-transcript-rag/lists"}