Autonomous B2B Lead Generation Engine for Agencies
LeadPilot is an AI-powered lead generation platform that automates prospecting, filtering, and personalized outreach for B2B sales teams. It identifies high-value leads with poor digital presence and generates hyper-personalized messages to maximize conversion rates.
- Google Maps: Scrapes businesses by city and category (e.g., "Dentists in London") via Apify.
- Instagram: Finds niche businesses via hashtag/keyword search (e.g., "home baker dubai").
- Email Finder: Built-in crawler visits business websites to extract contact emails.
- Smart Scoring: Filters out low-value prospects. Prioritizes businesses with high review counts but no website or poor social presence.
- Auto-Personalization: Reads customer reviews to generate "Human-like" outreach messages (e.g., "Saw your customers love the pastry but hate the wait times...").
- Configurable Models: Switch between Gemini models (e.g.,
gemini-2.0-flash,gemini-3-flash) via environment variables. - Target Builder + Niche Playbooks: Convert plain-English goals into scrape targets, or launch prebuilt vertical templates in one click.
- Batch Processing: Run scraping jobs for multiple cities and categories in one go.
- Daily Cron: Automated script (
run_daily.sh) for recurring lead generation. - API-First: Full FastAPI backend for integration.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, Tailwind CSS 4 |
| Backend API | FastAPI, Uvicorn |
| Core Logic | Python 3.11+, Pandas |
| AI Engine | Google Gemini (via google-genai) |
| Scraping | Apify Client, BeautifulSoup4 |
| Container | Docker |
- Node.js 18+
- Python 3.11+
- Apify Account (for scraping)
- Google AI Studio Key (for Gemini)
git clone https://github.com/Rishet11/LeadPilot.git
cd LeadPilot# Create and activate virtual env (Python 3.11+)
python3.11 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .envEdit .env with your keys:
APIFY_API_TOKENGEMINI_API_KEYGOOGLE_CLIENT_ID(for Google login)GEMINI_MODEL_NAME(optional, defaults togemini-2.0-flash)
cd frontend
npm install
# Configure environment
cp .env.example .env.local
# Required for Google login
# NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-idRun the pipeline directly from your terminal:
# Basic run
python main.py --city "London" --category "Gym" --limit 20
# Full power (AI + Email Finding)
python main.py --city "Austin" --category "Plumber" --agent --find-emailsTerminal 1 (Backend):
uvicorn api.main:app --reloadTerminal 2 (Worker):
python worker.pyTerminal 3 (Frontend):
cd frontend
npm run devAccess the dashboard at http://localhost:3000.
make devThis starts API, worker, and frontend together.
docker-compose up --buildThis now starts api, worker, and frontend.
LeadPilot/
├── api/ # FastAPI backend routers and logic
│ ├── routers/ # Endpoints for leads, scraping, jobs
│ └── main.py # App entry point
├── frontend/ # Next.js 16 Application
├── data/ # Generated CSVs and JSONs
├── logs/ # Runtime logs
├── scripts/ # Helper scripts (verification, tests)
├── main.py # CLI entry point
├── lead_agent.py # Gemini AI Logic
├── instagram_pipeline.py# Instagram specific logic
├── email_scraper.py # Website crawler
└── run_daily.sh # Automation script
Run the test suite to ensure everything is working:
pytest tests/To verify the Gemini model configuration specifically:
PYTHONPATH=. python3 scripts/verify_model_refactor.pyMIT License. Built by Rishet Mehra.