AI Enterprise Case Study Analyzer

repository·main·Indexed 20 days ago

https://github.com/muratcankoylan/ai-investigator

An intelligent system to automate the discovery, extraction, and analysis of enterprise AI case studies. It utilizes Firecrawl for web crawling and scraping and the Claude 3.5 Sonnet model (claude-3-5-sonnet-20241022) for semantic analysis and report generation. The tool supports two primary workflows: analyzing specific URLs from CSV files and discovering case studies via company website crawling. It generates individual case study reports, cross-case analyses, and executive dashboards.

Tokens
5K
Snippets
15
Records
25
Agent score
72%

What's inside ai-investigator

  1. Analyze enterprise AI case studies

    main

    The AI Enterprise Case Study Analyzer is a Python application that uses the Claude 3.5 Sonnet API to identify, analyze, and report on enterprise-scale AI implementations. It supports two primary workflows:

    1. Direct URL Analysis: Scrape a specific URL, validate if it qualifies as an enterprise AI case study, and generate detailed reports.
    2. Company Website Discovery: Scrape a company website to find, list, and then analyze multiple case study links found on that site.

    To qualify as a valid case study, the content must involve established companies (not startups), focus on business AI implementation, demonstrate enterprise-scale deployment, and provide clear business outcomes or metrics.

  2. Project Directory Structure

    main

    Understanding the file layout helps in locating inputs, raw data, and generated reports:

    • src/: Core logic including scrapers/ (Firecrawl integration), processors/ (Claude integration), config.py, and main.py.
    • input/: Location for input CSV files.
    • raw_content/: Stores extracted data per case ID (e.g., raw_content.txt, structured_content.json, metadata.json).
    • reports/: Final output directory for individual, cross-case, and dashboard reports.
    • logs/: Processing logs.
    project/
    ├── src/
    │   ├── scrapers/
    │   │   ├── website_crawler.py
    │   │   └── web_loader.py
    │   ├── processors/
    │   │   └── claude_processor.py
    │   ├── config.py
    │   └── main.py
    ├── input/
    ├── raw_content/
    │   └── case_[id]/
    ├── reports/
    │   ├── individual/
    │   ├── cross_case_analysis/
    │   └── executive_dashboard/
    └── logs/
  3. Understand the Report Generation Outputs

    main

    The system generates three distinct types of reports stored in the reports/ directory:

    1. Individual Case Study Reports (reports/individual/): Detailed markdown reports for a single company, including Executive Summary, AI Strategy Analysis, Technical Implementation, Business Impact, Success Factors, and Lessons Learned.
    2. Cross-Case Analysis (reports/cross_case_analysis/): Aggregated analysis identifying patterns, technology trends, and ROI metrics across all processed case studies.
    3. Executive Dashboard (reports/executive_dashboard/): High-level summaries of company profiles, technology stacks, and overall enterprise AI adoption trends.
  4. Understand the Case Study Analysis structure

    main

    When a case study is qualified, the system extracts and analyzes six specific sections to build its reports:

    1. Company Context & AI Strategy
    2. Business Challenge & Opportunity
    3. AI Solution Architecture
    4. Implementation & Integration
    5. Change Management & Adoption
    6. Business Impact & Lessons
  5. Use the Company Website workflow

    main

    To discover and analyze case studies from an entire company website:

    1. Provide the company website URL.
    2. The system scrapes the website to locate case study links.
    3. The found links are compiled into a structured table and displayed in the terminal.
    4. The system then automatically iterates through these links, applying the standard case study analysis process to each.
  6. Install and Setup the AI Enterprise Case Study Analyzer

    main

    Follow these steps to set up the environment and install dependencies for the analyzer.

    1. Clone the repository:

      git clone https://github.com/yourusername/ai-case-study-analyzer.git
      cd ai-case-study-analyzer
    2. Create and activate a virtual environment:

      python -m venv .venv
      source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    3. Install dependencies:

      pip install -r requirements.txt
    4. Configure environment variables: Create a .env file in the root directory and add your API keys:

      ANTHROPIC_API_KEY=your_claude_api_key
      FIRECRAWL_API_KEY=your_firecrawl_api_key
    git clone https://github.com/yourusername/ai-case-study-analyzer.git
    cd ai-case-study-analyzer
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  7. Use the Case Study URL workflow

    main

    To analyze a specific case study from a single URL:

    1. Provide the case study URL.
    2. The system extracts content using firecrawl or web_loader.
    3. The content is sent to Claude for validation against enterprise AI criteria.
    4. If qualified, the system generates and saves reports. If not, it prints the reason for disqualification.

    Output Locations:

    • Individual reports: reports/individual (PDF)
    • Cross-case analysis: reports/cross_case_analysis (PDF)
    • Executive dashboard: reports/executive_dashboard.json (JSON)
  8. Run the Case Study Analyzer

    main

    The analyzer can be executed via the main module. Depending on your configuration and input files, it will operate in either CSV mode or Website mode.

    CSV Analysis Mode

    Place a CSV file in the input/ directory. The CSV must contain a column named url which lists the specific case study URLs you wish to analyze.

    Website Analysis Mode

    Provide a company website URL. The system will use Firecrawl to map the site, identify case study links using Claude, extract content, and generate reports.

    Execution command:

    python -m src.main
  9. How WebsiteCrawler identifies case studies

    main

    The WebsiteCrawler follows a two-step process to discover content:

    1. Discovery: It uses the Firecrawl map_url endpoint with includeSubdomains: True to retrieve a comprehensive list of all links on the target domain.
    2. Analysis: It passes the list of discovered URLs to Claude via the ClaudeProcessor.analyze_links() method. Claude is prompted to look for specific patterns such as:
      • /case-studies/
      • /customer-stories/
      • /success-stories/
      • URLs containing implementation details (e.g., how-[company]-used-[product])
      • Blog or newsroom paths that might contain case studies.

    Claude returns a JSON list of indices (e.g., [0, 2, 5]) corresponding to the URLs in the original list. The crawler then maps these indices back to the full URLs.

  10. Run the AI Enterprise Case Study Analyzer

    main

    The main.py file serves as the primary entrypoint for the application. When executed, it provides an interactive CLI menu allowing you to choose between two analysis modes:

    1. Analyze specific case study URLs from CSV: Loads a list of URLs from a CSV file located in the INPUT_DIR and processes each one.
    2. Analyze case studies from a company website: Uses a crawler to discover potential case study links on a provided company website and then processes them.

    To run the application, execute the script using Python with asyncio support.

    python src/main.py
  11. Claude 3.5 Sonnet API Configuration

    main

    The system utilizes the claude-3-5-sonnet-20241022 model for link identification, content relevance checking, and report generation. The following parameters are used for analysis tasks:

    • Model: claude-3-5-sonnet-20241022
    • Temperature: 0.2
    • Max tokens: 4096