Build a Production-Ready YouTube AI Agent with Temporal
Build a Production-Ready YouTube AI Agent with Temporal
Watch the recording
Full workshop video with timestamps and downloadable materials.
Follow the tutorial
12 pages of step-by-step instructions you can work through at your own pace.
We build a deep research agent over the DataTalks.Club podcast archive. The workshop starts by downloading and indexing YouTube transcripts, then turns that ingestion code into a durable Temporal workflow. After the data is searchable, we build a Pydantic AI research agent, add a summarization sub-agent for long transcripts, and wrap the agent run in Temporal too.
Links
The main resources for this workshop:
The system you will build
The final system looks like this:
The ingestion side has the parts that usually fail in production: network calls, YouTube blocking cloud IPs, proxies, Elasticsearch writes, and long loops over many videos. Temporal gives that side retries, observability, and durable execution. The agent side uses the indexed data to answer questions from the podcast archive and then uses Temporal again so long agent runs can survive failures.
Walkthrough
Follow the numbered files in order. Each file is one self-contained step.
- Overview and setup - what you will build, prerequisites, local setup, secrets, and the two-project folder layout.
- Part 1: Fetch one transcript - fetch a YouTube transcript, convert it to subtitle text, and use cached transcript files when direct YouTube access is blocked.
- Part 2: Run Elasticsearch - run Elasticsearch in
Docker, create the
podcastsindex, index one transcript, and search with snippets. - Part 3: Discover podcast videos - discover podcast videos from the DataTalks.Club YAML file, skip problematic videos, process all episodes, and add proxy support after YouTube blocks the IP.
- Part 4: Temporal motivation - install Temporal, convert the
notebook to Python, identify activities, and create
activities.py. - Part 5: Define the workflow - define the Temporal workflow, run it through a worker, handle sync activities, and pass imports through the Temporal sandbox.
- Part 6: Create the agent project - create the Pydantic AI research agent with Elasticsearch-backed search tools and tool-call logging.
- Part 7: Summarize long transcripts - add a summarization sub-agent so the research agent can work with full transcripts without exhausting context.
- Part 8: Wrap the agent in Temporal - wrap the Pydantic AI agent in a Temporal workflow and serialize the run context used by the summarization tool.
- Q&A: questions from the workshop - useful questions about Temporal, proxies, secrets, and orchestration choices.
- What to improve next - items intentionally left for a follow-up: parallel batching, structured references, stronger agent output, tests, and production hardening.
- Appendix: file inventory - file inventory, resource links, and learning-in-public notes.
Tutorial pages
- 1 Overview and setup
- 2 Part 1: Fetch one transcript
- 3 Part 2: Run Elasticsearch
- 4 Part 3: Discover podcast videos
- 5 Part 4: Temporal motivation
- 6 Part 5: Define the workflow
- 7 Part 6: Create the agent project
- 8 Part 7: Summarize long transcripts
- 9 Part 8: Wrap the agent in Temporal
- 10 Q&A: questions from the workshop
- 11 What to improve next
- 12 Appendix: file inventory