Pre-built Agents
Video Agent

Video Agent

The Video Agent enables developers to extract valuable knowledge from multi-format video files (MP4, MOV, WMV, AVI, MKV). By stripping audio tracks, running transcriptions, generating key notes and summaries, and indexing the results into a vector database, it turns long-form video into an interactive, queryable source of information.


Features

  • Multi-Format Parsing: Support for standard container formats including .mp4, .mov, .wmv, .avi, and .mkv.
  • Audio Extraction: Auto-extracts high-fidelity audio streams for transcription.
  • Auto-Summarization: Generates structured Markdown notes and high-level summaries.
  • Traceable Pipeline: Emits tracing events for processing duration, cost tracking, and token usage.
  • Conversational Video Q&A: Creates a Vector database index from the video transcript so users can chat with the video content.

Architecture Flow


Technical Implementation Guide

Behind the scenes, the Video Agent utilizes moviepy and the core aih transcription models. Here is how video parsing is handled programmatically:

import os
from aih import Summarizer
from moviepy import VideoFileClip
 
# Convert video to audio
def extract_video_audio(video_path, output_mp3="extracted.mp3"):
    clip = VideoFileClip(video_path)
    clip.audio.write_audiofile(output_mp3)
    clip.close()
    return output_mp3
 
# Summarize transcript
def generate_video_summary(transcription_text, api_key):
    summarizer = Summarizer(api_key=api_key)
    notes = summarizer.generate_notes(transcription_text)
    summary = summarizer.summarize(transcription_text)
    return notes, summary

Conversational Interaction

Once indexed, queries are routed to the video bot vector storage database for interactive RAG (Retrieval-Augmented Generation) chats, enabling users to ask questions like:

  • "What did the speaker say about Q3 roadmap?"
  • "Summarize the tutorial's step 5 instructions."