# atomslight/multi-agent-lead-generation architecture

> Architecture diagram of the GitHub repository atomslight/multi-agent-lead-generation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atomslight/multi-agent-lead-generation
- Repository: https://github.com/atomslight/multi-agent-lead-generation

## Overview

Lead-Apify is a pair of AI-assisted research workflows that turn an ICP or research prompt into a structured report. The Apify workflow identifies lead sources, searches the actor store, runs a selected scraper, and summarizes its data. The browser workflow searches with SearXNG, visits and reads selected pages through Playwright MCP, and summarizes them. CrewAI agents and tasks coordinate both paths; the browser script also filters and constrains browser tools. Relationships not visible in excerpts are included only where the README documents them.

Main entry points: [`playwright_automation.py`](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py) (Browser crew), [`apify.py`](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py) (Actor discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apify["Apify lead research"]
  node_icp["ICP analysis<br/>[apify.py]"]
  node_actor_search["Actor discovery<br/>[apify.py]"]
  node_actor_rank["Actor selection<br/>[apify.py]"]
  node_actor_run["Scraper execution<br/>[apify.py]"]
  node_lead_report["Lead report<br/>[apify.py]"]
end

subgraph group_browser["Browser research"]
  node_url_search["URL search task"]
  node_searx_tool["SearXNG search tool"]
  node_page_read["Page reading task"]
  node_browser_tools["Browser tool adapter"]
  node_tool_guards["Tool constraints"]
  node_page_summaries["Page summaries"]
end

subgraph group_coordination["Agent coordination"]
  node_crew["CrewAI orchestration<br/>[apify.py]"]
  node_browser_crew["Browser crew"]
end

subgraph group_integrations["External services"]
  node_llm["LLM service"]
  node_apify_store["Apify Store API"]
  node_apify_cloud["Apify run and dataset API"]
  node_searx_service["SearXNG service"]
  node_mcp_service["Playwright MCP server"]
end

node_user(("Research requester"))
node_report_reader(("Report recipient"))

node_user -->|"provides ICP"| node_crew
node_crew -->|"assigns research"| node_icp
node_icp -->|"identifies sources"| node_actor_search
node_actor_search -->|"searches actors"| node_apify_store
node_actor_search -->|"returns candidates"| node_actor_rank
node_actor_rank -->|"selects actor"| node_actor_run
node_actor_run -->|"runs and fetches"| node_apify_cloud
node_actor_run -->|"returns data"| node_lead_report
node_crew -->|"uses model"| node_llm
node_lead_report -->|"presents report"| node_report_reader
node_user -->|"provides prompt"| node_browser_crew
node_browser_crew -->|"starts search"| node_url_search
node_url_search -->|"queries with"| node_searx_tool
node_searx_tool -->|"requests results"| node_searx_service
node_url_search -->|"passes URLs"| node_page_read
node_page_read -->|"navigates and reads"| node_browser_tools
node_browser_crew -->|"loads tools"| node_browser_tools
node_browser_tools -->|"filters and constrains"| node_tool_guards
node_browser_tools -->|"controls browser"| node_mcp_service
node_browser_crew -->|"uses model"| node_llm
node_page_read -->|"produces summaries"| node_page_summaries
node_page_summaries -->|"presents report"| node_report_reader

click node_icp "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_actor_search "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_actor_rank "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_actor_run "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_lead_report "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_url_search "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_searx_tool "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_page_read "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_browser_tools "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_tool_guards "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_page_summaries "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py"
click node_crew "https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py"
click node_browser_crew "https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.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_icp,node_actor_search,node_actor_rank,node_actor_run,node_lead_report toneBlue
class node_url_search,node_searx_tool,node_page_read,node_browser_tools,node_tool_guards,node_page_summaries toneAmber
class node_crew,node_browser_crew,node_user toneMint
class node_llm,node_apify_store,node_apify_cloud,node_searx_service,node_mcp_service toneRose
class node_report_reader toneIndigo
```

## Components

### Apify lead research

- [ICP analysis](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`
- [Actor discovery](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`
- [Actor selection](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`
- [Scraper execution](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`
- [Lead report](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`

### Browser research

- [URL search task](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`
- [SearXNG search tool](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`
- [Page reading task](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`
- [Browser tool adapter](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`
- [Tool constraints](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`
- [Page summaries](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`

### Agent coordination

- [CrewAI orchestration](https://github.com/atomslight/multi-agent-lead-generation/blob/main/apify.py): `apify.py`
- [Browser crew](https://github.com/atomslight/multi-agent-lead-generation/blob/main/playwright_automation.py): `playwright_automation.py`

### External services

- **LLM service**
- **Apify Store API**
- **Apify run and dataset API**
- **SearXNG service**
- **Playwright MCP server**

### Other components

- **Research requester**
- **Report recipient**

## Connections

- Research requester → CrewAI orchestration: provides ICP (evidence: `README.md`)
- CrewAI orchestration → ICP analysis: assigns research (evidence: `apify.py`)
- ICP analysis → Actor discovery: identifies sources (evidence: `apify.py`)
- Actor discovery → Apify Store API: searches actors (evidence: `apify.py`)
- Actor discovery → Actor selection: returns candidates (evidence: `apify.py`)
- Actor selection → Scraper execution: selects actor (evidence: `apify.py`)
- Scraper execution → Apify run and dataset API: runs and fetches (evidence: `apify.py`)
- Scraper execution → Lead report: returns data (evidence: `apify.py`)
- CrewAI orchestration → LLM service: uses model (evidence: `apify.py`)
- Lead report → Report recipient: presents report (evidence: `README.md`)
- Research requester → Browser crew: provides prompt (evidence: `README.md`)
- Browser crew → URL search task: starts search (evidence: `playwright_automation.py`)
- URL search task → SearXNG search tool: queries with (evidence: `playwright_automation.py`)
- SearXNG search tool → SearXNG service: requests results (evidence: `playwright_automation.py`)
- URL search task → Page reading task: passes URLs (evidence: `README.md`)
- Page reading task → Browser tool adapter: navigates and reads (evidence: `README.md`)
- Browser crew → Browser tool adapter: loads tools (evidence: `playwright_automation.py`)
- Browser tool adapter → Tool constraints: filters and constrains (evidence: `playwright_automation.py`)
- Browser tool adapter → Playwright MCP server: controls browser (evidence: `README.md`)
- Browser crew → LLM service: uses model (evidence: `playwright_automation.py`)
- Page reading task → Page summaries: produces summaries (evidence: `README.md`)
- Page summaries → Report recipient: presents report (evidence: `README.md`)
