An AI-powered SaaS platform that autonomously discovers, analyzes, and reaches out to potential leads using advanced web scraping, NLP, and multi-agent AI systems.
Features β’ Tech Stack β’ Setup β’ Usage β’ API
LeadForge AI is a full-stack SaaS application that revolutionizes lead generation and outreach through autonomous AI agents. Built with Python Flask backend and React frontend, it leverages cutting-edge AI models (Google Gemini 1.5 Flash & Groq LLaMA-3) to intelligently discover, analyze, and engage with potential business leads.
- CSV/Excel Import: Bulk upload leads with comprehensive data fields
- Real-time Dashboard: Track KPIs, conversion rates, and lead status
- Lead Scoring: AI-driven trust and maturity analysis
- AI-Powered Search: DuckDuckGo integration for industry-specific lead discovery
- Web Scraping: Playwright-powered extraction of contact information
- JustDial Integration: Automated business directory scraping
- Autopilot Mode: Background scheduler processes leads automatically every 30 seconds
- Smart Decision Making: AI determines outreach priority based on trust scores
- Automatic Follow-ups: Manages communication sequences intelligently
- Thanglish Messages: Generates culturally-relevant Tamil+English hybrid communications
- Emotional Intelligence: Creates personalized, context-aware messaging
- SMTP Integration: Real email delivery with tracking
- Comprehensive Dashboard: Visual insights into lead pipeline
- Activity Logs: Complete audit trail of all AI actions
- Performance Metrics: Conversion tracking and success rates
- Framework: Flask 3.x
- Language: Python 3.8+
- Database: MySQL
- Web Scraping: Playwright, BeautifulSoup4
- Search: DuckDuckGo API
- Framework: React 18.x
- Build Tool: Vite
- Styling: Tailwind CSS
- HTTP Client: Axios
- Analysis: Google Gemini 1.5 Flash
- Text Generation: Groq (LLaMA-3)
- Multi-Agent System: Custom autonomous agents
Before you begin, ensure you have the following installed:
# Navigate to backend directory
cd ai_lead/backend
# Install Python dependencies
pip install -r requirements.txt
# Install Playwright browsers (required for web scraping)
python -m playwright installConfigure Environment Variables:
Create a .env file in the backend directory:
# Database Configuration
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=ai_lead_outreach
# AI API Keys
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
# SMTP Configuration (for email sending)
SMTP_EMAIL=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587Initialize Database:
# Start MySQL server (XAMPP/WAMP)
# Create database
mysql -u root -p
CREATE DATABASE ai_lead_outreach;
exit;
# Run the Flask application (tables will be created automatically)
python app.pyThe backend server will start on http://localhost:5000
# Navigate to frontend directory
cd ai_lead/frontend
# Install dependencies
npm install
# Start development server
npm run devThe frontend will be available at http://localhost:5173
- Navigate to Upload Leads
- Upload CSV/Excel with columns:
name,email,phone,company,location - Leads will be automatically ingested into the system
- Go to Find Leads β AI Discovery
- Enter Industry (e.g., "Software Companies")
- Enter Location (e.g., "Bangalore")
- AI agent will search the web and extract contacts automatically
- Go to Find Leads β Web Scraper
- Enter a specific URL (e.g., company contact page)
- Agent scrapes emails and phone numbers from the page
- Click individual leads in the dashboard
- View AI analysis and trust scores
- Send personalized messages with one click
- Toggle Autopilot Mode ON in dashboard
- System automatically:
- Analyzes new leads every 30 seconds
- Decides outreach priority based on trust scores
- Generates and sends Thanglish messages
- Logs all activities
- Dashboard: View KPIs, lead status distribution, recent activities
- Lead Details: Click any lead for AI analysis, trust scores, outreach history
- Activity Logs: Monitor all autonomous agent actions
ai_lead/
βββ backend/
β βββ app.py # Main Flask App + AI Agents
β βββ db.py # MySQL Database Connection
β βββ justdial_scraper.py # JustDial scraping logic
β βββ requirements.txt # Python dependencies
β βββ .env # API Keys & Configuration
β
βββ frontend/
β βββ src/
β β βββ pages/ # Landing, Upload, Dashboard, LeadDetail
β β βββ components/ # Navbar, StatCard, LeadsTable
β β βββ api.js # Axios setup
β β βββ App.jsx # React Router
β β βββ main.jsx # Entry point
β βββ package.json
β βββ tailwind.config.js
β
βββ sample_leads.csv # Sample data for testing
βββ README.md
POST /api/upload-leads # Upload CSV/Excel files
GET /api/leads # Get all leads
GET /api/leads/<id> # Get specific lead details
GET /api/dashboard-stats # Dashboard statisticsPOST /api/analyze/<id> # Run AI analysis on lead
POST /api/outreach/<id> # Generate & send outreach message
POST /api/search-leads # AI-powered lead discovery
POST /api/scrape-url # Scrape URL for contactsGET /api/settings # Get autopilot settings
POST /api/settings # Update autopilot settings| Agent | Responsibility |
|---|---|
| Lead Ingestion Agent | Parses CSV/Excel and stores in MySQL |
| Lead Discovery Agent | Searches web using DuckDuckGo API |
| Web Scraping Agent | Extracts contacts using Playwright |
| Business Analysis Agent | Analyzes company trustworthiness (Gemini AI) |
| Decision Agent | Determines outreach priority |
| Message Strategy Agent | Plans communication approach |
| Message Generation Agent | Creates Thanglish messages (Groq LLaMA-3) |
| Outreach Agent | Sends emails via SMTP |
| Response Analysis Agent | Analyzes incoming responses |
| Follow-up Agent | Manages follow-up sequences |
- β
Store all sensitive data in
.envfiles (never commit to Git) - β Enable Autopilot only when ready for production outreach
- β Monitor database logs for compliance
- β Use app-specific passwords for Gmail SMTP
- β Rate-limit API calls to prevent blocking
| Issue | Solution |
|---|---|
| ModuleNotFoundError | Ensure virtual environment: pip install -r requirements.txt |
| Playwright errors | Run: python -m playwright install |
| Database connection | Verify MySQL is running and credentials are correct |
| API key errors | Check .env file has valid Gemini and Groq keys |
| CORS errors | Ensure backend is running on port 5000 |
- WhatsApp integration for multi-channel outreach
- LinkedIn scraping for professional networking
- Advanced sentiment analysis for responses
- CRM integration (Salesforce, HubSpot)
- Multi-language support beyond Thanglish
- Advanced analytics and reporting dashboard
- A/B testing for message effectiveness
- Voice call integration
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or support, please open an issue or contact the maintainer.
Made with β€οΈ using AI-powered automation
β Star this repository if you find it helpful!