A pipeline that matches messy inbound leads to real company data, scores them against a transparent ICP model and routes them, so an SDR doesn't have to read 400 form fills a week.
A personal build that matches messy inbound company names to real filings data, scores each lead with a SQL rubric a RevOps lead can read and retune, reads intent with a typed model call, and routes the result: P1 to an AE now, P2 to nurture, P3 archived with a reason.
Inbound funnels bury sales teams in volume: students, competitors, wrong-fit companies. The few real buyers go stale while triage takes days. I built this around the qualification problem I work on every week in sales. It takes manual triage off an SDR's plate and keeps false-positive P1s off an AE's calendar, with 99.1% P1 precision on a 400-lead test set.
Deterministic where possible, agentic where valuable.
Scoring is SQL, so it can be audited, tested and retuned without touching code. Judgment calls, like resolving an ambiguous company name or reading intent from a vague message, go to a model, and only where a model does better than a rule. Each of those two judgments uses a different model, chosen for the job. Everywhere else, rules win.
A lead moves left to right. Solid stages are deterministic SQL or keyword matching. Only two steps hand off to a model, and each uses a different one. RESOLVE calls a local LLM (Ollama) only when two company-name matches are tied. CLASSIFYcalls TypeSafe AI's Jev, a typed-judgment model rather than a chat model, to read intent from the free-text message. Exhibit B, further down, shows what that difference looks like in code.
CLASSIFY is the one step where a message has to be read rather than looked up. “What's your pricing, and how does it compare to X?” could come from a buyer asking about cost, or from a competitor doing research. That call used to go to a hand-written prompt on a local LLM, with the hope that clean JSON came back. I rebuilt that step, and only that step, on TypeSafe AI's Jev.
The rebuilt step is more accurate, much cheaper and simpler to maintain.
Accuracy went up slightly. The bigger change is the confidence score, which the old prompt never had: 96% of Jev's remaining errors get flagged for a person before they reach a rep. Before, a wrong answer looked exactly like a right one.
$0.008 vs. an estimated $0.14 for the same 320 model calls, using tokens measured on this workload. That's three judgments per lead (intent, buying stage, priority) for less than one question would cost on Haiku.
There's no prompt template to maintain, no JSON to parse, and no retry-then-guess fallback for malformed responses. A typed question goes in and a typed answer with a confidence score comes out. Exhibit B below shows the before and after.
One regression:three leads that used to route correctly no longer do. A better overall accuracy number didn't carry through to every downstream metric, which is why I re-tested the whole pipeline and not just the classifier. The full write-up is in jev-rebuild-notes.md.
Condensed for the page, with the real signatures and field names. Full source: jev_qualify.py.
A hand audit found company size overriding strong buying signals. A CFO with approved budget shouldn't score lower because their company is large. Rebuilding the scorer around that finding exposed a second gap, which I also fixed. The rubric that shipped had been wrong twice first.
Injection detection, spam filtering and persona classification are deterministic on purpose. A model only runs where the task is ambiguous, and the two ambiguous judgments use different tools: a local LLM to break a tie between company names, and a typed judgment model (Jev) to read intent from a message.
Every phase turned up a bug, because I tested for them on purpose. The fixes are documented alongside the code.
A text-cleaning step erased the exact detail that was supposed to prevent ambiguous matches.
SEC data extraction silently failed for every foreign-incorporated public company. There was no error, just missing data.
A similarity feature looked plausible but was quietly comparing companies with nothing in common.
The Jev rebuild dropped to 86.8% accuracy on its first live run. The cause was a one-line class description; fixing it brought accuracy to 94.0%.
Highlighted: the fix that lets a CFO with approved budget outrank the company-size penalty. This is a simplified fragment; the shipped rubric is in the repo.