Skip to content

Latest commit

 

History

History
357 lines (256 loc) · 9.79 KB

File metadata and controls

357 lines (256 loc) · 9.79 KB

🦈 Shark Tank Pitch Analyzer

An AI-powered sales pitch analysis tool that provides comprehensive feedback on delivery and content quality, styled as feedback from famous Shark Tank investors. Analyze your sales pitch videos and receive personalized, actionable feedback tailored to different investor personalities and sales stages.

Overview

The Shark Tank Pitch Analyzer uses Google's Gemini AI models to analyze sales pitch videos across multiple dimensions:

  • Delivery Analysis: Evaluates posture, tone, speech clarity, and gestures
  • Content Analysis: Assesses effectiveness, structure, customer focus, and competitive positioning
  • Personalized Feedback: Get feedback in the style of your favorite Shark Tank investor (Mark Cuban, Kevin O'Leary, Barbara Corcoran, etc.)
  • Sales Stage Context: Receive feedback tailored to your prospect's stage in the buying journey

Features

  • 🎥 Video Analysis: Analyze YouTube videos or local video files
  • 🎭 Investor Personas: Choose from 7 different Shark Tank investor personalities
  • 📊 Comprehensive Scoring: Detailed scores (1-10) for each aspect with timestamp references
  • 💬 Interactive Chat: Ask follow-up questions about your analysis
  • 🌐 Web Interface: Beautiful Gradio-based web UI for easy access
  • 📝 Export Results: Save analysis results as JSON files
  • 🔄 Streaming Responses: Real-time streaming of AI-generated feedback

Architecture

The project is organized into several key components:

Core Components

  • analyzer/: Video analysis engine

    • video_analyzer.py: Main orchestration logic
    • analyzers/delivery.py: Delivery aspect analysis (posture, tone, speech, gestures)
    • analyzers/content.py: Content aspect analysis (effectiveness, structure, customer focus)
  • models/: Pydantic data models

    • delivery.py: Delivery analysis models
    • content.py: Content analysis models
    • output.py: Combined analysis result model
  • chat/: Interactive chat workflow

    • workflow.py: Main chat workflow logic
    • chain.py: LangChain chain setup for AI interactions
    • prompts.py: Prompt templates for investor personas
  • output/: Result formatting and saving

    • formatter.py: JSON formatting and file saving utilities
  • utils/: Utilities

    • settings.py: Configuration and environment variables
    • logger.py: Logging setup

Entry Points

  • main.py: Command-line interface for batch analysis
  • chat_main.py: Interactive chat workflow CLI
  • gradio_app.py: Web-based Gradio interface
  • shark_tank_data.py: Investor personalities and sales stage definitions

Installation

Prerequisites

  • Python 3.13 or higher
  • uv package manager
  • Google API key for Gemini models

Setup

  1. Clone the repository:
git clone <repository-url>
cd palindrom-project
  1. Install dependencies:
make install
# or manually:
uv sync --all-groups
  1. Create a .env file in the project root:
GOOGLE_API_KEY=your_google_api_key_here
GEMINI_MODEL=models/gemini-2.0-flash
LOG_LEVEL=INFO

# Optional Gradio settings
GRADIO_PORT=7860
GRADIO_HOST=127.0.0.1
GRADIO_SHARE=false

Usage

Web Interface (Recommended)

Launch the Gradio web interface:

make gradio
# or manually:
uv run python src/gradio_app.py

Then open your browser to http://127.0.0.1:7860 (or the configured port).

Features:

  • Select investor personality and sales stage
  • Enter YouTube URL or use example videos
  • View embedded video player
  • Receive formatted analysis report
  • Ask follow-up questions in the chat interface

Interactive Chat CLI

Run the interactive chat workflow:

make chat
# or manually:
uv run python src/chat_main.py

Options:

  • --investor: Choose investor persona (Mark Cuban, Kevin O'Leary, Barbara Corcoran, etc.)
  • --stage: Select sales stage (Cold prospects, Problem-aware, Solution-aware, Ready to buy)

Example:

uv run python src/chat_main.py --investor "Kevin O'Leary" --stage "Solution-aware"

Command-Line Analysis

Run a one-time analysis and save results:

uv run python src/main.py --video-url "https://www.youtube.com/shorts/B6u--LaDtf0" --output pitch-analysis.json

Options:

  • --video-url: YouTube URL or local file URI (default: example YouTube short)
  • --output: Optional filename to save results (default: prints to console only)

Makefile Commands

The project includes a comprehensive Makefile for common tasks:

Installation & Setup

  • make install: Install all dependencies using uv sync --all-groups

Code Quality Commands

  • make check-lint: Run Ruff linter to check for code issues
  • make check-type: Run MyPy type checker
  • make check-format: Check code formatting with Ruff
  • make check: Run all checks (lint, format, type)
  • make format: Auto-format code with Ruff

Testing Commands

  • make test: Run all tests with coverage report
  • make test-single TEST=path/to/test.py: Run a single test file

Running Applications

  • make chat: Start interactive chat workflow
  • make gradio: Launch Gradio web interface

Example Usage

# Install dependencies
make install

# Format code
make format

# Run all checks
make check

# Run tests
make test

# Start web interface
make gradio

Project Structure

palindrom-project/
├── data/
│   ├── input/          # Input video files
│   └── output/
│       └── analyses/   # Saved analysis JSON files
├── src/
│   ├── analyzer/       # Video analysis engine
│   │   ├── analyzers/
│   │   │   ├── content.py
│   │   │   └── delivery.py
│   │   └── video_analyzer.py
│   ├── chat/          # Interactive chat workflow
│   │   ├── chain.py
│   │   ├── prompts.py
│   │   └── workflow.py
│   ├── models/        # Pydantic data models
│   │   ├── content.py
│   │   ├── delivery.py
│   │   └── output.py
│   ├── output/        # Result formatting
│   │   └── formatter.py
│   ├── prompts/       # Analysis prompt templates
│   │   ├── content.txt
│   │   └── delivery.txt
│   ├── utils/         # Utilities
│   │   ├── logger.py
│   │   └── settings.py
│   ├── chat_main.py   # Chat CLI entry point
│   ├── gradio_app.py  # Web UI entry point
│   ├── main.py        # Batch analysis CLI
│   └── shark_tank_data.py  # Investor personas
├── tests/             # Test files
├── Makefile           # Build and run commands
├── pyproject.toml     # Project configuration
└── README.md          # This file

Analysis Dimensions

Delivery Analysis

  • Posture: Body positioning, alignment, confidence indicators
  • Tone: Voice tone, emotional delivery, enthusiasm
  • Speech: Clarity, pace, articulation, diction
  • Gestures: Facial expressions, hand movements, body language

Content Analysis

  • Effectiveness: Opening hook, value proposition, call-to-action
  • Structure: Logical progression, pacing, objection handling
  • Customer Focus: Pain point identification, personalization, benefits vs features
  • Delivery & Tone: Confidence, storytelling, social proof
  • Competitive Positioning: Differentiation, market awareness

Each aspect receives:

  • A score from 1-10
  • Detailed assessment with timestamp references
  • Specific improvement suggestions
  • Key timestamp references for important moments

Investor Personas

The tool supports 7 different Shark Tank investor personalities:

  1. Mark Cuban: Bold, decisive, values hustle
  2. Kevin O'Leary ("Mr. Wonderful"): Numbers-focused, blunt, loves licensing deals
  3. Barbara Corcoran: Scrappy underdog champion, warm and encouraging
  4. Lori Greiner ("The Queen of QVC"): Product guru, enthusiastic about consumer products
  5. Daymond John: Branding expert, strategic, focuses on long-term building
  6. Robert Herjavec: Empathetic, tech-savvy, invests in people
  7. Daniel Lubetzky: Values-driven, looks for social impact alongside profit

Sales Stages

Feedback is tailored to four sales stages:

  1. Cold prospects: Don't know you, don't know they have a problem
  2. Problem-aware: Know the pain, exploring options
  3. Solution-aware: Comparing vendors
  4. Ready to buy: Removing final objections

Technologies

  • Python 3.13: Core language
  • Google Gemini AI: Video analysis and chat responses
  • LangChain: LLM chain orchestration
  • Gradio: Web interface framework
  • Pydantic: Data validation and modeling
  • Ruff: Linting and formatting
  • MyPy: Type checking
  • pytest: Testing framework
  • uv: Fast Python package manager

Configuration

Environment Variables

Create a .env file in the project root:

# Required
GOOGLE_API_KEY=your_api_key_here

# Optional
GEMINI_MODEL=models/gemini-2.0-flash
LOG_LEVEL=INFO
GRADIO_PORT=7860
GRADIO_HOST=127.0.0.1
GRADIO_SHARE=false
GOOGLE_CLOUD_PROJECT=your_project_id

Output Directory

Analysis results are saved to data/output/analyses/ by default. This can be configured via the OUTPUT_DIR setting in src/utils/settings.py.

Development

Code Quality

The project uses:

  • Ruff for linting and formatting
  • MyPy for type checking
  • Pydantic for runtime type validation

Run quality checks:

make check        # All checks
make check-lint   # Linting only
make check-type   # Type checking only
make format       # Auto-format code

Testing

Run tests with coverage:

make test

Run a single test:

make test-single TEST=tests/test_example.py

License

[Add your license information here]

Contributing

[Add contribution guidelines here]