How We Built an Autonomous Lead Research Pipeline with AI Agents
After years of building sales and marketing tools, we kept hitting the same wall: human time is the bottleneck. Every lead that enters the funnel needs research. Company size, funding round, recent hires, tech stack, social presence. A sales rep spends 5-15 minutes per lead just on research.
So we built an AI agent pipeline that does it autonomously.
The Pipeline Architecture
Our system works in three stages:
1. Lead Ingestion
Leads come in via web form, CRM webhook, or CSV upload. A lightweight Python worker validates the data and enqueues a research job.
2. Autonomous Research Agent
The core of the pipeline. Given a company name and domain, the agent:
- Scrapes the company's about page, blog, and job listings
- Checks LinkedIn for employee count and recent hires
- Looks up funding data via public APIs
- Assesses tech stack from DNS records and job posts
- Generates a relevance score (1-10) and qualification summary
3. CRM Enrichment + Routing
Results are written back to the CRM with enriched fields. High-scoring leads are automatically routed to the appropriate sales rep via Slack.
What We Learned
The hardest part wasn't the AI — it was data quality. Dirty domain names, dead company websites, and outdated contact info cause cascading failures. We now validate aggressively at ingestion.
The second hardest part was rate limiting. Multiple concurrent research threads will hit 429s everywhere. We built exponential backoff with jitter and per-domain rate tracking.
The Stack
- Python 3.11 + FastAPI
- PostgreSQL with async SQLAlchemy
- Cloudflare Workers for the webhook endpoint
- LangChain for agent orchestration
- ScrapingBee for JavaScript-rendered pages
Results
After 90 days in production:
- 340+ leads processed automatically
- 89% enrichment rate (vs 12% manual)
- 4.2 hours/week saved per sales rep
- Average research time: 47 seconds per lead
The full source code for the research agent module is available on our GitHub.
Questions about implementing something similar? Reach out at info@netwit.ca
Top comments (0)