What I Built

I wanted to paste a YouTube URL and get a summary — or ask questions about the video — without watching the whole thing. This project uses LangGraph for the workflow and Gemini for the actual summarizing and Q&A.


Key Features of Agentic Workflows

  • Modularity — each step can be built and tested on its own
  • State — data flows from step to step in a structured way
  • Reusability — the same steps can be reused in other projects
  • Autonomy — each step can decide what to do based on the input it receives

ToolDescriptionLanguageBest For
LangGraphGraph-based AI workflow framework with state management.PythonCustom step-by-step pipelines
CrewAIAgent orchestration tool inspired by human teams and role delegation.PythonRole-based agent collaboration
AutogenMicrosoft’s multi-agent framework for goal-oriented dialogue and tasks.PythonConversational multi-agent systems
LangChainGeneral framework for chaining LLMs with tools, memory, and logic.PythonBroader LLM apps beyond just agents
AgentOpsInfra layer for deploying and monitoring agentic systems.PlatformScaling, testing, and managing agents

Why I Chose LangGraph

For this project, I chose LangGraph because:

  • It gives clear control over the order of steps
  • It fits pipelines like: get YouTube URL → fetch transcript → summarize → answer questions
  • It supports state, so each step can use output from the previous one

YouTube Video Q&A Agent

This project uses one agent that does two things:

  1. Summarize the video transcript
  2. Answer questions about the video content

Responsibilities

  • Extract the transcript from a YouTube video
  • If the user asks for a summary, generate a short summary
  • If the user asks a question, answer it using the transcript as context
  • Use Google’s gemini-2.0-flash model through langchain-google-genai

How It Works

  1. Transcript extraction
    The agent fetches the transcript with youtube-transcript-api and cleans the text.

  2. Routing based on user input

    • If the user types "summary", the full transcript is sent to Gemini with a summary prompt
    • If the user asks a question, both the transcript and the question are sent to Gemini
  3. Response
    Gemini returns either a summary or an answer, which is shown to the user.


Technologies Used

  • langchain-google-genai — connects to Gemini
  • youtube-transcript-api — fetches video transcripts
  • LangGraph — runs the workflow
  • dotenv — loads the API key from a .env file

Example Workflow

User enters YouTube URL → Transcript fetched →
User enters "summary" → Gemini generates a summary
OR
User enters a question → Gemini answers using the transcript

Source Code

Full project on GitHub:

https://github.com/ayyzenn/youtube-video-qa.git