Created at: 30/10/2024
git clone https://github.com/rafagfe/project_agentyt_langgraph.git
cd project_agentyt_langgraph
sudo docker-compose up -d --build
This project automates the analysis of YouTube videos by downloading audio, transcribing content, and applying various analyses like sentiment, relevance, and depth. It provides structured reports in Markdown and HTML formats, utilizing OpenAI's language models within a structured workflow.
The project is organized into a modular workflow with nine agents, each performing a specific task in the video analysis process. These agents are executed in a predefined sequence to ensure a smooth flow from data extraction to report generation:
-
Agent1: Download and Metadata Extraction
Downloads the YouTube audio and extracts metadata (title, tags, uploader, etc.). -
Agent2: Audio Segmentation and Transcription
Splits the audio into segments and uses OpenAI’s Whisper model to transcribe each segment. -
Agent3: Initial Summarization
Generates an initial summary of the transcription, focusing on key points. -
Agent4: Summary Validation
Validates the initial summary for accuracy and completeness based on the transcription. -
Agent5: Sentiment Analysis
Analyzes the overall tone and sentiment of the transcribed content. -
Agent6: Relevance Analysis
Assesses the relevance of the content, considering timeliness, target audience, and practical applications. -
Agent7: Depth Analysis
Evaluates the technical depth of the content, including explanation quality and examples. -
Agent8: Score
Assigns a score based on prior analyses and provides a recommendation on the content’s usefulness. -
Agent9: Final Summary Export
Compiles a final report with metadata and analysis results, exporting it in both Markdown and HTML formats.
The workflow is managed by LangGraph’s StateGraph
, which defines the sequence of agent execution and visually represents the workflow.
The Video Analysis tab enables users to input a YouTube video URL for processing. Key functionalities include:
- Video URL Input: Accepts the YouTube URL for analysis.
- Analyze Button: Starts the workflow, covering download, transcription, and content analysis.
- Analysis Display: Shows results of sentiment, relevance, and depth analyses alongside the full transcription.
- Download Options: Allows users to download the results as HTML and Markdown reports.
- Workflow Visualization: Displays a diagram of the workflow process for a clear understanding of each step.
The Q&A Assistant tab enables interactive Q&A on the analyzed video content with the following features:
- Ask a Question: Users can pose questions about specific aspects of the video.
- Answer Generation with Caching: Before generating a new response, the system checks ChromaDB for similar questions (> 95%). If a match is found, it retrieves the cached answer, reducing the need for additional API calls.
- Chat History: Displays past questions and answers, allowing users to review the session’s conversation.
The Contact Me tab displays the author's contact information. It includes:
- Name: Displays the author's name (e.g., "Rafael G. Fernandes").
- LinkedIn Icon: A clickable LinkedIn icon that links to the author's LinkedIn profile, allowing users to connect or learn more about the author.
This structure provides an organized, end-to-end solution for YouTube content analysis, combining automated processing with an interactive, user-friendly interface.