RURAL REACH

2 Squirrels AI

Technology Stack

AI EngineClaude Sonnet 4
BackendFlask + Python
DatabaseSQLite
ExportPDF / CSV / ZIP
FrontendInteractive Map

Architecture Note: Multi-stage AI system for healthcare market intelligence, analyzing state initiatives, generating sales content, and identifying feature gaps for the Rural Reach Telehealth Platform.

AI Pipeline Components

πŸ“Š
State Analyzer
Initiative Compatibility
πŸ“ˆ
Boost Calculator
7-Factor Scoring
πŸ“ž
Call Script Gen
Sales Coaching
βœ‰οΈ
Email Generator
Cold Outreach
πŸ”
Gap Analyzer
Feature Discovery
πŸ“
Export Engine
Multi-Format Output

State Data Analysis Pipeline

%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#C17852', 'primaryTextColor': '#F0F6FC', 'primaryBorderColor': '#4A5E32', 'lineColor': '#E6C98F', 'secondaryColor': '#161B22', 'tertiaryColor': '#0D1117', 'background': '#0D1117', 'mainBkg': '#161B22', 'nodeBorder': '#4A5E32', 'clusterBkg': '#161B22', 'clusterBorder': '#4A5E32', 'titleColor': '#E6C98F', 'edgeLabelBackground': '#161B22'}}}%%
flowchart LR
    subgraph Input["πŸ“₯ Data Sources"]
        PDF["πŸ“„ State Initiative PDFs"]
        PRO["πŸ“‹ RHTP Proposal"]
    end
    subgraph Extract["βš™οΈ Extraction"]
        BI["πŸ”§ Batch Import"]
        IN["πŸ“ Initiative Text"]
    end
    subgraph AI["πŸ€– Claude Analysis"]
        CL["🧠 Claude Sonnet 4"]
        SC["πŸ“Š Compatibility Score"]
    end
    subgraph Store["πŸ’Ύ Storage"]
        DB[("πŸ—„οΈ SQLite")]
        AN["πŸ“‹ Analyses Table"]
        SI["πŸ“Š Initiatives Table"]
    end
    PDF --> BI
    PRO --> CL
    BI --> IN
    IN --> CL
    CL --> SC
    SC --> AN
    IN --> SI
    AN --> DB
    SI --> DB
                

Boost Score Calculation

%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#C17852', 'primaryTextColor': '#F0F6FC', 'primaryBorderColor': '#4A5E32', 'lineColor': '#E6C98F', 'secondaryColor': '#161B22', 'tertiaryColor': '#0D1117', 'background': '#0D1117', 'mainBkg': '#161B22', 'nodeBorder': '#4A5E32', 'clusterBkg': '#161B22', 'clusterBorder': '#4A5E32', 'titleColor': '#E6C98F', 'edgeLabelBackground': '#161B22'}}}%%
flowchart TB
    subgraph Input["πŸ“₯ Enrichment Data"]
        POP["πŸ‘₯ Population"]
        RUR["πŸ”οΈ Rural %"]
        CAH["πŸ₯ CAH Count"]
        UNI["πŸ“Š Uninsured Rate"]
        MED["πŸ’Š Medicaid Status"]
    end
    subgraph Factors["πŸ“Š 7 Boost Factors"]
        F1["πŸ” Coverage Gap +5"]
        F2["πŸ”οΈ Rural Pop Β±3"]
        F3["πŸ₯ CAH Density Β±3"]
        F4["πŸ“Š Uninsured +2"]
        F5["πŸ‘΄ Elderly 65+ +2"]
        F6["πŸ’° Income Adj -1"]
        F7["πŸ—ΊοΈ Regional Β±1"]
    end
    subgraph Calc["πŸ”’ Calculation"]
        BS["πŸ“Š Base Score"]
        BT["βž• Boost Total"]
        FS["βœ… Final Score
Cap 0-100"] end subgraph Output["πŸ“€ Rankings"] RK["πŸ† State Rankings"] TR["πŸ“Š Tier Assignment"] end POP --> F2 RUR --> F2 CAH --> F3 UNI --> F4 MED --> F1 F1 --> BT F2 --> BT F3 --> BT F4 --> BT F5 --> BT F6 --> BT F7 --> BT BS --> FS BT --> FS FS --> RK RK --> TR

AI Call Script Generation

%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#C17852', 'primaryTextColor': '#F0F6FC', 'primaryBorderColor': '#4A5E32', 'lineColor': '#E6C98F', 'secondaryColor': '#161B22', 'tertiaryColor': '#0D1117', 'background': '#0D1117', 'mainBkg': '#161B22', 'nodeBorder': '#4A5E32', 'clusterBkg': '#161B22', 'clusterBorder': '#4A5E32', 'titleColor': '#E6C98F', 'edgeLabelBackground': '#161B22'}}}%%
flowchart LR
    subgraph Context["πŸ“‹ State Context"]
        AN["πŸ“Š Analysis"]
        EN["πŸ“ˆ Enrichment"]
        BS["πŸ† Boost Scores"]
        CT["πŸ‘€ Contacts"]
    end
    subgraph Prompt["πŸ“ Prompt Engineering"]
        SY["🎭 Sales Coach Prompt"]
        GR["πŸ“‹ RHT Grant Categories"]
        TM["πŸ‘₯ Team Roles"]
    end
    subgraph AI["πŸ€– Claude Sonnet 4"]
        CL["🧠 Generate Script"]
        JS["πŸ“„ JSON Output"]
    end
    subgraph Parse["πŸ”§ Parsing"]
        OP["πŸ“’ Opening"]
        TP["πŸ“‹ Talking Points"]
        OB["⚠️ Objections"]
        CL2["πŸ“ž Closing"]
    end
    subgraph Store["πŸ’Ύ Storage"]
        DB[("πŸ—„οΈ call_scripts")]
    end
    AN --> SY
    EN --> SY
    BS --> SY
    CT --> SY
    SY --> GR
    GR --> TM
    TM --> CL
    CL --> JS
    JS --> OP
    JS --> TP
    JS --> OB
    JS --> CL2
    OP --> DB
    TP --> DB
                

Feature Gap Analysis

%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#C17852', 'primaryTextColor': '#F0F6FC', 'primaryBorderColor': '#4A5E32', 'lineColor': '#E6C98F', 'secondaryColor': '#161B22', 'tertiaryColor': '#0D1117', 'background': '#0D1117', 'mainBkg': '#161B22', 'nodeBorder': '#4A5E32', 'clusterBkg': '#161B22', 'clusterBorder': '#4A5E32', 'titleColor': '#E6C98F', 'edgeLabelBackground': '#161B22'}}}%%
flowchart TB
    subgraph Input["πŸ“₯ Analysis Input"]
        ST["πŸ“Š State Analysis"]
        IN["πŸ“ Initiatives"]
        FT["πŸ”§ RHTP Features"]
    end
    subgraph AI["πŸ€– Gap Detection"]
        PR["πŸ“ Gap Prompt"]
        CL["🧠 Claude Sonnet 4"]
        JS["πŸ“„ JSON Gaps Array"]
    end
    subgraph Parse["πŸ”§ Gap Extraction"]
        TI["πŸ“‹ Gap Title"]
        DE["πŸ“ Description"]
        CA["πŸ“ Category"]
        IM["πŸ“Š Impact Score"]
    end
    subgraph Dedup["πŸ”„ Deduplication"]
        CH["πŸ” Title Match?"]
        AP["βž• Append State"]
        NW["πŸ†• New Gap"]
    end
    subgraph Store["πŸ’Ύ Storage"]
        DB[("πŸ—„οΈ proposal_idea_gaps")]
    end
    ST --> PR
    IN --> PR
    FT --> PR
    PR --> CL
    CL --> JS
    JS --> TI
    JS --> DE
    JS --> CA
    JS --> IM
    TI --> CH
    CH -->|"Yes"| AP
    CH -->|"No"| NW
    AP --> DB
    NW --> DB
                

Export & Dashboard Pipeline

%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#C17852', 'primaryTextColor': '#F0F6FC', 'primaryBorderColor': '#4A5E32', 'lineColor': '#E6C98F', 'secondaryColor': '#161B22', 'tertiaryColor': '#0D1117', 'background': '#0D1117', 'mainBkg': '#161B22', 'nodeBorder': '#4A5E32', 'clusterBkg': '#161B22', 'clusterBorder': '#4A5E32', 'titleColor': '#E6C98F', 'edgeLabelBackground': '#161B22'}}}%%
flowchart TB
    subgraph Data["πŸ’Ύ Data Sources"]
        AN["πŸ“Š Analyses"]
        EN["πŸ“ˆ Enrichment"]
        BS["πŸ† Boost Scores"]
        SC["πŸ“ž Call Scripts"]
        EM["βœ‰οΈ Cold Emails"]
    end
    subgraph API["πŸ”Œ Flask API"]
        EP["πŸ›€οΈ Endpoints"]
        AG["πŸ“₯ Aggregation"]
    end
    subgraph Export["πŸ“€ Export Formats"]
        CSV["πŸ“Š CRM CSV"]
        PDF["πŸ“„ Analysis PDF"]
        PB["πŸ“ Playbook PDF"]
        ZIP["πŸ“¦ Tier ZIP"]
    end
    subgraph Dashboard["πŸ–₯️ Web UI"]
        MAP["πŸ—ΊοΈ Interactive Map"]
        TT["πŸ’¬ Tooltips"]
        FLT["πŸ”§ Filters"]
    end
    AN --> AG
    EN --> AG
    BS --> AG
    SC --> AG
    EM --> AG
    AG --> EP
    EP --> CSV
    EP --> PDF
    EP --> PB
    EP --> ZIP
    EP --> MAP
    MAP --> TT
    MAP --> FLT