Skip to main content

System Requirements

Python

Python 3.7 or higher

Operating System

Linux, macOS, or Windows

Memory

Minimum 512MB RAM

Network

Internet connection for API calls

Step 1: Clone the Repository

Clone the Lead Intelligence Engine from GitHub:
git clone https://github.com/Fezi-x/Lead-Intelligence-Engine.git
cd Lead-Intelligence-Engine

Step 2: Create Virtual Environment

Always use a virtual environment to avoid dependency conflicts with your system Python packages.
# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate

# Verify activation (should show venv path)
which python

Step 3: Install Dependencies

Install all required Python packages:
pip install requests beautifulsoup4 python-dotenv groq python-telegram-bot
  • requests: HTTP library for fetching web pages
  • beautifulsoup4: HTML parsing and text extraction
  • python-dotenv: Environment variable management from .env files
  • groq: Official Groq SDK for LLM API access
  • python-telegram-bot: Telegram Bot API wrapper (optional if not using bot)

Verify Installation

Confirm all packages are installed:
pip list | grep -E "requests|beautifulsoup4|dotenv|groq|telegram"
Expected output:
beautifulsoup4           4.12.x
python-dotenv            1.0.x
python-telegram-bot      20.x
groq                     0.x.x
requests                 2.31.x

Step 4: Configure Environment Variables

Create a .env file in the project root directory:
.env
# Required: Groq AI API Key
GROQ_API_KEY=gsk_your_groq_api_key_here

# Required: Coda CRM Integration
CODA_API_TOKEN=your_coda_api_token
CODA_DOC_ID=your_coda_document_id
CODA_TABLE_ID=grid-your_table_id

# Optional: Telegram Bot (only if using bot interface)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token

# Optional: Facebook Integration (for analyzing Facebook pages)
# Either provide App ID + Secret, or just Access Token
FACEBOOK_APP_ID=your_facebook_app_id
FACEBOOK_APP_SECRET=your_facebook_app_secret
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token

Getting API Credentials

1

Groq API Key

  1. Visit console.groq.com
  2. Sign up or log in
  3. Navigate to API Keys section
  4. Click Create API Key
  5. Copy the key (starts with gsk_)
Free tier includes 7,000 RPD (requests per day) with llama-3.3-70b
2

Coda Credentials

  1. Go to coda.io/account
  2. Scroll to API Settings
  3. Click Generate API Token
  4. Copy the token
  5. Get your Doc ID and Table ID from the Coda URL

Coda Integration Guide

Detailed setup instructions for Coda CRM integration
3

Telegram Bot Token (Optional)

  1. Open Telegram and search for @BotFather
  2. Send /newbot command
  3. Follow prompts to name your bot
  4. Copy the bot token provided
Only needed if you want to use the Telegram bot interface

Step 5: Verify Installation

Run a test to ensure everything is configured correctly:
python -c "from core import LeadEngine; print('✓ Installation successful')"
If you see ✓ Installation successful, you’re ready to go!

Test with a Real URL

Try analyzing a test URL:
python main.py https://example.com
You should see output with business analysis, fit score, and either success or duplicate detection message.

Project Structure

After installation, your directory should look like this:
Lead-Intelligence-Engine/
├── .env                    # Your credentials (not in git)
├── .gitignore
├── README.md
├── core.py                 # Main orchestration engine
├── main.py                 # CLI entry point
├── telegram_bot.py         # Telegram bot interface
├── extractor.py            # Web scraping logic
├── rag.py                  # Knowledge retrieval
├── evaluator.py            # AI evaluation with Groq
├── coda_client.py          # CRM integration
├── facebook_client.py      # Facebook page extraction
├── knowledge/              # RAG corpus
│   ├── Lead_q_criteria.md
│   └── strategy_efficiency.md
├── prompts/
│   └── system_prompt.md    # LLM instructions
├── services/
│   └── services.json       # Service catalog
└── venv/                   # Virtual environment (not in git)

Optional: Telegram Bot Setup

If you want to use the Telegram bot interface:
1

Add Bot Token to .env

TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
2

Start the Bot

python telegram_bot.py
You should see:
Lead Intelligence Engine -- Application running...
3

Test in Telegram

  1. Open Telegram
  2. Search for your bot by username
  3. Send /start
  4. Try analyzing a URL

Telegram Bot Guide

Full guide on bot commands, rate limiting, and production deployment

Troubleshooting

Upgrade pip first:
python -m pip install --upgrade pip
Then retry the dependency installation.
If PowerShell blocks script execution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then retry activation.
Make sure:
  1. Virtual environment is activated (you should see (venv) in prompt)
  2. You installed dependencies in the correct venv
  3. You’re running Python from the venv path
Re-activate and verify:
source venv/bin/activate
which python
pip list
The .env file must be in the same directory as main.py. Check:
ls -la | grep .env
If missing, create it:
touch .env
nano .env  # or use any text editor
Common issues:
  • Key copied with extra spaces (trim whitespace)
  • Using wrong key format (must start with gsk_)
  • API key quota exceeded (check console.groq.com)
  • Missing .env file or wrong location
Test your key:
python -c "import os; from dotenv import load_dotenv; load_dotenv(); print(os.getenv('GROQ_API_KEY'))"

Next Steps

Quickstart Guide

Analyze your first business URL in 2 minutes

Configuration

Customize services, prompts, and knowledge base

CLI Usage

Learn batch processing and automation

Architecture

Understand how the system works

Build docs developers (and LLMs) love