Skip to main content

Prerequisites

Before you start, make sure you have:
1

Python 3.7+

Check your version:
python --version
2

Groq API Key

Sign up at console.groq.com and create an API key.
3

Coda Credentials

You’ll need a Coda API token, document ID, and table ID. See Coda Integration for setup.
If you don’t have Coda credentials yet, you can still test extraction and evaluation - the engine will skip CRM insertion gracefully.

Installation

Clone the repository and install dependencies:
git clone https://github.com/Fezi-x/Lead-Intelligence-Engine.git
cd Lead-Intelligence-Engine

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install requests beautifulsoup4 python-dotenv groq python-telegram-bot

Configuration

Create a .env file in the project root:
.env
GROQ_API_KEY=your_groq_api_key_here
CODA_API_TOKEN=your_coda_token
CODA_DOC_ID=your_doc_id
CODA_TABLE_ID=your_table_id
TELEGRAM_BOT_TOKEN=your_telegram_token  # Optional - only if using bot
Start with just GROQ_API_KEY to test the extraction and evaluation components. Add Coda credentials when you’re ready to sync leads.

Analyze Your First URL

Run the CLI with any business website:
python main.py https://example-business.com

Expected Output

The engine will display:
Analyzing https://example-business.com...

--- Evaluation Result ---
{
  "business_name": "Example Dental Clinic",
  "business_type": "Dental Healthcare Provider",
  "primary_service": "Foundation Package",
  "secondary_service": "Basic Marketing Package",
  "fit_score": 85,
  "reasoning": "Small clinic with Facebook-only presence. No website detected. High fit for Foundation Package.",
  "outreach_angle": "Platform dependency risk - current growth relies on rented Facebook platform. Consider owned digital asset."
}
------------------------

SUCCESS: ADDED TO CRM: 'Example Dental Clinic' (https://example-business.com)
Latency: 8.32s
Usage: 3247 tokens (P: 2891, C: 356)

Understanding the Output

The evaluation result contains:
business_name
string
Extracted official name of the business from website content.
business_type
string
What the business actually does (e.g., “Dental Healthcare Provider”, “E-commerce Fashion Store”).
primary_service
string
Best-fit service from your catalog. Must match a service name in services/services.json.
secondary_service
string | null
Optional second service for upsell or complementary offering.
fit_score
integer
Confidence score from 0-100 indicating how well the service matches the business needs.
reasoning
string
1-2 sentence explanation of why this service was selected.
outreach_angle
string
Strategic entry point for sales conversation based on detected structural gaps.

Metadata Fields

These fields (prefixed with _) provide execution context:
  • _status: success or skipped
  • _message: Reason for skipping (if applicable)
  • _latency: Total processing time
  • _usage: Token consumption breakdown

Try the Telegram Bot

For interactive analysis, start the Telegram bot:
python telegram_bot.py
Then in Telegram:
  1. Find your bot by username
  2. Send /start to see available commands
  3. Send any business URL or use /analyze <url>
The bot provides the same analysis with a conversational interface.

Telegram Bot Guide

Learn about bot commands, rate limiting, and deployment options.

Next Steps

CLI Usage

Batch processing, shell scripts, and automation patterns.

Configuration

Customize services, knowledge base, and system prompts.

Architecture

Understand how the pipeline components work together.

API Reference

Integrate the engine programmatically in your Python code.

Troubleshooting

Make sure you activated the virtual environment and installed dependencies:
source venv/bin/activate  # or .\venv\Scripts\activate on Windows
pip install groq
Check that your .env file exists in the project root and contains:
GROQ_API_KEY=your_actual_key_here
Some websites block scrapers or use heavy JavaScript. The engine automatically tries Jina fallback, but some sites may still fail. Try analyzing a different URL.
Your CODA_API_TOKEN is invalid or expired. Generate a new token from coda.io/account.

Build docs developers (and LLMs) love