Spaces:
Running
Running
| title: Clienttarget | |
| emoji: π€ | |
| colorFrom: blue | |
| colorTo: indigo | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # π€ AI Client Acquisition System | |
| > Enterprise-grade, hyper-intelligent lead discovery, profiling, and scoring pipeline. | |
| > Built with production AI engineering practices β not n8n-style hype. | |
| []() | |
| []() | |
| []() | |
| []() | |
| --- | |
| ## What This System Does | |
| Automatically discovers, qualifies, and profiles potential clients for an AI automation agency. | |
| ``` | |
| Every day at 9 AM PKT: | |
| 1. Pick next territory (city Γ industry) β 27 cities, auto-rotation | |
| 2. Search Google for companies β Serper API | |
| 3. Scrape each website β Playwright (headless) | |
| 4. Detect pain signals β "no chatbot", "phone booking only", etc. | |
| 5. Gate 2: Skip if < 2 pain signals | |
| 6. Find decision-maker emails β Hunter.io + Pattern Generation + SMTP | |
| 7. Verify emails β 7-layer verification (FREE) | |
| 8. Find personal LinkedIn + social profiles | |
| 9. AI profiling β MiniMax M2.7 (chain-of-thought reasoning) | |
| 10. Deterministic scoring β 100-point scale, zero hallucination | |
| 11. Alert on Slack β hot leads (85+) instant, daily digest for all | |
| ``` | |
| ## Architecture | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β CRON: daily-lead-discovery (4 AM UTC = 9 AM PKT) β | |
| β β Territory Manager β Google Search β Queue β | |
| ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ | |
| β | |
| βΌ (max 3 concurrent) | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β TASK: process-company β | |
| β β Scrape β Pain Signals β Gate 2 β | |
| ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ | |
| β | |
| βΌ | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β TASK: enrich-and-profile β | |
| β β Hunter β Pattern Gen β SMTP β LinkedIn β | |
| β β Python AI Service β Save β Slack Alert β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| ## Model Chain (All FREE on NVIDIA NIM) | |
| | Priority | Model | Parameters | Use Case | | |
| |----------|-------|-----------|----------| | |
| | 1st | MiniMax M2.7 | ~100B+ | Profiling, scoring, complex reasoning | | |
| | 2nd | LLaMA 3.3 70B | 70B | Reliable fallback | | |
| | 3rd | LLaMA 3.1 8B | 8B | Email classification, simple tasks | | |
| | 4th | Deterministic | β | Zero hallucination fallback | | |
| **Single API key. Single endpoint. $0/day.** | |
| ## Scoring System (100 points, fully deterministic) | |
| ``` | |
| Company Fit: 25 pts (industry + size match) | |
| AI Readiness: 20 pts (tech stack + AI jobs) | |
| Service Match: 20 pts (pain signals β our services) | |
| Decision Maker: 20 pts (verified email + LinkedIn + authority) | |
| Timing: 15 pts (growth signals + active website) | |
| Tiers: hot (85+) | warm (70-84) | nurture (50-69) | archive (<50) | |
| ``` | |
| ## Tech Stack | |
| | Layer | Technology | Purpose | | |
| |-------|-----------|---------| | |
| | Orchestration | Trigger.dev | CRON, task chaining, retry, queuing | | |
| | Database | Supabase (PostgreSQL) | Data storage, config, state | | |
| | LLM | NVIDIA NIM (MiniMax + LLaMA) | AI profiling & analysis | | |
| | Web Scraping | Playwright | Headless browser | | |
| | Email | Hunter.io + SMTP | Finding & verification | | |
| | Notifications | Slack Bot | Alerts, commands, digest | | |
| | AI Service | Python FastAPI | Profiling, scoring, hallucination guard | | |
| | Language | TypeScript + Python | Core logic | | |
| ## Project Structure | |
| ``` | |
| src/ | |
| βββ discovery/ # Phase 1: Finding pipeline | |
| β βββ lib/ # Core logic | |
| β β βββ contact-enricher.ts # 6-step email pipeline | |
| β β βββ email-classifier.ts # Tier 1/2/3 classification | |
| β β βββ email-verifier.ts # 7-layer verification | |
| β β βββ email-pattern-generator.ts # FREE Snov replacement | |
| β β βββ linkedin-person-finder.ts # Personal LinkedIn | |
| β β βββ social-finder.ts # Instagram, Facebook, Twitter | |
| β β βββ pain-signal-detector.ts # Heuristic + LLM | |
| β β βββ territory-manager.ts # CityΓindustry grid | |
| β β βββ web-scraper.ts # Playwright scraper | |
| β βββ providers/ # External APIs | |
| β β βββ hunter.ts # Hunter.io integration | |
| β β βββ serper.ts # Google search | |
| β β βββ reoon.ts # Email verification | |
| β βββ trigger-tasks/ # Trigger.dev tasks | |
| β βββ auto-discovery.ts # 5 chained tasks | |
| β βββ manual-discovery.ts # Slack-triggered runs | |
| βββ profiling/ # AI profiling service | |
| β βββ python-service/ # FastAPI | |
| β βββ main.py # /profile endpoint | |
| β βββ profiler.py # Chain-of-thought profiling | |
| β βββ scorer.py # Signal extraction + deterministic math | |
| β βββ hallucination_guard.py # Evidence-based cross-check | |
| β βββ nvidia_client.py # Multi-model LLM client | |
| β βββ config.py # Settings | |
| βββ shared/ # Shared utilities | |
| β βββ config/env.ts # Environment validation (Zod) | |
| β βββ llm/nvidia-client.ts # Multi-model LLM (MiniMax primary) | |
| β βββ llm/prompts.ts # Production prompts | |
| β βββ llm/grounding.ts # Evidence-based verification | |
| β βββ observability/tracer.ts # Trace IDs + token tracking | |
| β βββ pipeline/checkpoint.ts # Crash recovery | |
| β βββ supabase/client.ts # DB client | |
| β βββ utils/ # Retry, rate limiter, logger | |
| βββ slack/ # Slack integration | |
| βββ slack-service.ts # 3-layer delivery | |
| βββ slack-commands.ts # /discover, /leads, /status, etc. | |
| ``` | |
| ## Quick Start | |
| See [Setup Guide](docs/setup-guide.md) for detailed instructions. | |
| ```bash | |
| # 1. Clone | |
| git clone https://github.com/iDevBuddy/ai-client-acquisition.git | |
| cd ai-client-acquisition | |
| # 2. Install | |
| npm install | |
| cd src/profiling/python-service && pip install -r requirements.txt && cd ../../.. | |
| # 3. Configure | |
| cp .env.example .env | |
| # Fill in your API keys (see docs/setup-guide.md) | |
| # 4. Database | |
| # Run supabase/migrations/*.sql on your Supabase project | |
| # 5. Run | |
| npm run trigger:dev # Start Trigger.dev (task orchestration) | |
| cd src/profiling/python-service && python main.py # Start AI service | |
| ``` | |
| ## API Keys Required | |
| | Service | Cost | What It Does | | |
| |---------|------|-------------| | |
| | NVIDIA NIM | FREE | AI models (MiniMax + LLaMA) | | |
| | Serper.dev | FREE (2500/mo) | Google search | | |
| | Hunter.io | FREE (25/mo) | Email finding | | |
| | Reoon | FREE (20/day) | Email verification | | |
| | Supabase | FREE | Database | | |
| | Slack | FREE | Notifications | | |
| | Trigger.dev | FREE (50K runs/mo) | Job orchestration | | |
| **Total cost: $0/month** | |
| ## Contributing | |
| See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. | |
| ## License | |
| Private β All rights reserved. | |