A multi-agent AI system that conducts comprehensive due diligence analysis on startups using LangGraph orchestration and Claude's Agent SDK.
The idea is simple: Input a startup name → Get a complete investment analysis report
The initial version created as part of a workshop by: Khaled El Fakharany. I highly recommend you check it out!
This platform automates the startup evaluation process using 11 specialized AI agents organized into a 3-layer processing pipeline:
- Layer 1: Research - 5 agents gather data from multiple sources
- Layer 2: Analysis - 4 agents perform deep analysis
- Layer 3: Synthesis - 2 agents generate reports and investment decisions
The system uses 11 specialized agents orchestrated through a LangGraph StateGraph:
- Company Profiler - Researches company background, founding, operations
- Market Researcher - Analyzes market opportunity, TAM/SAM/SOM, trends
- Competitor Scout - Identifies competitors and competitive landscape
- Team Investigator - Researches founders and key team members
- News Monitor - Tracks recent news and media coverage
- Financial Analyst - Evaluates financial health, funding, burn rate
- Risk Assessor - Identifies business, market, and regulatory risks
- Tech Evaluator - Assesses technical architecture and innovation
- Legal Reviewer - Reviews legal and compliance concerns
- Report Generator - Creates comprehensive due diligence reports
- Decision Agent - Generates investment recommendations with confidence scores
The workflow follows this graph structure:
init → research → validate_research → analysis → synthesis → output
↑ |
└─────────────┘ (retry if incomplete)
Stages:
- Init - Validates input and initializes state
- Research - All 5 research agents run in parallel
- Validate Research - Checks research completeness (retries if needed)
- Analysis - All 4 analysis agents run in parallel on research data
- Synthesis - Report generator and decision agent create final outputs
- Output - Returns complete results
The workflow uses a central DueDiligenceState object that flows through all nodes:
- Inputs:
startup_name,startup_description,funding_stage - Research outputs: Results from all research agents
- Analysis outputs: Results from all analysis agents
- Final outputs:
full_report,investment_decision - Metadata:
current_stage,errors,retry_count
- Python 3.8+
- Claude API key (set as environment variable or in config)
- Clone the repository:
git clone <repository-url>
cd startup-due-diligence- Create and activate 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 your Claude API key:
export ANTHROPIC_API_KEY="your-api-key-here" # On Windows: set ANTHROPIC_API_KEY=your-api-key-hereIf you're using Claude Code and working on your local machine then you don't actually need to set this - it'll simply use your existing Claude configuration (subscription or API).
Run the main script with command line arguments to analyze any startup:
python main.py "Company Name" "Company Description" [--stage FUNDING_STAGE]Arguments:
company_name(required): Name of the startup to analyzecompany_description(required): Brief description of what the startup does--stage(optional): Funding stage of the startup. Default:Growth- Supported stages:
Seed,Series A,Series B,Series C,Series D,Growth,Pre-IPO
- Supported stages:
Examples:
# Analyze Stripe (uses default "Growth" stage)
python main.py "Stripe" "Stripe is a payment infrastructure company"
# Analyze OpenAI at Series B stage
python main.py "OpenAI" "OpenAI develops large language models" --stage "Series B"
# Analyze Anthropic at Series C stage
python main.py "Anthropic" "Anthropic is an AI safety company" --stage "Series C"
# View help and examples
python main.py --helpYou can also use the platform programmatically in your own Python code:
import asyncio
from src.workflow import run_due_diligence
async def analyze_startup():
result = await run_due_diligence(
startup_name="Your Startup Name",
startup_description="Description of what the startup does...",
funding_stage="Seed" # Optional: Seed, Series A, Series B, Growth, etc.
)
# Access results
print(result["investment_decision"])
print(result["full_report"])
print(result["research_outputs"])
print(result["analysis_outputs"])
asyncio.run(analyze_startup())You can test individual agents using test_agent.py:
python test_agent.pyModify the script to test different agents from src/agents/.
startup-due-diligence/
├── main.py # Main entry point
├── test_agent.py # Agent testing utility
├── requirements.txt # Python dependencies
├── README.md # This file
│
├── reports/ # Auto-generated reports (created on first run)
│ └── *.md # Timestamped markdown reports
│
├── src/
│ ├── __init__.py
│ │
│ ├── agents/ # All agent implementations
│ │ ├── __init__.py
│ │ ├── base.py # Base agent wrapper with error handling
│ │ │
│ │ ├── research/ # Layer 1: Research agents
│ │ │ ├── company_profiler.py
│ │ │ ├── market_researcher.py
│ │ │ ├── competitor_scout.py
│ │ │ ├── team_investigator.py
│ │ │ └── news_monitor.py
│ │ │
│ │ ├── analysis/ # Layer 2: Analysis agents
│ │ │ ├── financial_analyst.py
│ │ │ ├── risk_assessor.py
│ │ │ ├── tech_evaluator.py
│ │ │ └── legal_reviewer.py
│ │ │
│ │ └── synthesis/ # Layer 3: Synthesis agents
│ │ ├── report_generator.py
│ │ └── decision_agent.py
│ │
│ ├── config/ # Configuration
│ │ ├── settings.py # Model mappings
│ │ └── agent_configs.py # Agent configurations
│ │
│ ├── state/ # State management
│ │ ├── schema.py # DueDiligenceState definition
│ │ └── enums.py # Enumerations
│ │
│ └── workflow/ # LangGraph workflow
│ ├── graph.py # Graph definition
│ ├── nodes.py # Node implementations
│ └── routing.py # Conditional routing logic
Agents use different Claude models based on their complexity:
- Haiku (
claude-haiku-4-5-20251001) - Fast, cost-effective for research and simple analysis - Sonnet (
claude-sonnet-4-20250514) - Balanced for complex analysis and report generation - Opus (
claude-opus-4-5-20251101) - Most capable for final investment decisions
Model assignments are configured in src/config/agent_configs.py.
Each agent has:
- Model: Which Claude model to use
- Tools: Available tools (WebSearch, WebFetch, etc.)
- Timeout: Execution timeout in seconds (default: 120s for research/analysis, 180s for synthesis)
- System prompt: Specialized instructions for the agent
Example from src/config/agent_configs.py:
COMPANY_PROFILER = AgentConfig(
name="company_profiler",
model="haiku",
tools=["WebSearch", "WebFetch"],
timeout_seconds=120, # Extended timeout for reliable web research
system_prompt="You are a company research specialist..."
)Timeout Configuration:
- Research agents (5): 120 seconds each
- Analysis agents (4): 120 seconds each
- Synthesis agents (2): 180 seconds each
The workflow returns a DueDiligenceState object containing:
{
"recommendation": "invest" | "pass" | "conditional_invest",
"confidence": 0.0 - 1.0,
"key_factors_for": ["reason 1", "reason 2", ...],
"key_factors_against": ["concern 1", "concern 2", ...],
"summary_rationale": "Overall reasoning..."
}A comprehensive markdown report including:
- Executive summary
- Company overview
- Market analysis
- Competitive landscape
- Team assessment
- Financial analysis
- Risk evaluation
- Technical assessment
- Legal review
- Investment recommendation
Report Storage: All reports are automatically saved to the reports/ directory with timestamps and sanitized company names (e.g., reports/stripe_20260123_143022.md). Each report includes the investment decision at the top followed by the detailed analysis.
Individual results from each agent, including success status, execution time, and output data.
- Command-Line Interface: Analyze any startup via CLI arguments without editing code
- Parallel Execution: Research and analysis agents run concurrently for speed
- Fault Tolerance: Handles agent failures gracefully, continues workflow
- Retry Logic: Automatically retries research layer if incomplete (up to 2 retries)
- Automatic Report Storage: All reports saved to
reports/directory with timestamps - Extended Timeouts: Research and analysis agents run with 120-second timeouts for reliable web research
- Standardized Output: All agents return consistent
AgentResultformat - Timeout Protection: Each agent has configurable timeout
- Structured State: TypedDict-based state with type safety
- LangGraph 1.06 - Workflow orchestration and state management
- Claude Agent SDK 0.1.20 - AI agent execution
- Python 3.8+ - Core language
- Pydantic - Data validation
- Asyncio - Asynchronous execution
The system includes multiple layers of error handling:
- Agent-level: Each agent call wrapped in try-catch with timeout
- Node-level: Workflow nodes handle agent failures gracefully
- State-level: Errors accumulated in state for debugging
- Validation: Research completeness check with retry mechanism
- Create agent file in appropriate layer directory
- Define agent configuration in
src/config/agent_configs.py - Implement agent using
run_agent()fromsrc/agents/base.py - Add to agent list in config
- Update workflow nodes to include new agent
Edit src/workflow/graph.py to:
- Add new nodes
- Modify edges
- Update conditional routing
- Change workflow stages
Typical execution times with 120s timeouts (depends on agent complexity and API response):
- Research layer: 60-120 seconds (5 agents in parallel, with web research)
- Analysis layer: 60-120 seconds (4 agents, 3 parallel + 1 sequential)
- Synthesis layer: 120-180 seconds (2 agents sequential)
- Total: ~4-7 minutes for complete analysis
Retry behavior: If research agents fail (less than 50% success rate), the system will automatically retry up to 2 times before proceeding with available data.
Agent Timeouts
- Research and analysis agents have 120-second timeouts
- If agents consistently timeout, check your internet connection
- Web research can take longer for less-known companies
Tech Evaluator Failures
- The Tech Evaluator now has web search tools to research patents and technical details
- For very new or stealth startups, it will make reasonable estimates based on industry norms
Risk Assessor Failures
- The Risk Assessor processes up to 8000 characters of context to avoid token limits
- Ensure at least 50% of research agents succeed to provide adequate data
Validation Counter Issues
- Fixed in latest version: retry attempts now correctly count only the most recent 5 research outputs
- Validation no longer accumulates counts across retries
Report Not Saved
- The
reports/directory is created automatically on first run - Check file permissions if saving fails
- Reports are saved with sanitized company names and timestamps
- Requires active internet connection for research agents
- API costs scale with usage (especially Opus model)
- Research quality depends on publicly available information
- Real-time data may be limited by search capabilities
See LICENSE file for details.