{"id":19563297,"url":"https://github.com/vdutts7/ai-mreflow","last_synced_at":"2025-06-12T07:09:00.754Z","repository":{"id":176500581,"uuid":"656847784","full_name":"vdutts7/ai-mreflow","owner":"vdutts7","description":"YouTubeGPT • AI Chat with 100+ videos ft. YouTuber Matt Wolfe (@mreflow) 🐺🟣🤖💬","archived":false,"fork":false,"pushed_at":"2023-11-30T21:39:01.000Z","size":73908,"stargazers_count":32,"open_issues_count":17,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T00:32:23.633Z","etag":null,"topics":["ai","chatbot","langchain","pinecone","vector-database","vector-embeddings","youtube-api-v3"],"latest_commit_sha":null,"homepage":"https://mreflow-ai.vercel.app/","language":"TypeScript","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/vdutts7.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}},"created_at":"2023-06-21T19:08:47.000Z","updated_at":"2025-02-19T08:04:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a36446b6-fbec-4319-99f9-77f43cf5d194","html_url":"https://github.com/vdutts7/ai-mreflow","commit_stats":null,"previous_names":["vdutts7/ai-mreflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vdutts7/ai-mreflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdutts7%2Fai-mreflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdutts7%2Fai-mreflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdutts7%2Fai-mreflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdutts7%2Fai-mreflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdutts7","download_url":"https://codeload.github.com/vdutts7/ai-mreflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdutts7%2Fai-mreflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259418186,"owners_count":22854184,"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","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":["ai","chatbot","langchain","pinecone","vector-database","vector-embeddings","youtube-api-v3"],"created_at":"2024-11-11T05:17:13.590Z","updated_at":"2025-06-12T07:09:00.746Z","avatar_url":"https://github.com/vdutts7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/vdutts7/yt-chat-mkbhd/blob/main/public/yt-chat-logo_.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n    \u003cimg src=\"https://github.com/vdutts7/ai-mreflow/blob/main/public/mreflow.jpeg\" alt=\"Logo\" width=\"75\" height=\"75\"\u003e\n    \u003cimg src=\"https://github.com/vdutts7/yt-chat-mkbhd/blob/main/public/openai.png\" alt=\"Logo\" width=\"67\" height=\"67\"\u003e\n\n  \n  \u003c/a\u003e\n  \u003ch2 align=\"center\"\u003eYouTubeGPT ft. Matt Wolfe (@mreflow) \u003c/h2\u003e \u003cp align=\"center\"\u003e AI Chatbot with 100+ videos from YouTuber Matt Wolfe \u003ca href=\"https://www.youtube.com/@mreflow\"\u003e @mreflow \u003c/a\u003e \u003c/p\u003e \u003c/div\u003e \u003cp align=\"center\"\u003e \u003cimg src=\"https://github.com/vdutts7/ai-mreflow/blob/main/public/a.gif\"/\u003e \u003c/p\u003e \n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n  \u003col\u003e\n    \u003ca href=\"#about\"\u003e📝 About\u003c/a\u003e\n        \u003cul\u003e\n        \u003c/ul\u003e\n    \u003ca href=\"#how-to-build\"\u003e💻 How to build\u003c/a\u003e\n        \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#initial-setup\"\u003eInitial setup\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=#handle-massive-data\u003eHandle massive data\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=#embeddings-and-database-backend\u003eEmbeddings and database backend\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=#Frontend-UI-with-chat\u003eFrontend UI with chat\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=#run-app\u003eRun app\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\n    \u003ca href=\"#next-steps\"\u003e🚀 Next steps\u003c/a\u003e\n        \u003cul\u003e\n            \u003cli\u003e\u003ca href=#deploy\u003eDeploy\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=#customizations\u003eCustomizations\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\n    \u003ca href=\"#tools-used\"\u003e🔧 Tools used\u003c/a\u003e\n        \u003cul\u003e\n        \u003c/ul\u003e\n    \u003ca href=\"#contact\"\u003e👤 Contact\u003c/a\u003e\n  \u003c/ol\u003e\n\n\u003cbr \u003e\u003c/br\u003e\n\n\u003c!-- ABOUT --\u003e\n## 📝 About\n\nChat with 100+ YouTube videos from any creator in less than 10 minutes. This project combines basic Python scripting, vector embeddings, OpenAI, Pinecone, and Langchain into a modern chat interface, allowing you to quickly reference any content your favorite YouTuber covers. Type in natural language and get returned detailed answers: (1) in the style / tone of your YouTuber, and (2) with the top 2-3 specific videos referenced hyperlinked.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e \n\n\n## 💻 How to build \n_Note: macOS version, adjust accordingly for Windows / Linux_\n\n### Initial setup\n\nClone and install dependencies:\n\n```\ngit clone https://github.com/vdutts7/ai-mreflow\ncd ai-mreflow\nnpm i\n```\n\nCopy `.env.example` and rename to `.env` in root directory. Fill out API keys:\n\n```\nASSEMBLY_AI_API_TOKEN=\"\"\nOPENAI_API_KEY=\"\"\nPINECONE_API_KEY=\"\"\nPINECONE_ENVIRONMENT=\"\"\nPINECONE_INDEX=\"\"\n```\n\nGet API keys:\n- [AssemblyAI](https://www.assemblyai.com/docs) - ~ $3.50 per 100 vids\n- [OpenAI](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key)\n- [Pinecone](https://docs.pinecone.io/docs/quickstart)\n      \n_**IMPORTANT: Verify that `.gitignore` contains `.env` in it.**_\n\n\n### Handle massive data\n\nOutline: \n- Export metadata (.csv) of YouTube videos ⬇️\n- Download the audio files\n- Transcribe audio files\n\nNavigate to `scripts` folder, which will host all of the data from the YouTube videos. \n   \n   ```\n   cd scripts\n   ```\n\nSetup python environemnt:\n\n```\nconda env list\nconda activate youtube-chat\npip install -r requirements.txt\n```\n  \nScrape YouTube channel-- replace `@mreflow` with @\u003cusername\u003e of your choice. Replace `\u003ck-last-vids\u003e` with the number of videos you want included (the script traverses backwards starting from most recent upload). A new file `\u003cyour-csv-file\u003e.csv` will be created at the directory as referenced below:\n\n```\npython scripts/scrape_vids.py https://www.youtube.com/@\u003cusername\u003e `\u003ck-last-vids\u003e` scripts/vid_list/\u003cyour-csv-file\u003e.csv\n```\n\nRefer to `example.csv` inside folder and verify your output matches this format:\n\n\u003cimg width=\"400\" alt=\"image\" src=\"https://github.com/vdutts7/yt-ai-chat/assets/63992417/7bf1c02c-7201-48b4-9607-e6de72fcafa2\"\u003e\n    \nDownload audio files:\n\n```\npython scripts/download_yt_audios.py scripts/vid_list/\u003cyour-csv-file\u003e.csv scripts/audio_files/\n```\n\n\u003cimg width=\"130\" alt=\"image\" src=\"https://github.com/vdutts7/yt-ai-chat/assets/63992417/8c16f79a-2957-4d45-b81e-c450cf7e77f1\"\u003e\n\nWe will utilize AssemblyAI's API wrapper class for OpenAI's Whisper API. Their script provides step-by-step directions for a more efficient, faster speech-to-text conversion as Whisper is way too slow and will cost you more. I spent ~ $3.50 to transcribe the 112 videos for Matt Wolfe. \n\n\u003cimg width=\"348\" alt=\"image\" src=\"https://github.com/vdutts7/yt-ai-chat/assets/63992417/e40716c7-1ab6-460a-bd39-b7658c052958\"\u003e\n\n```\npython scripts/transcribe_audios.py scripts/audio_files/ scripts/transcripts\n```\n\n\u003cimg width=\"164\" alt=\"image\" src=\"https://github.com/vdutts7/yt-ai-chat/assets/63992417/f1105604-145b-4019-8026-f1c262497cde\"\u003e\n\nUpsert to Pinecone database:\n\n```\npython scripts/pinecone_helper.py scripts/vid_list/\u003cyour-csv-file\u003e.csv scripts/transcripts/\n```\n\nPinecone index setup I used below. I used P1 since this is optimized for speed. 1536 is OpenAI's standard we're limited to when querying data from the vectorstore: \n\u003cimg width=\"951\" alt=\"image\" src=\"https://github.com/vdutts7/yt-ai-chat/assets/63992417/01deb2f1-f563-4e9d-97bf-d32ccda61d62\"\u003e\n\n### Embeddings and database backend\n\nBreaking down `scripts/pinecone_helper.py` :\n- Chunk size of 1000 characters with 500 character overlap. I found this working for me but obviously experiment and adjust according to your content library's size, complexity, etc.\n- Metadata: (1) video url and (2) video title\n\nWith Pinecone vectorstore loaded, we use Langchain's Conversational Retrieval QA to ask questions, extract relevant metadata from our embeddings, and deliver back to the user in a packaged format as an answer. \n\nThe relevant video titles are cited via hyperlinks directly to the video url.\n\n### Frontend UI with chat\n\nNextJs styled with Tailwind CSS. `src/pages/index.tsx` contains base skeleton. `src/pages/api/chat-chain.ts` is heart of the code where the Langchain connections are outlined.\n\n### Run app\n\n```\nnpm run dev\n```\n\nGo to `http://localhost:3000`. You should be able to type and ask questions now. Done ✅ \n\n\u003cimg src=\"https://github.com/vdutts7/ai-mreflow/assets/63992417/9bd551f1-7ae0-4c91-a8b0-0659ee30f989\" alt=\"Logo\" width=\"390\" height=\"390\"\u003e\n\u003cimg width=\"500\" alt=\"Screenshot 2023-06-20 at 4 17 08 PM\" src=\"https://github.com/vdutts7/ai-mreflow/assets/63992417/e2429b35-e738-424e-8fc3-641b96258251\"\u003e\n\n\n## 🚀 Next steps\n\n### Deploy\n\nI used [Vercel](https://vercel.com/dashboard) as this was a relatively small project.\n\n_Alternatives: Heroku, Firebase, AWS Elastic Beanstalk, DigitalOcean, etc._\n\n### Customizations\n\n**UI/UX:** change to your liking. \n\n**Bot personality:** edit prompt template in `/src/pages/api/chat-chain.ts` to fine-tune and add greater control on the bot's outputs.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- BUILT WITH --\u003e\n## 🔧 Built With\n[![Next][Next]][Next-url]\n[![Typescript][Typescript]][Typescript-url]\n[![Python][Python]][Python-url]\n[![Langchain][Langchain]][Langchain-url]\n[![OpenAI][OpenAI]][OpenAI-url]\n[![AssemblyAI][AssemblyAI]][AssemblyAI-url]\n[![Pinecone][Pinecone]][Pinecone-url]\n[![Tailwind CSS][TailwindCSS]][TailwindCSS-url]\n[![Vercel][Vercel]][Vercel-url]\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- CONTACT --\u003e\n## 👤 Contact\n\n`me@vdutts7.com` \n\n🔗 Project Link: `https://github.com/vdutts7/ai-mreflow`\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[Python]: https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\n[Python-url]: https://www.python.org/\n\n[Next]: https://img.shields.io/badge/next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white\n[Next-url]: https://nextjs.org/\n\n[Langchain]: https://img.shields.io/badge/🦜🔗Langchain-DD0031?style=for-the-badge\u0026color=\u003cbrightgreen\u003e\n[Langchain-url]: https://langchain.com/\n\n[TailwindCSS]: https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge\u0026logo=tailwind-css\u0026logoColor=skyblue\u0026color=0A192F\n[TailwindCSS-url]: https://tailwindcss.com/\n\n[OpenAI]: https://img.shields.io/badge/OpenAI%20ada--002%20GPT--3.5%20Whisper-0058A0?style=for-the-badge\u0026logo=openai\u0026logoColor=white\u0026color=4aa481\n[OpenAI-url]: https://openai.com/\n\n[AssemblyAI]: https://img.shields.io/badge/Assembly_AI-DD0031?style=for-the-badge\u0026logo=https://github.com/vdutts7/yt-ai-chat/public/assemblyai.png\u0026color=blue\n[AssemblyAI-url]: https://www.assemblyai.com/\n\n[TypeScript]: https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\n[Typescript-url]: https://www.typescriptlang.org/\n\n[Pinecone]: https://img.shields.io/badge/Pinecone-FFCA28?style=for-the-badge\u0026https://github.com/vdutts7/yt-ai-chat/public/pinecone.png\u0026logoColor=black\u0026color=white\n[Pinecone-url]: https://www.pinecone.io/\n\n[Vercel]: https://img.shields.io/badge/Vercel-FFFFFF?style=for-the-badge\u0026logo=Vercel\u0026logoColor=white\u0026color=black\n[Vercel-url]: https://Vercel.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdutts7%2Fai-mreflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdutts7%2Fai-mreflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdutts7%2Fai-mreflow/lists"}