Output will stream here when you run the agent.
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.
Installation
$ pnpm dlx shadcn@latest add @agentcn/flue/chat-with-youtube
Composition
agents/
└── chat-with-youtube.ts # Agent that composes the two tools
lib/
└── brightdata.ts # Web Unlocker fetch + YouTube parsing helpers
tools/
├── metadata.ts # Title / author / id via oEmbed
└── transcript.ts # Timestamped transcript segmentsCustomization
- Reliable fetching. Metadata and transcripts are pulled through the Bright
Data Web Unlocker,
which handles YouTube at scale with no rate limits or blocks. Set
BRIGHTDATA_API_KEY(and optionallyBRIGHTDATA_UNLOCKER_ZONE). - Add chapters export. Add a tool that writes the chapter list as a description or VTT file.
- Handle missing transcripts. Fall back to an STT service when captions are unavailable.
- Add a workflow. Wrap the tools in a workflow with a typed chapters schema.
- Swap the model. Change the
modelfield on the agent.