# abhishek21112000/cams_b2b_agent architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek21112000/cams_b2b_agent
- Repository: https://github.com/abhishek21112000/cams_b2b_agent

## Overview

Covasant Partner Outreach Agent discovers potential partners, researches their websites, classifies them into partner tracks, and drafts personalized emails for human review; it does not send email. The main workflow is CLI-orchestrated, with candidate data and review status persisted between runs. README capabilities also include status reporting and draft export. The source excerpts and index support the principal module relationships; details of unsampled implementation are not inferred.

Main entry points: [`main.py`](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/main.py) (CLI commands), [`state.py`](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/state.py) (Candidate state), [`utils.py`](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/utils.py) (Shared helpers), [`searcher.py`](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/searcher.py) (Tavily discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["CLI orchestration"]
  node_cli["CLI commands<br/>[main.py]"]
  node_export["Draft export<br/>[main.py]"]
  node_export_file["Exported drafts"]
end

subgraph group_research["Candidate research"]
  node_search["Tavily discovery<br/>[searcher.py]"]
  node_enrich["Website enrichment<br/>[enricher.py]"]
end

subgraph group_outreach["Classification and outreach"]
  node_classify["Partner classification<br/>[classifier.py]"]
  node_draft["Email drafting<br/>[drafter.py]"]
  node_review["Draft review<br/>[reviewer.py]"]
end

subgraph group_support["Persistence and configuration"]
  node_state["Candidate state<br/>[state.py]"]
  node_state_file[("Persistent state")]
  node_helpers["Shared helpers<br/>[utils.py]"]
  node_config["Runtime settings<br/>[config.yaml]"]
end

node_operator(("Operator"))
node_tavily["Tavily Search"]
node_company_sites["Company websites"]
node_ollama_classify["Local LLM"]
node_ollama_draft["Local LLM"]

node_operator -->|"runs commands"| node_cli
node_cli -->|"starts discovery"| node_search
node_cli -->|"starts enrichment"| node_enrich
node_cli -->|"starts classification"| node_classify
node_cli -->|"starts drafting"| node_draft
node_cli -->|"starts review"| node_review
node_search -->|"queries"| node_tavily
node_enrich -->|"fetches pages"| node_company_sites
node_classify -->|"classifies ambiguities"| node_ollama_classify
node_draft -->|"generates emails"| node_ollama_draft
node_cli -->|"manages candidate state"| node_state
node_search -->|"checks and records candidates"| node_state
node_enrich -->|"updates enrichment"| node_state
node_classify -->|"updates classifications"| node_state
node_draft -->|"saves drafts"| node_state
node_review -->|"updates review status"| node_state
node_state -->|"reads and writes"| node_state_file
node_cli -->|"loads settings"| node_config
node_cli -->|"runs export"| node_export
node_export -->|"writes drafts"| node_export_file
node_search -->|"uses shared utilities"| node_helpers
node_enrich -->|"uses shared utilities"| node_helpers
node_classify -->|"uses shared utilities"| node_helpers
node_draft -->|"uses shared utilities"| node_helpers
node_review -->|"uses shared utilities"| node_helpers
node_state -->|"uses shared utilities"| node_helpers

click node_cli "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/main.py"
click node_search "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/searcher.py"
click node_enrich "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/enricher.py"
click node_classify "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/classifier.py"
click node_draft "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/drafter.py"
click node_review "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/reviewer.py"
click node_state "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/state.py"
click node_helpers "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/utils.py"
click node_config "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/config.yaml"
click node_export "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/main.py"
click node_export_file "https://github.com/abhishek21112000/cams_b2b_agent/blob/main/exported_drafts.txt"

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_cli,node_export,node_export_file toneBlue
class node_search,node_enrich toneAmber
class node_classify,node_draft,node_review toneMint
class node_state,node_state_file,node_helpers,node_config toneRose
class node_operator,node_tavily,node_company_sites,node_ollama_classify,node_ollama_draft toneIndigo
```

## Components

### CLI orchestration

- [CLI commands](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/main.py): `main.py`
- [Draft export](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/main.py): `main.py`
- [Exported drafts](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/exported_drafts.txt): `exported_drafts.txt`

### Candidate research

- [Tavily discovery](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/searcher.py): `searcher.py`
- [Website enrichment](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/enricher.py): `enricher.py`

### Classification and outreach

- [Partner classification](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/classifier.py): `classifier.py`
- [Email drafting](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/drafter.py): `drafter.py`
- [Draft review](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/reviewer.py): `reviewer.py`

### Persistence and configuration

- [Candidate state](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/state.py): `state.py`
- **Persistent state**
- [Shared helpers](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/utils.py): `utils.py`
- [Runtime settings](https://github.com/abhishek21112000/cams_b2b_agent/blob/main/config.yaml): `config.yaml`

### Other components

- **Operator**
- **Tavily Search**
- **Company websites**
- **Local LLM**
- **Local LLM**

## Connections

- Operator → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Tavily discovery: starts discovery (evidence: `README.md`)
- CLI commands → Website enrichment: starts enrichment (evidence: `README.md`)
- CLI commands → Partner classification: starts classification (evidence: `README.md`)
- CLI commands → Email drafting: starts drafting (evidence: `README.md`)
- CLI commands → Draft review: starts review (evidence: `main.py`)
- Tavily discovery → Tavily Search: queries (evidence: `README.md`)
- Website enrichment → Company websites: fetches pages (evidence: `enricher.py`)
- Partner classification → Local LLM: classifies ambiguities (evidence: `classifier.py`)
- Email drafting → Local LLM: generates emails (evidence: `drafter.py`)
- CLI commands → Candidate state: manages candidate state (evidence: `main.py`)
- Tavily discovery → Candidate state: checks and records candidates (evidence: `searcher.py`)
- Website enrichment → Candidate state: updates enrichment (evidence: `enricher.py`)
- Partner classification → Candidate state: updates classifications (evidence: `classifier.py`)
- Email drafting → Candidate state: saves drafts (evidence: `drafter.py`)
- Draft review → Candidate state: updates review status (evidence: `reviewer.py`)
- Candidate state → Persistent state: reads and writes (evidence: `state.py`)
- CLI commands → Runtime settings: loads settings (evidence: `README.md`)
- CLI commands → Draft export: runs export (evidence: `main.py`)
- Draft export → Exported drafts: writes drafts (evidence: `main.py`)
- Tavily discovery → Shared helpers: uses shared utilities (evidence: `searcher.py`)
- Website enrichment → Shared helpers: uses shared utilities (evidence: `enricher.py`)
- Partner classification → Shared helpers: uses shared utilities (evidence: `classifier.py`)
- Email drafting → Shared helpers: uses shared utilities (evidence: `drafter.py`)
- Draft review → Shared helpers: uses shared utilities (evidence: `reviewer.py`)
- Candidate state → Shared helpers: uses shared utilities (evidence: `state.py`)
