Systems Library / Customer Service / How to Create an Automated Video Tutorial Library
Customer Service self service

How to Create an Automated Video Tutorial Library

Build and organize a video tutorial library that suggests relevant content.

Jay Banlasan

Jay Banlasan

The AI Systems Guy

An automated video tutorial library for customer education does what text docs cannot: it shows exactly what to click. I build these for SaaS products and service businesses where customers need to learn a workflow. The system organizes videos by topic, transcribes them for search, and suggests the right video based on what the customer is trying to do.

The key is searchability. A library nobody can navigate is a library nobody uses.

What You Need Before Starting

Step 1: Transcribe and Index Videos

import whisper
import json

model = whisper.load_model("base")

def transcribe_video(video_path):
    result = model.transcribe(video_path)
    return {
        "text": result["text"],
        "segments": [{
            "start": s["start"],
            "end": s["end"],
            "text": s["text"]
        } for s in result["segments"]]
    }

def index_video(video_id, title, video_url, transcript):
    conn = sqlite3.connect("tutorials.db")
    conn.execute("""
        INSERT INTO videos (id, title, url, transcript, indexed_at)
        VALUES (?, ?, ?, ?, datetime('now'))
    """, (video_id, title, video_url, json.dumps(transcript)))
    conn.commit()

Step 2: Enable Semantic Search

from sentence_transformers import SentenceTransformer
import chromadb

search_model = SentenceTransformer("all-MiniLM-L6-v2")
chroma = chromadb.PersistentClient(path="./video_search")
collection = chroma.get_or_create_collection("tutorials")

def index_for_search(video_id, title, transcript_text):
    text = f"{title} {transcript_text}"
    embedding = search_model.encode(text).tolist()
    collection.add(
        ids=[video_id],
        embeddings=[embedding],
        documents=[text],
        metadatas=[{"title": title, "video_id": video_id}]
    )

def search_videos(query, top_k=5):
    embedding = search_model.encode(query).tolist()
    results = collection.query(query_embeddings=[embedding], n_results=top_k)
    return [{
        "video_id": results["ids"][0][i],
        "title": results["metadatas"][0][i]["title"],
        "relevance": round(1 - results["distances"][0][i], 3)
    } for i in range(len(results["ids"][0]))]

Step 3: Build the Library API

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/api/tutorials/search", methods=["POST"])
def search():
    query = request.json["query"]
    results = search_videos(query)
    enriched = []
    for r in results:
        video = get_video(r["video_id"])
        enriched.append({
            "title": video["title"],
            "url": video["url"],
            "duration": video["duration"],
            "relevance": r["relevance"],
            "thumbnail": video.get("thumbnail")
        })
    return jsonify({"results": enriched})

@app.route("/api/tutorials/categories", methods=["GET"])
def categories():
    conn = sqlite3.connect("tutorials.db")
    cats = conn.execute(
        "SELECT category, COUNT(*) FROM videos GROUP BY category ORDER BY category"
    ).fetchall()
    return jsonify({"categories": [{"name": c[0], "count": c[1]} for c in cats]})

Step 4: Add Timestamp-Based Deep Links

Let customers jump to the exact moment in a video that answers their question:

def find_relevant_timestamp(video_id, query):
    video = get_video(video_id)
    segments = json.loads(video["transcript"])["segments"]

    segment_texts = [s["text"] for s in segments]
    segment_embeddings = search_model.encode(segment_texts)
    query_embedding = search_model.encode(query)

    import numpy as np
    similarities = np.dot(segment_embeddings, query_embedding)
    best_idx = np.argmax(similarities)

    return {
        "timestamp": segments[best_idx]["start"],
        "text": segments[best_idx]["text"],
        "url": f"{video['url']}?t={int(segments[best_idx]['start'])}"
    }

Step 5: Track Engagement

def log_video_view(video_id, user_id, watch_duration, total_duration):
    conn = sqlite3.connect("tutorials.db")
    completion = round(watch_duration / total_duration * 100, 1) if total_duration else 0
    conn.execute("""
        INSERT INTO video_views (video_id, user_id, watch_duration, completion_pct, viewed_at)
        VALUES (?, ?, ?, ?, datetime('now'))
    """, (video_id, user_id, watch_duration, completion))
    conn.commit()

What to Build Next

Auto-generate video chapters from transcripts. Use AI to identify topic boundaries in the transcript and create chapter markers. Customers can then skip to the section they need without watching the whole thing.

Related Reading

Want this system built for your business?

Get a free assessment. We will map every system your business needs and show you the ROI.

Get Your Free Assessment

Related Systems