A next-gen lead generation tool that uses Bright Data to scrape fresh B2B contact data, and OpenAI to qualify, enrich, and provide outreach strategies—all within a seamless Streamlit UI.
- 🕵️♂️ Automated Web Scraping: Instantly collect fresh leads from sources like LinkedIn via Bright Data’s scraping API.
- 📈 AI-Powered Qualification: Analyze, score, and enrich leads using OpenAI—no more manual guesswork or lost prospects.
- 💡 Natural Language Input: Just describe your ideal lead; the agent extracts structured filters and runs the full workflow.
- 🤝 Outreach Suggestions: Get ready-made, personalized tips for email or LinkedIn engagement, tailored per lead.
- 🖥 Interactive UI: Manage the pipeline and settings from a user-friendly Streamlit dashboard.
- Python 3.9+
- Bright Data Account (with API token)
- OpenAI API Key
- Streamlit installed
- Bright Data Datasets access
- (Optional) dotenv for easier API key management
-
Clone the repository
git clone <repository-url> cd ai-leadgen-agent
-
Create and activate a Python virtual environment
python -m venv venv # macOS/Linux: source venv/bin/activate # Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set API credentials
- Create a
.envfile:OPENAI_API_KEY=your_openai_api_key_here BRIGHT_DATA_API_KEY=your_bright_data_api_key_here
- Or, enter them directly in the Streamlit sidebar.
- Create a
-
Launch the application
streamlit run app.py
-
Open in your browser
- Visit
http://localhost:8501(auto-opens)
- Visit
-
Describe your lead
- Enter a natural language query like:
Find marketing managers in fintech companies in Kenya. - Click Generate Leads.
- Enter a natural language query like:
-
Review enriched results
- See fully scored, ranked, and enriched leads.
- Each lead features an AI summary, relevance score, and outreach tip.
- Natural Language Query: Just type your requirements (role, industry, location, etc.).
- Filter Extraction: System uses OpenAI to parse and transform your query into APIs filters.
- Lead Data Collection: Bright Data’s API triggers a targeted scrape (e.g., LinkedIn Jobs or Profiles).
- AI Enrichment: Each lead is sent to OpenAI for analysis: scoring, summarizing, and suggesting best engagement channels.
- Interactive Exploration: All results are shown in Streamlit with user-friendly cards and visualizations.
- AI-Scored Leads: Immediate ranking and insights—no spreadsheets needed!
- Relevance & Outreach Tips: For every lead, see why it’s a match and how to engage.
- Customizable Workflow: Adjust number of leads, enrichment depth, or tweak the prompt for your ICP.
- Debug Mode: Trace each decision and API call for full transparency.
Keep your API keys secure:
OPENAI_API_KEY=your_openai_api_key_here
BRIGHT_DATA_API_KEY=your_bright_data_api_key_here- Bright Data API Key: Paste key (or .env)
- OpenAI API Key: Paste key (or .env)
- Model Selector: e.g., GPT-3.5, GPT-4O, etc.
- Max Leads: Set number of leads to fetch (default: 10)
-
No Leads Found
- Check API keys and dataset access
- Relax your search filters (role, location, etc.)
- Debug mode gives detailed errors
-
Enrichment Fails
- Make sure your OpenAI API Key is valid and not rate limited
- Review API and network connectivity
-
Bright Data Errors
- Ensure your token has correct permissions
- Review Bright Data documentation
This project is for educational and internal demo purposes.
Ready to supercharge your sales prospecting? Spin up your own AI-Powered Lead Generation Agent and turn manual lead searches into instant, qualified opportunities!
Made with ❤️ using Bright Data & OpenAI