Engineering problem
Fetching from many public sources is easy. Doing it reliably is not: sources are slow, rate-limited or malformed, the same company appears under different names, and the same story is syndicated twice. None of that should end up as duplicates, stale items or invented values.
Architecture
- Async crawl
- Extract
- Validate
- LLM structuring
- Entity resolution
- Store
- Export
Each domain (startups, products, papers, news and jobs) is a separate pipeline built from shared components: one HTTP client, a bounded concurrent runner, Pydantic schemas, a checkpoint store and an async SQLAlchemy repository.
Key decisions
- Entity resolution is deterministic: normalisation, then an alias table, then rapidfuzz
token_sort_ratio at a 97% threshold. Every mapping is logged with its method and confidence, and false merges found in real output (such as Lever vs Clever) are kept as regression tests.
- LLM extraction goes through one interface over a Gemini → Groq → DeepSeek chain. On a 413 it halves the payload and retries before moving to the next provider. With no provider configured, a deterministic keyword classifier takes over.
- News and jobs must fall inside a 24-hour window, and a missing or unparseable date is never treated as fresh.
Reliability & scale
- A pooled aiohttp client has a global concurrency cap (25) and a per-host cap (5), so one slow host can't starve the rest.
- Retries use exponential backoff with jitter and honour
Retry-After on 429 responses.
- Item-level checkpoints in WAL-mode SQLite let an interrupted run resume without re-fetching.
- De-duplication happens in three layers: source IDs, SHA-256 content hashes, and database unique constraints.
Testing
145 pytest cases cover date and freshness parsing, chunking, retry and backoff, de-duplication, entity-resolution false merges, SQLite round-trips, and a mocked end-to-end pipeline run. The LLM provider chain is tested against mocked 429 and 413 responses. The committed dataset was produced with the deterministic fallback, not live LLM calls.
What I built
The crawler and bounded runner, seven source extractors (arXiv, Hugging Face papers, YC directory, product pages, news RSS, job boards, GitHub stars), validation and freshness rules, LLM orchestration, entity resolution with a 2,453-row audit log, async storage, and the CSV, XLSX and Google Sheets exports.