Skip to content
INDXR.AI

AI & RAG · 5 min read

Turn a YouTube Channel Into a Knowledge Base You Can Search and Ask

open drawer packed with tightly filed cards in warm light
IE
INDXR.AI Editorial
Published April 16, 2026 · Updated November 9, 2026

YouTube channels are dense archives. A university lecture series, a conference, an educator with hundreds of videos: the knowledge is there, but you can only watch it one video at a time. You cannot search a hundred lectures for every time a speaker explained a concept, or ask a question and get back the exact moment it was answered.

There are two ways to fix that. The first needs no code: put the channel's transcripts in a library where each one keeps its source, and let Claude or ChatGPT search them for you. The second is to build your own retrieval pipeline with a vector database. This article does the first in full, then the second for those who need it.

Step 1: Gather the channel into playlists

INDXR accepts playlist URLs, not channel URLs. There are two practical paths.

Use the channel's own playlists. Many channels group videos by series, course or year. If the channel has those, use their URLs directly. Each one becomes its own collection, which keeps a big channel easy to navigate.

Make your own playlist. Log into YouTube, open the channel, and use "Save to playlist" on each video you want. YouTube playlists can be long; INDXR processes up to 500 videos per job and runs a larger list in batches, all into the same library. Batching by year or topic also makes the collection easier to update later.

Step 2: Extract the playlist into your library

Paste the playlist URL into the Playlist tab. The review screen lists every video's length and whether you have already processed it. Set each video to YouTube captions or AI transcription, and start the job. It runs in the background.

The transcripts are filed into a collection named after the playlist. Each one keeps its source: the channel, the link, the length, the publication date, and a ready APA 7 citation. That is what makes the knowledge base usable for research rather than just for search.

What it costs for a channel of 50 videos averaging 30 minutes:

  • On YouTube captions: the first 3 videos free, then 1 credit each = 47 credits (€1.18 at Plus pricing)
  • All on AI transcription: 50 × 30 minutes × 1 credit per minute = 1,500 credits (€37.50 at Plus pricing, €0.025/credit)

Most channels mix the two: captions for videos that have them, AI for the rest or for the ones you will quote. This is a one-time cost. Re-running the playlist later skips videos you already have, so an update costs only the new videos.

Step 3: Search the collection

Library search matches titles and the transcript text itself, so you can find every lecture where a term came up, filtered to one collection. Each result opens the transcript at the passage, with the timestamp to jump into the video.

Step 4: Ask Claude or ChatGPT

Connect the library once, and the assistant can list your collections, search them, read a transcript in blocks with timestamps and speaker names, and look up each source with its citation. It can only read, never change anything, and the connection is free on every account. Setup takes a few minutes: see the Claude and ChatGPT guide.

Questions that work well name the collection and ask for evidence:

  • “Across my Justice collection, where does Sandel discuss consent? Quote him with timestamps.”
  • “How did the speaker's view on this change between the 2022 and 2025 talks? Cite each video.”
  • “Which videos in this collection mention Rawls? Give me the APA references.”

For most research, writing and study, this is the whole job. You do not need to embed anything or run a database: the assistant does the retrieval against your library. More on how that works in using Claude or ChatGPT with your own sources.

Build your own: the RAG JSON export

Build your own when you are making something for other people: a search box on your site, a chatbot, a pipeline that runs without you. INDXR exports each transcript as RAG JSON at 1 credit per 10 minutes of video. For the 50-video example above that is 150 credits on top of the transcripts.

Each video's RAG JSON file contains 60-second chunks by default (30, 90, 120 second presets are also available) with everything a vector database needs:

{
  "metadata": {
    "video_id": "kBdfcR-8hEY",
    "title": "Justice: What's The Right Thing To Do? Episode 01 …",
    "duration_seconds": 3282,
    "extracted_at": "2026-08-27T12:43:09.393Z",
    "chunking_config": {
      "chunk_size_seconds": 60,
      "overlap_seconds": 9,
      "overlap_strategy": "segment_boundary",
      "total_chunks": 60
    },
    "channel": "Harvard University",
    "language": "en",
    "extraction_method": "youtube_captions"
  },
  "chunks": [
    {
      "chunk_index": 0,
      "chunk_id": "kBdfcR-8hEY_chunk_000",
      "text": "This is a course about Justice and we begin with a story suppose you're the driver of a trolley car, and your trolley car is hurdling down the track at sixty miles an hour …",
      "start_time": 4.2,
      "end_time": 65.08,
      "deep_link": "https://youtu.be/kBdfcR-8hEY?t=4",
      "token_count_estimate": 128,
      "metadata": {
        "video_id": "kBdfcR-8hEY",
        "title": "Justice: What's The Right Thing To Do? Episode 01 …",
        "channel": "Harvard University",
        "chunk_index": 0,
        "start_time": 4.2,
        "end_time": 65.08,
        "language": "en",
        "total_chunks": 60
      }
    }
  ]
}

The deep_link field is the key feature for a knowledge base: when your AI system retrieves a chunk and uses it to answer a question, it can cite the exact video and timestamp rather than just the video title.

Build the vector index

The following example uses ChromaDB (local, no infrastructure required) and OpenAI embeddings. The same pattern works with Pinecone, Weaviate, or Qdrant for production deployments.

import json
import glob
import chromadb
from openai import OpenAI

client = OpenAI()
chroma_client = chromadb.PersistentClient(path="./knowledge_base")
collection = chroma_client.get_or_create_collection(
    name="youtube_channel",
    metadata={"hnsw:space": "cosine"}
)

def embed_texts(texts):
    response = client.embeddings.create(
        input=texts,
        model="text-embedding-3-small"
    )
    return [item.embedding for item in response.data]

# Process all RAG JSON files
for filepath in glob.glob("./transcripts/*.json"):
    with open(filepath) as f:
        data = json.load(f)

    chunks = data["chunks"]
    if not chunks:
        continue

    texts = [chunk["text"] for chunk in chunks]
    ids = [chunk["chunk_id"] for chunk in chunks]
    metadatas = [chunk["metadata"] for chunk in chunks]

    # Add deep_link to metadata for citation
    for i, chunk in enumerate(chunks):
        metadatas[i]["deep_link"] = chunk["deep_link"]

    # Embed in batches of 100
    for i in range(0, len(texts), 100):
        batch_texts = texts[i:i+100]
        batch_embeddings = embed_texts(batch_texts)

        collection.add(
            embeddings=batch_embeddings,
            documents=batch_texts,
            metadatas=metadatas[i:i+100],
            ids=ids[i:i+100]
        )

    print(f"Indexed {len(chunks)} chunks from: {data['video']['title']}")

print(f"Total chunks indexed: {collection.count()}")

Query in natural language

def search_knowledge_base(query, n_results=5):
    query_embedding = client.embeddings.create(
        input=[query],
        model="text-embedding-3-small"
    ).data[0].embedding

    results = collection.query(
        query_embeddings=[query_embedding],
        n_results=n_results
    )

    print(f"\nQuery: {query}\n")
    for i, (doc, metadata) in enumerate(zip(
        results["documents"][0],
        results["metadatas"][0]
    )):
        print(f"Result {i+1}:")
        print(f"  Video: {metadata['title']}")
        print(f"  Link: {metadata['deep_link']}")
        print(f"  Text: {doc[:200]}...")
        print()

search_knowledge_base("trolley problem and utilitarian ethics")
search_knowledge_base("how does Rawls define justice")

Add an LLM answer layer

def answer_question(question, n_chunks=4):
    query_embedding = client.embeddings.create(
        input=[question],
        model="text-embedding-3-small"
    ).data[0].embedding

    results = collection.query(
        query_embeddings=[query_embedding],
        n_results=n_chunks
    )

    context_parts = []
    for doc, metadata in zip(results["documents"][0], results["metadatas"][0]):
        source = f"{metadata['title']}"
        context_parts.append(f"[Source: {source}]\n{doc}")

    context = "\n\n".join(context_parts)

    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[
            {
                "role": "system",
                "content": "Answer questions based on the provided transcript excerpts. Always cite the video title and timestamp for claims you make."
            },
            {"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"}
        ]
    )

    return response.choices[0].message.content

answer = answer_question("Explain the trolley problem and its implications for moral philosophy")
print(answer)

Keeping the knowledge base current

For channels that publish regularly, INDXR's duplicate detection means re-running a playlist only processes new videos; existing ones are left out and not charged. The connector reads whatever is in your library, so new transcripts are available to Claude or ChatGPT straight away. For your own vector index, export the new transcripts and embed them as before.

For the research behind the 60-second default chunk size, see How to Chunk YouTube Transcripts for RAG. For credit packages, see pricing.

Frequently asked questions

Can I build this without writing code?
Yes, and for most people that is the better route. Extract the channel's playlists into your INDXR library, then connect the library to Claude or ChatGPT. The assistant searches the transcripts and answers with quotes, timestamps and the source. The connector is read-only and free on every account.
How many videos can a single INDXR job handle?
Up to 500 videos per job. That is INDXR's limit, not YouTube's: a YouTube playlist can hold far more. A larger playlist is split into batches, and every batch lands in the same library. Each job runs in the background, so you can close the tab.
Is auto-caption quality good enough for a knowledge base?
For search and retrieval, auto-captions are often enough: keyword matching and semantic similarity work with unpunctuated text. When the text will be quoted or read directly, AI transcription gives more readable output with proper sentence boundaries, which also makes chunks more coherent.
When should I build my own vector database instead?
When you are building a product: a search feature for other people, a chatbot on your site, or a pipeline that has to run without you. For your own research, the connector does the retrieval for you. RAG JSON is model-agnostic, so the same export works with any embedding provider.

Sources

See also