templates/template-chat-with-youtube/README.md
An AI assistant that helps you understand YouTube videos. Paste a link and ask questions, get summaries, or generate chapter timestamps — all backed by the actual transcript with clickable citations. Built with Mastra.
This template shows how to build a conversational agent with persistent memory that uses custom tools to fetch and analyze external content. It demonstrates tool composition — getting metadata first for context, then fetching the transcript for detailed analysis.
npx create-mastra@latest --template chat-with-youtube to scaffold the project locally..env.example to .env and fill in your OpenAI key.npm run dev and open localhost:4111 to try it out.Open Studio and start chatting with the chat-with-youtube agent. Paste any YouTube URL and ask for a summary, specific questions about the content, or chapter timestamps. The agent fetches the transcript and responds with citations you can click to jump to that moment in the video.
Swap in a different model, add your own tools for video analysis, or wire the agent into your app using the Mastra Client SDK. The agent and tools are all in src/ — edit them directly to fit your use case.
Mastra templates are ready-to-use projects that show off what you can build — clone one, poke around, and make it yours. They live in the Mastra monorepo and are automatically synced to standalone repositories for easier cloning.
Want to contribute? See CONTRIBUTING.md.