| name | firecrawl-reference-architecture |
| description | Implement Firecrawl reference architecture with scrape/crawl/map/extract pipelines.
Use when designing new Firecrawl integrations, reviewing project structure,
or building content ingestion pipelines for AI/RAG applications.
Trigger with phrases like "firecrawl architecture", "firecrawl project structure",
"firecrawl pipeline", "firecrawl RAG", "firecrawl knowledge base".
|
| allowed-tools | Read, Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","firecrawl","firecrawl-reference"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Firecrawl Reference Architecture
Overview
Production architecture for web scraping and content ingestion with Firecrawl. Covers three tiers: on-demand scraping, scheduled crawl pipelines, and real-time RAG ingestion. Uses all four Firecrawl endpoints: scrape, crawl, map, and extract.
Architecture Diagram
┌─────────────────────────────────────────────────────────┐
│ Firecrawl Pipeline │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────┐ ┌───────────┐ │
│ │ scrapeUrl│ │ crawlUrl │ │mapUrl│ │ extract │ │
│ │ (1 page) │ │ (N pages)│ │(URLs)│ │ (LLM+JSON)│ │
│ └────┬─────┘ └────┬─────┘ └──┬───┘ └─────┬─────┘ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Content Processing Layer │ │
│ │ Clean MD │ Validate │ Deduplicate │ Chunk │ │
│ └─────────────────────┬─────────────────────────────┘ │
│ │ │
│ ┌─────────────────────┴─────────────────────────────┐ │
│ │ Storage & Output │ │
│ │ Files │ Database │ Vector Store │ Search Index │ │
│ └───────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
Instructions
Step 1: Firecrawl Service Layer
import FirecrawlApp from "@mendable/firecrawl-js";
const firecrawl = new FirecrawlApp({
apiKey: process.env.FIRECRAWL_API_KEY!,
});
export async function scrapePage(url: string) {
return firecrawl.scrapeUrl(url, {
formats: ["markdown"],
onlyMainContent: ,
: ,
});
}
() {
firecrawl.(baseUrl, {
: opts?. || ,
: ,
: opts?.,
: opts?. || [, ],
: { : [], : },
});
}
() {
map = firecrawl.(baseUrl);
map. || [];
}
() {
firecrawl.(url, {
: [],
: { schema },
});
}