All projects

2026 · Solo — architecture, pipeline, prompt engineering

ICP Lead Gen Engine

An evidence-first lead generation pipeline: every fit score is computed in code, and every cited signal is re-verified against its source before a lead is shown — grounded evidence outranks a high LLM confidence score, not the other way around.

Status
Shipped
Stack
Python · Claude (Sonnet + Haiku) · Claude Code · Apollo API · Tavily API
Areas
GenAI/LLM · Agentic AI

Context

Most lead-gen tools either need heavy manual setup per company or are hardcoded to one business’s ICP. The core design bet here was different: instead of ranking leads by an LLM’s opinion of fit, treat every claim about a lead as something that has to survive being fact-checked before it’s shown — closer to how a skeptical analyst would actually vet a lead list, not how a generic scraper would.

Problem

Build a pipeline that takes any seller’s profile, analyzes their company to generate a target ICP, uses this ICP to discover candidate companies, and ranks them primarily by verifiable evidence of buying signal — not by a fit score alone, which is easy to hallucinate confidently.

Approach

  • Seller-agnostic design. Every prompt substitutes a __SELLER__ token with the seller’s own free-text operating model, generated in a dedicated profile-building stage. No industry, product, or GTM motion is hardcoded into any prompt — the same pipeline runs for a fintech seller or a voice-AI seller without code changes.
  • Two-layer scoring. A fit-scoring stage has the LLM score each candidate across 5 qualitative axes (industry fit, product fit, market maturity, competitive displacement signal, compliance friction), with the composite computed in plain code, not LLM judgment. A separate evidence-detection stage runs an agentic web-search loop per company to find real, sourced buying signals — job postings, funding events, public complaints about incumbent tools.
  • Evidence beats fit score. Final ranking is deterministic: any company with a verified, grounded signal outranks one with none, regardless of fit score. Fit score is only the tiebreaker. This was a deliberate choice to keep the ranking explainable and resistant to confident-sounding but unverified claims.
  • Grounding enforced in code, not just prompted. Every source a model cites is checked against URLs the pipeline actually retrieved during that pass — a cited source that wasn’t actually fetched is dropped at the code level, regardless of how the model tagged it.
  • Forced structured output. Every stage uses tool-call forcing rather than “output JSON” prompting, with schema constraints (numeric bounds, enums, array size limits) doing validation work a text prompt can’t guarantee.
  • Heavy anti-pattern prompting over few-shot. Rather than example-based prompting, the system prompts lean on explicit negative instruction — “hallucinated companies are worse than fewer companies,” “an empty list is a valid, honest output” — paired with an adversarial framing for the verification stage (“treat every claim as if it will be checked immediately”).
  • Tested against adversarial cases, not just happy paths. The test suite includes live checks that deliberately try to trick the pipeline — a fabricated claim citing a real page that doesn’t actually support it, a claim citing a dead URL — and asserts the pipeline drops them.
  • Exclusion of current clients The pipeline also takes into account the companies that the seller already has business with through an independent search + the option for the user to input information as to who their current clients are. This saves the pipeline from doing twice the amount of work and ending up with leads that are useless. This information is also useful to set precedent for other potential deals, i.e. if a seller does business with one existing client that belongs to a certain domain, the pipeline identifies that and is able to look for similar enetities across the same/different domain and use the existing deal as precedent along with some other signals to consider a sperate list of companies as clients.

Architecture

Seller profile + target ICP
        │
        ▼
Seller Profile Builder ──► operating model (substituted into every prompt below)
        │
        ▼
Discovery (agentic web search) ──► candidate companies
        │
        ▼
Rank & Gate ──► LLM scores 5 fit axes, code computes composite, hard filters applied
        │
        ▼
Signal Detection ──► per-company agentic search for real buying signals
        │
        ▼
Verification ──► each cited source re-fetched and checked: reachable, on-topic, recent, right company
        │
        ▼
Contact Identification ──► Apollo lookup, LLM never invents a name
        │
        ▼
Synthesis ──► evidence-first re-rank, final write-up per lead, no claims beyond input evidence
        │
        ▼
Ranked leads, each with sourced evidence

Results

The engine finally generates a ranked list of companies that exhibit a strong business potential signal. All the information used for the rankings is grounded in citations that are present on the results page. Each resulting company also comes with a name for the ideal POC, a short explanation as to why this is a good business opportunity to pursue - explicit or implied signal- and the relevant citations to support the information being used in the rankings.