# sivram04/groundtruth-outreach architecture

> Architecture diagram of the GitHub repository sivram04/groundtruth-outreach, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sivram04/groundtruth-outreach
- Repository: https://github.com/sivram04/groundtruth-outreach

## Overview

Groundtruth Outreach turns imported leads into evidence-backed, human-approved outreach, then tracks outcomes and schedules follow-up. Its console supports review and operational workflows; the README also documents account isolation and Google connections. Workflow links below follow the documented product flow; source excerpts show the worker dispatching jobs and the review gate, but do not expose every backend integration.

Main entry points: [`outreach/send.py`](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/send.py) (Email sending), [`outreach/job_draft.py`](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/job_draft.py) (Email drafting), [`outreach/research.py`](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/research.py) (Company research), [`outreach/worker.py`](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/worker.py) (Scheduled job worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Operator console"]
  node_console_ui["Outreach console<br/>[App.tsx]"]
  node_console_api["Console API client<br/>[api.ts]"]
  node_console_backend["Console backend<br/>[console.py]"]
end

subgraph group_qualification["Lead qualification"]
  node_import["Lead import<br/>[importer.py]"]
  node_verify["Address verification<br/>[checks.py]"]
  node_research["Company research<br/>[research.py]"]
  node_profile["Company profiling<br/>[job_profile.py]"]
end

subgraph group_outreach["Drafting and engagement"]
  node_draft["Email drafting<br/>[job_draft.py]"]
  node_writer["Personalized writer<br/>[writer.py]"]
  node_review["Evidence review gate<br/>[review.py]"]
  node_send["Email sending<br/>[send.py]"]
  node_sequence["Follow-up sequence<br/>[followup.py]"]
  node_reply["Reply drafting<br/>[reply.py]"]
  node_postcall["Post-call drafting<br/>[post_call.py]"]
end

subgraph group_platform["Records and operations"]
  node_tracking["Event tracking<br/>[tracking.py]"]
  node_experiments["A/B experiments<br/>[experiments.py]"]
  node_sheet[("Lead and event record<br/>[sheet.py]")]
  node_suppression["Suppression checks<br/>[suppression.py]"]
  node_accounts["Tenant and Google access<br/>[google_connect.py]"]
  node_worker["Scheduled job worker<br/>[worker.py]"]
end

node_operator(("Outreach operator"))
node_gmail["Gmail"]
node_company_site["Company websites"]

node_operator -->|"operates"| node_console_ui
node_console_ui -.->|"requests console data"| node_console_backend
node_console_ui -->|"uses API client"| node_console_api
node_operator -->|"imports leads"| node_import
node_import -->|"checks addresses"| node_verify
node_verify -->|"passes eligible leads"| node_research
node_research -->|"reads pages"| node_company_site
node_research -->|"qualifies companies"| node_profile
node_profile -->|"supplies company facts"| node_draft
node_draft -->|"composes email"| node_writer
node_operator -->|"reviews evidence"| node_review
node_draft -->|"presents candidate"| node_review
node_review -->|"approves candidate"| node_send
node_send -->|"sends email"| node_gmail
node_send -->|"records send event"| node_tracking
node_tracking -->|"records events"| node_sheet
node_send -->|"starts follow-up"| node_sequence
node_sequence -->|"queues review"| node_operator
node_operator -->|"reviews reply draft"| node_reply
node_operator -->|"reviews call draft"| node_postcall
node_reply -->|"approved reply sent"| node_send
node_postcall -->|"approved follow-up sent"| node_send
node_operator -->|"reviews test results"| node_experiments
node_worker -->|"runs checks"| node_verify
node_worker -->|"runs research"| node_research
node_worker -->|"runs drafting"| node_draft
node_draft -->|"checks eligibility"| node_suppression
node_accounts -->|"scopes account data"| node_sheet

click node_console_ui "https://github.com/sivram04/groundtruth-outreach/blob/main/console/src/App.tsx"
click node_console_api "https://github.com/sivram04/groundtruth-outreach/blob/main/console/src/api.ts"
click node_console_backend "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/console.py"
click node_import "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/importer.py"
click node_verify "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/checks.py"
click node_research "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/research.py"
click node_profile "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/job_profile.py"
click node_draft "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/job_draft.py"
click node_writer "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/writer.py"
click node_review "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/review.py"
click node_send "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/send.py"
click node_sequence "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/followup.py"
click node_reply "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/reply.py"
click node_postcall "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/post_call.py"
click node_tracking "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/tracking.py"
click node_experiments "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/experiments.py"
click node_sheet "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/sheet.py"
click node_suppression "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/suppression.py"
click node_accounts "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/google_connect.py"
click node_worker "https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/worker.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_console_ui,node_console_api,node_console_backend toneBlue
class node_import,node_verify,node_research,node_profile toneAmber
class node_draft,node_writer,node_review,node_send,node_sequence,node_reply,node_postcall toneMint
class node_tracking,node_experiments,node_sheet,node_suppression,node_accounts,node_worker toneRose
class node_operator,node_gmail,node_company_site toneIndigo
```

## Components

### Operator console

- [Outreach console](https://github.com/sivram04/groundtruth-outreach/blob/main/console/src/App.tsx): `console/src/App.tsx`
- [Console API client](https://github.com/sivram04/groundtruth-outreach/blob/main/console/src/api.ts): `console/src/api.ts`
- [Console backend](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/console.py): `outreach/console.py`

### Lead qualification

- [Lead import](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/importer.py): `outreach/importer.py`
- [Address verification](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/checks.py): `outreach/checks.py`
- [Company research](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/research.py): `outreach/research.py`
- [Company profiling](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/job_profile.py): `outreach/job_profile.py`

### Drafting and engagement

- [Email drafting](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/job_draft.py): `outreach/job_draft.py`
- [Personalized writer](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/writer.py): `outreach/writer.py`
- [Evidence review gate](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/review.py): `outreach/review.py`
- [Email sending](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/send.py): `outreach/send.py`
- [Follow-up sequence](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/followup.py): `outreach/followup.py`
- [Reply drafting](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/reply.py): `outreach/reply.py`
- [Post-call drafting](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/post_call.py): `outreach/post_call.py`

### Records and operations

- [Event tracking](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/tracking.py): `outreach/tracking.py`
- [A/B experiments](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/experiments.py): `outreach/experiments.py`
- [Lead and event record](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/sheet.py): `outreach/sheet.py`
- [Suppression checks](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/suppression.py): `outreach/suppression.py`
- [Tenant and Google access](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/google_connect.py): `outreach/google_connect.py`
- [Scheduled job worker](https://github.com/sivram04/groundtruth-outreach/blob/main/outreach/worker.py): `outreach/worker.py`

### Other components

- **Outreach operator**
- **Gmail**
- **Company websites**

## Connections

- Outreach operator → Outreach console: operates (evidence: `README.md`)
- Outreach console → Console backend: requests console data
- Outreach console → Console API client: uses API client (evidence: `console/src/App.tsx`)
- Outreach operator → Lead import: imports leads (evidence: `README.md`)
- Lead import → Address verification: checks addresses (evidence: `README.md`)
- Address verification → Company research: passes eligible leads (evidence: `README.md`)
- Company research → Company websites: reads pages (evidence: `README.md`)
- Company research → Company profiling: qualifies companies (evidence: `README.md`)
- Company profiling → Email drafting: supplies company facts (evidence: `README.md`)
- Email drafting → Personalized writer: composes email (evidence: `README.md`)
- Outreach operator → Evidence review gate: reviews evidence (evidence: `README.md`)
- Email drafting → Evidence review gate: presents candidate (evidence: `README.md`)
- Evidence review gate → Email sending: approves candidate (evidence: `README.md`)
- Email sending → Gmail: sends email (evidence: `README.md`)
- Email sending → Event tracking: records send event (evidence: `README.md`)
- Event tracking → Lead and event record: records events (evidence: `README.md`)
- Email sending → Follow-up sequence: starts follow-up (evidence: `README.md`)
- Follow-up sequence → Outreach operator: queues review (evidence: `README.md`)
- Outreach operator → Reply drafting: reviews reply draft (evidence: `README.md`)
- Outreach operator → Post-call drafting: reviews call draft (evidence: `README.md`)
- Reply drafting → Email sending: approved reply sent (evidence: `README.md`)
- Post-call drafting → Email sending: approved follow-up sent (evidence: `README.md`)
- Outreach operator → A/B experiments: reviews test results (evidence: `README.md`)
- Scheduled job worker → Address verification: runs checks (evidence: `outreach/worker.py`)
- Scheduled job worker → Company research: runs research (evidence: `outreach/worker.py`)
- Scheduled job worker → Email drafting: runs drafting (evidence: `outreach/worker.py`)
- Email drafting → Suppression checks: checks eligibility (evidence: `outreach/job_draft.py`)
- Tenant and Google access → Lead and event record: scopes account data (evidence: `README.md`)
