See llms.txt for all machine-readable content.

Back to Templates

Index YouTube channel transcripts in Pinecone with Apify and OpenAI

Quick overview

This workflow runs daily to fetch newly published YouTube video transcripts via Apify, generates OpenAI embeddings for transcript chunks, and stores them with metadata in a Pinecone index for retrieval-augmented generation (RAG).

How it works

  1. Runs every day at 6:00 on a schedule.
  2. Calls the Apify YouTube Channel Transcripts actor to pull transcript chunks for the configured YouTube channels or playlists, returning only videos that are new since the last run.
  3. Filters the results to keep only videos where transcript extraction succeeds.
  4. Splits each video’s chunks array into individual items and attaches citation metadata like title, channel, publish date, start time, and a timestamped URL.
  5. Creates OpenAI embeddings for each transcript chunk and inserts the vectors and metadata into a Pinecone index under the specified namespace.

Setup

  1. Install the Apify community node (@apify/n8n-nodes-apify) in your n8n instance.
  2. Add credentials for Apify, OpenAI, and Pinecone.
  3. Create or select a Pinecone index compatible with the OpenAI embedding model (text-embedding-3-small) and set the target index in the Pinecone node.
  4. Update the Settings values to include your YouTube channel URLs/@handles or playlist URLs and adjust maxVideosPerChannel and chunkSizeWords as needed.