# Chat with YouTube

Fetches a video's metadata and transcript, then answers questions with clickable timestamp citations.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



<DocsBaseSwitcher base="eve" agent="chat-with-youtube" />

<AgentPreview
  agent="chat-with-youtube"
  framework="eve"
  inputFields="[
  {
    name: &#x22;url&#x22;,
    label: &#x22;YouTube URL&#x22;,
    placeholder: &#x22;https://youtu.be/dQw4w9WgXcQ&#x22;,
    type: &#x22;text&#x22;,
  },
  {
    name: &#x22;question&#x22;,
    label: &#x22;Question&#x22;,
    placeholder: &#x22;Summarize the video with chapter timestamps.&#x22;,
    type: &#x22;text&#x22;,
  },
]"
/>

## Summary [#summary]

The **Chat with YouTube Agent** answers questions about a video using its
transcript. It pulls the video's metadata and full transcript, then summarizes,
answers follow-ups, and generates chapter timestamps — each citation a clickable
link straight to that moment. Reach for it to skim long talks, lectures, or
podcasts without watching end to end.

## Install [#install]

```bash
npx shadcn@latest add @agentcn/eve/chat-with-youtube
```

## Composition [#composition]

```text
agent/
├── agent.ts                # Agent definition (model + config)
├── instructions.md         # Transcript-grounded answering instructions
└── tools/
    ├── video_metadata.ts   # Title / author / id via oEmbed
    └── get_transcript.ts   # Timestamped transcript segments
```

## Customization [#customization]

* **Add chapters export.** Add a tool that writes the chapter list back as a
  YouTube description or VTT file.
* **Handle missing transcripts.** Fall back to an STT service when a video has no
  captions.
* **Swap metadata source.** Use the YouTube Data API for richer metadata.
* **Swap the model.** Edit `agent/agent.ts`.
