Inspiration

Content Creation is rising, and creators are drowning in feedback. A single YouTube video can generate thousands of comments, making it nearly impossible to understand what your audience truly thinks. We watched educators spend hours manually reading comments, trying to identify patterns, gauge sentiment, and find actionable insights... time that could be spent creating better content.

We asked ourselves: What if AI could do this in seconds?

The inspiration struck when we realized that behind every comment lies a story. From a viewer's genuine reaction, a suggestion for improvement, or a concern that needs addressing. InsightTube was born from the vision of giving creators an advantage: the ability to understand their entire audience, one comment at a time, with the help of AI.

What it does

  • Analyzes comments in seconds
  • Calculates overall sentiment scores using advanced NLP
  • Extracts trending topics and conversation themes automatically
  • Detects controversy levels to help creators stay ahead of potential issues
  • Filters spam to provide clean, meaningful insights
  • AI-Powered chat assistant powered by Google's Gemini 2.0 Flash model, answering natural language questions about your video's performance and providing context-aware responses based on actual comment data

How we built it

Frontend Layer (Streamlit)

  • Custom CSS with glassmorphism and gradient effects
  • Interactive components for user experience
  • Responsive dashboard with real-time data visualization
  • Chat interface with message history management

Backend Service Layer

  1. GeminiClient: Manages API connections with different "personalities"
  2. ChatManager: Maintains conversation context
  3. Automatic history management
  4. Context window optimization
  5. Graceful error handling
  6. Error Handlers: Production-grade resilience
  7. Exponential backoff with retry logic
  8. API quota management
  9. Comprehensive logging system

Tech Stack

  • AI: Google Gemini 2.0 Flash (gemini-2.0-flash-exp)
  • Frontend: Streamlit with custom CSS
  • Visualization: Plotly Express
  • API: YouTube Data API v3
  • Testing: Pytest with 95%+ coverage
  • Logging: Rotating file handlers with structured logs

Challenges we ran into

  1. Comment Data Inconsistency. YouTube comments come in various formats—some videos have disabled comments, others have mixed-type data (strings, nulls, lists). We built a robust data cleaning pipeline that:
  2. Normalizes all comment formats to consistent structures
  3. Handles missing data gracefully
  4. Validates input before processing
  5. Context Window Management. Maintaining conversation context while staying within token limits was tricky
  6. Gemini's native conversation history (handles this automatically)
  7. Optional manual trimming for very long conversations
  8. Smart context summarization for extended sessions
  9. Import Path Issues. With a complex project structure (src/ai_brain, src/data_miner, etc.), import paths were BRUTAL
  10. Created an automated import fixing script
  11. Standardized all imports to use absolute paths from project root

Accomplishments that we're proud of

  1. Built a Production-Ready System
  2. 95%+ test coverage with pytest
  3. Comprehensive error handling and logging
  4. Intelligent caching reducing costs by 70%
  5. Handles edge cases
  6. Fast Analysis
  7. Analyzes 500+ comments in under 10 seconds
  8. Lightning-fast chat responses
  9. Delivered Real Value :)
  10. Actual actionable insights for creators
  11. Natural language interface anyone can use
  12. Scales from small channels to viral videos

Somethings we learned/improved on

  • Prompt Engineering: Crafting system instructions that enforce JSON output and conversational behavior
  • API Integration: Working with multiple APIs (YouTube, Gemini)
  • Error Handling: Exponential backoff, retry logic, and graceful degradation
  • Testing: Writing comprehensive tests for AI systems
  • Conversation context management is crucial for AI chat quality
  • Documentation helps even when working solo
  • Users don't care about the tech stack, and UI doesn't have to be the most beautiful; they care about results

What's next for InsightTube

  • Analyze comments in any language
  • Analyze all videos from a channel at once
  • Compare your metrics against similar channels
  • Expand to TikTok, Instagram, and other media platforms
  • Alert creators when sentiment shifts dramatically

Ultimate Goal

InsightTube is meant to be the standard tool for content creators, educators, and parents who want to understand the YouTube video's audience. Not just what people say, but what they mean, including the emotions, concerns, and desires hidden in thousands of comments.

Built with the goal of transparency at nwHacks 2026

Built With

Share this project:

Updates