Skip to content

brightdata/ai-lead-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bright Data Logo

AI-Powered Lead Generation Agent

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.


Features

  • 🕵️‍♂️ 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.

Prerequisites


Installation

  1. Clone the repository

    git clone <repository-url>
    cd ai-leadgen-agent
  2. Create and activate a Python virtual environment

    python -m venv venv
    # macOS/Linux: source venv/bin/activate
    # Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Set API credentials

    • Create a .env file:
      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.

Usage

  1. Launch the application

    streamlit run app.py
  2. Open in your browser

    • Visit http://localhost:8501 (auto-opens)
  3. Describe your lead

    • Enter a natural language query like:
      Find marketing managers in fintech companies in Kenya.
    • Click Generate Leads.
  4. Review enriched results

    • See fully scored, ranked, and enriched leads.
    • Each lead features an AI summary, relevance score, and outreach tip.

How It Works

  1. Natural Language Query: Just type your requirements (role, industry, location, etc.).
  2. Filter Extraction: System uses OpenAI to parse and transform your query into APIs filters.
  3. Lead Data Collection: Bright Data’s API triggers a targeted scrape (e.g., LinkedIn Jobs or Profiles).
  4. AI Enrichment: Each lead is sent to OpenAI for analysis: scoring, summarizing, and suggesting best engagement channels.
  5. Interactive Exploration: All results are shown in Streamlit with user-friendly cards and visualizations.

Output Features

  • 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.

Configuration

.env file

Keep your API keys secure:

OPENAI_API_KEY=your_openai_api_key_here
BRIGHT_DATA_API_KEY=your_bright_data_api_key_here

Sidebar Settings

  • 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)

Troubleshooting

  • 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


License

This project is for educational and internal demo purposes.


Learn More


Ready to supercharge your sales prospecting? Spin up your own AI-Powered Lead Generation Agent and turn manual lead searches into instant, qualified opportunities!

Get Started


Made with ❤️ using Bright Data & OpenAI

About

AI-powered agent that scrapes leads with Bright Data, qualifies them using OpenAI, and delivers outreach-ready results via an easy Streamlit UI.

Topics

Resources

Stars

Watchers

Forks

Languages