# amp2byte/crawl4ai architecture

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

- Interactive diagram: https://gitdiagram.com/amp2byte/crawl4ai
- Repository: https://github.com/amp2byte/crawl4ai

## Overview

Crawl4AI is a web-crawling and extraction product that turns pages into Markdown or structured data, with a self-hosted Python library and Docker server plus a documented hosted service. The principal library workflow starts with a crawl request, uses browser/crawl strategies to obtain page content, then applies scraping, Markdown, or structured extraction and returns a CrawlResult. Deep/adaptive crawling, URL discovery, and server APIs are additional product branches. Several runtime modules were not sampled, so uncertain internal links are omitted or marked unverified.

Main entry points: [`deploy/docker/server.py`](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/server.py) (Docker API server), [`crawl4ai/async_webcrawler.py`](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_webcrawler.py) (Async crawler), [`deploy/docker/monitor.py`](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/monitor.py) (Server monitoring), [`crawl4ai/browser_manager.py`](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_manager.py) (Browser manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crawl["Crawling and discovery"]
  node_crawler["Async crawler"]
  node_configs["Crawl configuration<br/>[async_configs.py]"]
  node_deep["Deep crawling"]
  node_adaptive["Adaptive crawling"]
  node_url_discovery["URL discovery"]
  node_domain_map["Domain mapping<br/>[domain_mapper.py]"]
end

subgraph group_browser["Browser runtime"]
  node_browser_manager["Browser manager<br/>[browser_manager.py]"]
  node_browser_adapter["Browser adapters<br/>[browser_adapter.py]"]
  node_browser_profile["Browser profiling"]
  node_proxy["Proxy strategies<br/>[proxy_strategy.py]"]
end

subgraph group_content["Content processing"]
  node_results["Crawl results<br/>[models.py]"]
  node_scraping["Content scraping"]
  node_markdown["Markdown generation"]
  node_extraction["Structured extraction"]
  node_filtering["Content filtering"]
  node_chunking["Content chunking"]
  node_table_extract["Table extraction"]
end

subgraph group_server["Server and operations"]
  node_server["Docker API server<br/>[server.py]"]
  node_api["API handlers<br/>[api.py]"]
  node_pool["Crawler pool<br/>[crawler_pool.py]"]
  node_egress["Egress broker<br/>[egress_broker.py]"]
  node_monitor["Server monitoring<br/>[monitor.py]"]
  node_monitor_routes["Monitor routes<br/>[monitor_routes.py]"]
end

node_developer(("Developer or agent"))
node_cloud["Hosted Crawl4AI"]
node_website(("Web pages"))

node_developer -->|"requests crawl"| node_crawler
node_crawler -.->|"fetches pages"| node_website
node_crawler -.->|"returns results"| node_results
node_crawler -.->|"uses settings"| node_configs
node_developer -->|"chooses crawl strategy"| node_deep
node_developer -->|"starts adaptive crawl"| node_adaptive
node_developer -->|"discovers URLs"| node_url_discovery
node_developer -->|"maps domains"| node_domain_map
node_developer -->|"selects Markdown output"| node_markdown
node_developer -->|"selects JSON output"| node_extraction
node_developer -->|"filters content"| node_filtering
node_developer -->|"chunks content"| node_chunking
node_developer -->|"extracts tables"| node_table_extract
node_browser_manager -->|"uses adapters"| node_browser_adapter
node_browser_manager -->|"profiles browser"| node_browser_profile
node_scraping -.->|"produces Markdown"| node_markdown
node_developer -->|"sends API request"| node_server
node_server -->|"routes API calls"| node_api
node_server -->|"uses browser pool"| node_pool
node_server -->|"configures egress"| node_egress
node_server -->|"exposes monitoring"| node_monitor
node_monitor_routes -->|"reads monitor data"| node_monitor
node_pool -->|"reports pool activity"| node_monitor
node_cloud -->|"serves hosted APIs"| node_developer

click node_crawler "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_webcrawler.py"
click node_configs "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_configs.py"
click node_deep "https://github.com/amp2byte/crawl4ai/tree/main/crawl4ai/deep_crawling"
click node_adaptive "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/adaptive_crawler.py"
click node_url_discovery "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_url_seeder.py"
click node_domain_map "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/domain_mapper.py"
click node_browser_manager "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_manager.py"
click node_browser_adapter "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_adapter.py"
click node_browser_profile "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_profiler.py"
click node_proxy "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/proxy_strategy.py"
click node_results "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/models.py"
click node_scraping "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/content_scraping_strategy.py"
click node_markdown "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/markdown_generation_strategy.py"
click node_extraction "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/extraction_strategy.py"
click node_filtering "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/content_filter_strategy.py"
click node_chunking "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/chunking_strategy.py"
click node_table_extract "https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/table_extraction.py"
click node_server "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/server.py"
click node_api "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/api.py"
click node_pool "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/crawler_pool.py"
click node_egress "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/egress_broker.py"
click node_monitor "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/monitor.py"
click node_monitor_routes "https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/monitor_routes.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_crawler,node_configs,node_deep,node_adaptive,node_url_discovery,node_domain_map toneBlue
class node_browser_manager,node_browser_adapter,node_browser_profile,node_proxy toneAmber
class node_results,node_scraping,node_markdown,node_extraction,node_filtering,node_chunking,node_table_extract toneMint
class node_server,node_api,node_pool,node_egress,node_monitor,node_monitor_routes toneRose
class node_developer,node_cloud,node_website toneIndigo
```

## Components

### Crawling and discovery

- [Async crawler](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_webcrawler.py): `crawl4ai/async_webcrawler.py`
- [Crawl configuration](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_configs.py): `crawl4ai/async_configs.py`
- [Deep crawling](https://github.com/amp2byte/crawl4ai/tree/main/crawl4ai/deep_crawling): `crawl4ai/deep_crawling`
- [Adaptive crawling](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/adaptive_crawler.py): `crawl4ai/adaptive_crawler.py`
- [URL discovery](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/async_url_seeder.py): `crawl4ai/async_url_seeder.py`
- [Domain mapping](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/domain_mapper.py): `crawl4ai/domain_mapper.py`

### Browser runtime

- [Browser manager](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_manager.py): `crawl4ai/browser_manager.py`
- [Browser adapters](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_adapter.py): `crawl4ai/browser_adapter.py`
- [Browser profiling](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/browser_profiler.py): `crawl4ai/browser_profiler.py`
- [Proxy strategies](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/proxy_strategy.py): `crawl4ai/proxy_strategy.py`

### Content processing

- [Crawl results](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/models.py): `crawl4ai/models.py`
- [Content scraping](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/content_scraping_strategy.py): `crawl4ai/content_scraping_strategy.py`
- [Markdown generation](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/markdown_generation_strategy.py): `crawl4ai/markdown_generation_strategy.py`
- [Structured extraction](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/extraction_strategy.py): `crawl4ai/extraction_strategy.py`
- [Content filtering](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/content_filter_strategy.py): `crawl4ai/content_filter_strategy.py`
- [Content chunking](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/chunking_strategy.py): `crawl4ai/chunking_strategy.py`
- [Table extraction](https://github.com/amp2byte/crawl4ai/blob/main/crawl4ai/table_extraction.py): `crawl4ai/table_extraction.py`

### Server and operations

- [Docker API server](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/server.py): `deploy/docker/server.py`
- [API handlers](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/api.py): `deploy/docker/api.py`
- [Crawler pool](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/crawler_pool.py): `deploy/docker/crawler_pool.py`
- [Egress broker](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/egress_broker.py): `deploy/docker/egress_broker.py`
- [Server monitoring](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/monitor.py): `deploy/docker/monitor.py`
- [Monitor routes](https://github.com/amp2byte/crawl4ai/blob/main/deploy/docker/monitor_routes.py): `deploy/docker/monitor_routes.py`

### Other components

- **Developer or agent**
- **Hosted Crawl4AI**
- **Web pages**

## Connections

- Developer or agent → Async crawler: requests crawl
- Async crawler → Web pages: fetches pages
- Async crawler → Crawl results: returns results
- Async crawler → Crawl configuration: uses settings
- Developer or agent → Deep crawling: chooses crawl strategy
- Developer or agent → Adaptive crawling: starts adaptive crawl
- Developer or agent → URL discovery: discovers URLs
- Developer or agent → Domain mapping: maps domains
- Developer or agent → Markdown generation: selects Markdown output
- Developer or agent → Structured extraction: selects JSON output
- Developer or agent → Content filtering: filters content
- Developer or agent → Content chunking: chunks content
- Developer or agent → Table extraction: extracts tables
- Browser manager → Browser adapters: uses adapters (evidence: `crawl4ai/browser_manager.py`)
- Browser manager → Browser profiling: profiles browser (evidence: `crawl4ai/browser_manager.py`)
- Content scraping → Markdown generation: produces Markdown
- Developer or agent → Docker API server: sends API request
- Docker API server → API handlers: routes API calls (evidence: `deploy/docker/server.py`)
- Docker API server → Crawler pool: uses browser pool (evidence: `deploy/docker/server.py`)
- Docker API server → Egress broker: configures egress (evidence: `deploy/docker/server.py`)
- Docker API server → Server monitoring: exposes monitoring (evidence: `deploy/docker/server.py`)
- Monitor routes → Server monitoring: reads monitor data (evidence: `deploy/docker/monitor_routes.py`)
- Crawler pool → Server monitoring: reports pool activity (evidence: `deploy/docker/crawler_pool.py`)
- Hosted Crawl4AI → Developer or agent: serves hosted APIs
