Blog · 2026-06-24

How to build a custom AI agent for lead qualification

From scoring criteria to the verification gate — with the filter ratio from a prospect pipeline we run ourselves.

Get my free blueprint

build a custom AI agent for lead qualification

A custom AI agent for lead qualification is built in five steps: write the fit, intent, timing and authority criteria down explicitly; choose a framework; design the enrichment-to-routing data flow; test it against real leads from the last month rather than a curated demo set; and escalate ambiguous records to a person with the evidence attached.

The filter matters more than the volume. In our own prospect pipeline, 5,231 deduplicated rows narrowed to 145 contact-verified — the narrowing is the product.

Lead qualification is the most common first automation we are asked for, because it is high-volume, rule-based, and the output is checkable: you can look at a scored lead and say whether the score is defensible. This guide is the sequence we use, and the section near the end gives the filtering ratio from our own pipeline so you have a real number to compare against rather than a promise.

Step 1: Define your qualification criteria

Before any code is written, decide what “qualified” means for your business. This is the step most teams skip, and skipping it produces an agent that is vague in exactly the way the brief was.

Write the criteria down as rules with thresholds. If your criteria read “they seem interested”, the agent will produce results that seem qualified.

Step 2: Choose your framework

Hermes — when qualification is a single-agent job and the agent should remember which leads converted and refine its scoring over time. This covers most cases, and it is what our own lead agent runs on.

OpenClaw — when the pipeline genuinely splits across agents: scoring in one, enrichment in another, routing in a third, with handoffs to orchestrate.

Custom — when you need self-hosted deployment, audit logging, or compliance guarantees the open frameworks do not offer. If you need the branching to be explicit and replayable step by step, that is the case for LangGraph agent development as the orchestration layer.

Step 3: Design the data flow

Input. The inbound lead — form submission, email, chat, ad click — with whatever the lead actually provided, which is usually less than you would like.

Enrichment. The agent adds firmographic data, technographic signals, public profile data, and company news. This is what turns a name and an email into something scoreable. Decide here what happens when enrichment returns nothing: an unenriched lead should be marked as such, not scored as though the data were absent by choice.

Scoring. The enriched record is evaluated against each criterion, and each criterion produces its own score rather than one opaque number. Per-criterion scores are what make a disagreement diagnosable later.

Routing. High scores go straight to a rep, middle scores to nurture, low scores to a documented rejection with the reason attached. Every path is recorded.

Output. The record lands in the CRM with the score, the enrichment, the reason, and the recommended action, so the rep picks it up with full context.

Step 4: Build and test on real data

The rule that matters: do not build on a demo dataset. Take 50–100 leads from the last month, run them through the agent, and compare its scoring with what actually happened. Did it rank the leads that converted above the ones that did not? Did it flag the dead ones?

This validation step is what separates a production agent from a prototype. A prototype works on curated data. A production agent works on messy records with missing fields, ambiguous signals, and duplicates. Iterate on the criteria until the agent's output matches your judgement on the clear-cut cases, and make sure everything genuinely ambiguous is escalated with its evidence rather than guessed.

Step 5: Deploy and measure what you can actually see

Track the metrics you own, and be honest that conversion is influenced by more than the agent:

What the filter actually looks like

Our own prospect pipeline is the clearest illustration of why volume is the wrong target. One agent assembles and segments prospects across four markets, running a discovery job daily. The master file holds 5,231 deduplicated rows. The number that reached contact-verified is 145.

That is roughly a 97% reduction, and it is the point rather than a disappointment. Collecting thousands of rows is commodity work; every unfiltered row you pass on is triage moved onto a salesperson. The full architecture — the schema, the deduplication approach, and the verification stage — is written up in thelead generation engine case study. The same gate-do-verify shape appears in every automated chain we build, described generally inhow to automate a business process with AI agents.

What this costs to build

It depends on the number of criteria, the number of enrichment sources, and the systems the agent has to write to — so we scope it explicitly rather than quoting a range that would be invented. The free blueprint produces the scope, andhow long a production agent takes to buildbreaks the timeline down by stage. We do not publish return figures for client systems, because we do not hold client-side measurement and would be guessing.

Our own prospect pipeline, measured

Our own prospect pipeline, measured — observed on Our own production host — the lead-generation agent in that 19-agent Hermes fleet, 27 July 2026
Rows in the deduplicated master pipelinesegment files total 7,092 before deduplication5,231
Market segmentsUS, UK, Australia, expansion4
Rows that reached contact-verifiedroughly a 97% reduction from the master145
Collection cadencediscovery job dispatched at 05:00 by the fleet orchestratordaily

Source: Our own production host — the lead-generation agent in that 19-agent Hermes fleet. Observed .This is our own prospect pipeline, not a client system. It measures collection and verification, not conversion — the host carries no client-side outcome data.

Lead qualification agent questions

What data does a lead qualification agent need before it can score anything?

A fixed record schema, decided before the first row is collected: a stable external identifier, name, category, website, phone, address, country, and any objective signal you already trust. Our own pipeline stores a place_id on every row, which makes deduplication exact rather than fuzzy. You cannot filter free text, so the schema is the build.

How accurate does lead scoring have to be before you trust it?

Accurate enough that its disagreements with you are interesting rather than random. The practical bar we use is agreement with a human reviewer on the clear-cut cases, with everything genuinely ambiguous escalated rather than guessed. A scorer that is confidently wrong on 10% of leads is worse than one that refers 20% to a person.

Should a qualification agent contact the lead, or only route it?

Start with routing. Scoring, enriching and assigning are reversible; sending a message to a prospect is not, and a bad first message costs more than a slow one. In our own lead pipeline collection runs unsupervised on a daily schedule, but nothing reaches a person on the other end without qualification and contact verification gating it first.

What happens to leads the agent scores as unqualified?

They stay in the pipeline with the score and the reason attached, which is what makes the scoring auditable later. Unqualified is a routing decision, not a deletion: some become nurture candidates, some are genuinely out of profile, and reviewing the rejected set every few weeks is how you find out whether your criteria are too narrow.

Amit Kumar

Founder of I Am Agent Man. Builds and runs production AI agents on Hermes, OpenClaw, and MCP — self-hosted, model-agnostic, with persistent memory and hard cost ceilings.

Scope your lead qualification agent

Tell us your lead flow. We'll design the qualification agent — in a free blueprint.

Goes straight to hello@iamagentman.com — we read every message ourselves. Prefer to answer three questions instead?Build your blueprint.

Talk to the studio

One message · reply within one business day