An intelligent system for analyzing enterprise AI case studies using the Claude 3.5 Sonnet API. The system supports two main modes of operation:
- Analyzing case studies from provided URLs in a CSV file.
- Discovering and analyzing case studies from company websites using the Firecrawl API.
![Screenshot 2024-11-05 at 4 58 41 AM](https://private-user-images.githubusercontent.com/132029956/383097284-95be2e76-12bd-4dea-bd91-1b7d309f0f6d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTEwOTAsIm5iZiI6MTczOTAxMDc5MCwicGF0aCI6Ii8xMzIwMjk5NTYvMzgzMDk3Mjg0LTk1YmUyZTc2LTEyYmQtNGRlYS1iZDkxLTFiN2QzMDlmMGY2ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMDMzMTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wODhmNzczZWE3OTRiMzIzZTNjYzRhZDQxMDJmODIxYmUwZDBiNTlkYmUzMTViZjY1ZmQyNzkxN2IzNmQzZTZmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.raGqMQPqeey5_x-Xo6GgeRy84QHoz9E5s74oTDBgOYk)
![Screenshot 2024-11-05 at 4 58 49 AM](https://private-user-images.githubusercontent.com/132029956/383097388-7b935a1b-b79e-4fb3-85c7-cb18d48601bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtle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N0JlgtQW16LURhdGU9MjAyNTAyMDhUMTAzMzEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2Q1OTFmMDBjM2FhYTE3MjJmMGI2Mzk5MDhhMWY4OTA2Y2Y0OTE5MmFkZmIwYzg2ODEzNzI5NjRkNDhjNTE3NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.MP2NX1zHgnn6qkCODG17bIGSoBleiCAAL5lMlZ3H8LE)
![Screenshot 2024-11-05 at 5 03 37 AM](https://private-user-images.githubusercontent.com/132029956/383098368-370e2f63-fd1c-4af4-ae78-130b99fe4b0b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTEwOTAsIm5iZiI6MTczOTAxMDc5MCwicGF0aCI6Ii8xMzIwMjk5NTYvMzgzMDk4MzY4LTM3MGUyZjYzLWZkMWMtNGFmNC1hZTc4LTEzMGI5OWZlNGIwYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMDMzMTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01NTBkOTMxZjg5Mjg0MmIzOTM1YWNkOTEyNzA4ZjdkOWVmNzA2MTI5ZDE2YjFhZDVhNjBmZDg4ZGYzZGQ2ZGRlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.77R7WFhdmxbs34h00ZmQTlsM3gYs-qEvPLd3QmuOo5Y)
- CSV Mode: Analyze specific case study URLs provided in a CSV file.
- Website Mode: Automatically discover and analyze case studies from company websites using Firecrawl's map endpoint.
- Intelligent case study identification powered by Claude 3.5 Sonnet.
- Content extraction handled by Firecrawl's scrape endpoint.
- Content Extraction (via Firecrawl API):
- Map endpoint (
/v1/map
): Discovers links on the website. - Scrape endpoint (
/v1/scrape
): Extracts content in markdown format and retrieves metadata for context.
- Map endpoint (
- Case Study Identification:
- Uses Claude to identify potential case study links.
- Filters content to ensure only relevant case studies are processed.
- Content Analysis:
- Checks for enterprise AI qualification.
- Performs a detailed, multi-section analysis.
- Assesses business impact and technology stack.
The system creates three types of reports:
- Executive Summary
- AI Strategy Analysis
- Technical Implementation Details
- Business Impact Assessment
- Key Success Factors
- Lessons Learned
- Patterns across multiple implementations.
- Common success factors.
- Technology trends.
- ROI metrics and implementation challenges.
- Company profiles
- Technology stacks
- Success metrics and implementation scales
- Overall trends in enterprise AI adoption
-
Map Endpoint (
/v1/map
):map_result = app.map_url(website_url, params={'includeSubdomains': True})
Used for discovering all links on a website.
-
Scrape Endpoint (
/v1/scrape
):params = { "url": url, "onlyMainContent": True, "formats": ["markdown"], "timeout": 30000 }
Used for content extraction from specific pages.
- Link Analysis: Identifies relevant case study URLs.
- Content Analysis: Checks for enterprise AI relevance.
- Report Generation: Produces comprehensive, structured analysis reports.
Input (CSV/Website) → Firecrawl Map → Link Analysis → Content Extraction → Claude Analysis → Report Generation
project/
├── src/
│ ├── scrapers/
│ │ ├── website_crawler.py # Firecrawl map integration
│ │ └── web_loader.py # Firecrawl scrape integration
│ ├── processors/
│ │ └── claude_processor.py # Claude API integration
│ ├── config.py # Configuration settings
│ └── main.py # Main application logic
├── input/ # Input CSV files
├── raw_content/ # Extracted raw content
│ └── case_[id]/
│ ├── raw_content.txt
│ ├── structured_content.json
│ └── metadata.json
├── reports/
│ ├── individual/ # Individual reports
│ ├── cross_case_analysis/ # Cross-case analysis
│ └── executive_dashboard/ # Executive dashboard
└── logs/ # Processing logs
-
Clone the repository:
git clone https://github.com/yourusername/ai-case-study-analyzer.git cd ai-case-study-analyzer
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables in
.env
:ANTHROPIC_API_KEY=your_claude_api_key FIRECRAWL_API_KEY=your_firecrawl_api_key
- Place your CSV file in the
input/
directory with a column namedurl
containing case study URLs.
- Provide a company website URL to:
- Map all website links using Firecrawl.
- Identify and analyze case study content using Claude.
- Extract content and generate comprehensive reports.
Run the analyzer:
python -m src.main
-
Map Endpoint:
- Discovers all links on a website.
- Parameters:
includeSubdomains: true
,ignoreSitemap: false
,limit: 5000
.
-
Scrape Endpoint:
- Extracts main content from individual pages.
- Parameters:
onlyMainContent: true
,formats: ["markdown"]
,timeout: 30000
.
-
Link Analysis:
- Model:
claude-3-5-sonnet-20241022
. - Temperature:
0.2
. - Max tokens:
4096
.
- Model:
-
Content Analysis:
- Checks for enterprise AI qualification.
- Performs multi-section analysis and report generation.
# Enterprise AI Implementation Report: [Company Name]
1. **Executive Summary**
[Summary of implementation and outcomes]
2. **AI Strategy Analysis**
[Detailed analysis of AI strategy]
{
"case_1": {
"company": {...},
"technologies": [...],
"success_factors": {...},
"business_impact": {...}
}
}
Contributions are welcome!
This project is licensed under the MIT License.