# ayanleaideed/startup-analyzer architecture

> Architecture diagram of the GitHub repository ayanleaideed/startup-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayanleaideed/startup-analyzer
- Repository: https://github.com/ayanleaideed/startup-analyzer

## Overview

##### Project type and purpose
- This is an open-source analysis tool implemented as a single Jupyter/Colab notebook (“Startup Analyzer”).
- Purpose: guide a user through structured startup-idea evaluation by orchestrating several expert-review steps, combining results, and generating a final report.

##### File structure
- Top level:
- README.md – project description, setup, usage.
- requirements.txt – Python dependencies (pydantic-ai, pydantic, nest_asyncio).
- notebooks/startup_analysis.ipynb – the sole implementation file (the orchestration notebook).
- No backend server, no database, no UI framework beyond Jupyter.

a. Main components
- “User Interface” (Colab/Jupyter Notebook)
- “Orchestration Layer” (the notebook’s pipeline code)
- “Expert Modules” (MarketReview, TechReview, FinanceReview, LegalReview)
- “Aggregator Module” (CombinedAnalysis)
- “Report Generator”
- “External LLM Services” (OpenAI API, Gemini API)
- “Local Models & Utils” (pydantic-ai schemas, validation logic, any helper functions)
b. Relationships & interactions
- User inputs startup details into the UI.
- Orchestration Layer triggers each Expert Module in sequence, each calling out to one or more LLM APIs.
- Results feed into the Aggregator Module (could be another LLM call or local merge logic).
- Aggregator outputs into the Report Generator (likely LLM-assisted formatting).
- Final report is displayed back in the notebook UI.
c. Architectural patterns / principles
- Pipeline / Stage pattern: clear, linear flow through expert modules → aggregator → reporter.
- Separation of concerns: each module focuses on one domain review.
- Dependency Injection via pydantic-ai for structured inputs/outputs.
d. Key technologies
- Notebook environment (Jupyter/Colab)
- Python packages: pydantic-ai, pydantic, nest_asyncio
- External services: OpenAI API, Gemini API

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External documentation and setup
    README["README.md"]:::util
    REQ["requirements.txt"]:::util

    README -->|describes project| REQ
    REQ -->|installs dependencies| Notebook

    subgraph "Notebook Environment"
        direction TB
        UI["User Interface\n(Colab/Jupyter Notebook)"]:::ui
        Orch["Orchestration Layer\n(pipeline code)"]:::processing
        subgraph "Expert Modules"
            direction TB
            MR["MarketReview Module"]:::processing
            TR["TechReview Module"]:::processing
            FR["FinanceReview Module"]:::processing
            LR["LegalReview Module"]:::processing
        end
        CA["CombinedAnalysis\n(Aggregator Module)"]:::processing
        RG["Report Generator"]:::processing
        Config["LLM Services Config\n(OpenAI & Gemini API)"]:::util
        Utils["Local Models & Utils\n(pydantic-ai schemas\nvalidation helpers)"]:::util
    end

    %% External services
    OpenAI["OpenAI API"]:::external
    Gemini["Gemini API"]:::external

    %% Data flow
    UI -->|user inputs| Orch
    Orch --> MR
    Orch --> TR
    Orch --> FR
    Orch --> LR

    MR -->|calls LLM| OpenAI
    MR -->|calls LLM| Gemini
    TR -->|calls LLM| OpenAI
    TR -->|calls LLM| Gemini
    FR -->|calls LLM| OpenAI
    FR -->|calls LLM| Gemini
    LR -->|calls LLM| OpenAI
    LR -->|calls LLM| Gemini

    MR --> CA
    TR --> CA
    FR --> CA
    LR --> CA

    CA --> RG
    RG --> UI

    Config --> MR
    Config --> TR
    Config --> FR
    Config --> LR
    Config --> CA
    Config --> RG

    Utils --> Orch
    Utils --> MR
    Utils --> TR
    Utils --> FR
    Utils --> LR
    Utils --> CA
    Utils --> RG

    %% Click events
    click UI "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click Orch "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click MR "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click TR "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click FR "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click LR "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click CA "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click RG "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click Config "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click Utils "https://github.com/ayanleaideed/startup-analyzer/blob/main/notebooks/startup_analysis.ipynb"
    click REQ "https://github.com/ayanleaideed/startup-analyzer/blob/main/requirements.txt"
    click README "https://github.com/ayanleaideed/startup-analyzer/blob/main/README.md"

    %% Styles
    classDef ui fill:#AEDFFD,stroke:#333,stroke-width:1px
    classDef processing fill:#A8E6A3,stroke:#333,stroke-width:1px
    classDef external fill:#FFD59E,stroke:#333,stroke-width:1px
    classDef util fill:#EDEDED,stroke:#333,stroke-width:1px
```
