Lead Qualification With Written Criteria: Let AI Read the Form, Let Rules Make the Call
Back to Blog
Sales & Marketing· 10 min read

Lead Qualification With Written Criteria: Let AI Read the Form, Let Rules Make the Call

A practical way to qualify inbound leads with explicit business criteria, a model that only fills in fields, plain code that routes, and a weekly human review. Includes a tested Python router and notes on data minimisation, automated decisions and follow-up email rules.

ML
By Mneme Labs
NEPA AI · Building autonomous systems for creators and businesses
#lead qualification#lead routing#data minimisation#small business#ai-agents

Lead qualification goes wrong in two opposite ways. One way is a form that lets everyone through, so the calendar fills with calls that never had a chance. The other is a filter that is so clever, and so hard to inspect, that it quietly turns away people you would have wanted. The fix for both is the same: write your criteria down first, then decide which parts a model should touch.

This guide describes a small, inspectable setup. A model may read free text and fill in a few fields. Plain code applies your written criteria and picks a route. A person reviews a sample every week. The example below is a made-up web maintenance studio with synthetic leads, so none of the numbers describe a real business. Nothing here promises a close rate or a time saving, because those depend on your offer and your traffic. If you want the capture side first, the lead generation agent guide covers sources and forms, and the customer inquiry guide covers replies.

Table of eight synthetic leads with service, region, budget, start window and the route each one takes
Eight synthetic test leads and the route each one takes. Original Mneme Labs diagram.

Start with criteria you could read aloud to the lead

A qualification rule should be something you would be comfortable explaining to the person it affects. "We only work in these regions" passes. "Our model felt the lead was low quality" does not, because nobody, including you, can say what it meant.

Write four to six criteria that decide whether a call is a good use of both sides' time. For a service business, these usually come down to:

  • Service fit. Do you offer what they are asking for?
  • Service area. Can you work where they are?
  • Project size. Is the budget band above the smallest project you take on?
  • Timing. Can you start in the window they need?
  • Contact role. Is the person able to decide or to bring in the person who can?

Notice what is missing. Age, family situation, health, ethnicity, and guesses about someone's income from their name or photo are not criteria for a business call. They are also the kind of detail that creates legal and ethical trouble. The UK Information Commissioner's Office describes the data minimisation principle as holding data that is adequate, relevant and limited to what is necessary for the stated purpose, and it says you must not collect personal data on the off-chance it might be useful later. Its data minimisation guidance also asks you to review what you hold periodically and delete what you no longer need. Even if you are not in the UK, the habit is useful: every field on the form should map to a criterion, and a field that never changes a route should be removed.

Give the model the reading job, not the deciding job

A model is useful where the input is messy. A visitor who types "we need our site fixed before the spring launch, budget is flexible, we are in Ontario" has given you a service guess, a region, a vague budget and a timing hint in one sentence. Turning that into fields is tedious by hand and a good fit for a model.

Anthropic's documentation on structured outputs describes constraining a response to a JSON schema so that the result is valid, parseable, and has the declared field types. That solves a format problem. It does not make the content true. A schema-valid answer can still say the region is "US" when the visitor wrote "Ontario". So treat every extracted value as a claim that can be wrong, and design for it:

  1. Use closed lists for the fields your rules read, such as the service and the budget band. Anything that does not match a list value becomes blank.
  2. Tell the model to leave a field blank when the text does not say. A blank is cheap. A confident guess can turn into a wrongly declined lead.
  3. Prefer the form's own dropdowns over extraction wherever the visitor can answer directly. Extraction is for the free-text box, not a replacement for asking.
  4. Keep the original text next to the extracted fields, so a reviewer can see what the visitor actually wrote.

The routing itself should not be a model call. When routing is plain code, you can test it, and you can explain a decision by pointing at a line.

A small router you can test

The sketch below is plain Python with no outside services. The criteria are examples for the invented studio, and you would replace them with your own. The key design choice is that a missing answer never causes a rejection. A stated mismatch can end in not_a_fit, and an unknown goes to a question or to a person.

from dataclasses import dataclass

# Example business criteria for a made-up web maintenance studio.
SERVICES = {"website_rebuild", "maintenance"}
REGIONS = {"US", "CA"}
BUDGET_OK = {"1k_5k", "5k_plus"}
START_OK = {"30_days", "90_days"}


@dataclass(frozen=True)
class Lead:
    service: str | None = None      # what the visitor picked on the form
    region: str | None = None       # where the business operates
    budget_band: str | None = None  # "under_1k", "1k_5k", "5k_plus", "unsure"
    start_window: str | None = None # "30_days", "90_days", "later", "unsure"


def route(lead: Lead) -> tuple[str, list[str]]:
    """Return (route, reasons). Missing answers never cause a rejection."""
    reasons: list[str] = []
    if lead.service is None or lead.region is None:
        return "human_review", ["service or region missing"]
    if lead.service not in SERVICES:
        return "not_a_fit", [f"service '{lead.service}' is not offered"]
    if lead.region not in REGIONS:
        return "not_a_fit", [f"region '{lead.region}' is not served"]
    if lead.budget_band in (None, "unsure") or lead.start_window in (None, "unsure"):
        return "ask_one_question", ["budget or start window not stated"]
    if lead.budget_band not in BUDGET_OK:
        reasons.append("budget below minimum project size")
    if lead.start_window not in START_OK:
        reasons.append("start window later than 90 days")
    if reasons:
        return "nurture", reasons
    return "book_call", ["service, region, budget and timing all match"]

Running this against eight synthetic leads gave the routes shown in the table above: a full match goes to book_call, a service you do not offer and a region you do not serve go to not_a_fit, a small budget or a late start goes to nurture, an unsure budget gets ask_one_question, and a blank region or an empty form goes to human_review. Those eight cases make a useful test list. Whenever you change a criterion, add a case that would have behaved differently under the old rule.

Every route returns reasons. Store them with the lead. When a salesperson asks why someone was sent to nurture, the answer is a stored sentence and not a guess.

Decide what each route actually does

A route is only useful if something happens next, and each outcome needs a human-friendly design.

book_call. Send a booking link or alert the person who takes calls. Do not promise a result.

nurture. The lead may become a fit later. Send one useful, relevant resource and then let them go. If you add them to a recurring email list, that is a separate decision that needs a clear opt-in.

ask_one_question. Send a short message that asks the single missing thing. One question is a better experience than a long questionnaire, and it keeps the data you hold small.

human_review. A person reads the message. This route exists so that odd, incomplete, or unusual enquiries do not fall through a rule that was written for the usual case.

not_a_fit. Send a polite reply that says what you do and do not offer, and if you can, name a better place to look. Someone who cannot be served today can still recommend you.

Follow-up email has rules of its own. In the United States, the CAN-SPAM statute at 15 U.S.C. 7704 says commercial email must not carry false or misleading header information or deceptive subject lines. A commercial message must identify itself as an advertisement unless the recipient gave prior affirmative consent. It must offer a clear way to decline further messages and include a valid physical postal address. A sender must stop commercial messages that fall within an opt-out request after ten business days, and the opt-out mechanism must stay available for at least 30 days after sending. A direct reply to a visitor's own question is a different kind of message from a nurture newsletter, and which category a message falls into is a legal question. Other countries have their own rules, so check the law where your recipients live, and ask a lawyer if you are unsure.

Dataflow: lead form to field extraction to rules router to five routes, with a dashed loop from a weekly human review back into the written criteria
The model fills fields. Plain code routes. A person reviews a sample and edits the criteria. Original Mneme Labs diagram.

Check whether this counts as an automated decision

Most lead routing is low stakes. A visitor who lands in nurture instead of a call has lost very little. Still, the question is worth asking, especially if a "not a fit" outcome denies someone access to a service or a price.

The ICO's draft guidance on automated decision-making and profiling says the rules for automated decisions apply when a system makes a significant decision about a person with no meaningful human involvement. It also lists the risks of such systems, including bias, over-generalisation, and errors from out-of-date data that scale quickly. The page was marked as updated on 31 March 2026 and is under review, so check the current version. The practical reading for a small business is modest. Do not use a score to refuse a service or set a price without a person involved. Do not infer traits about someone from indirect signals. Keep the route reasons so a person can explain and, if needed, reverse a decision.

Review a sample every week

Rules age. A region you did not serve last spring may be in scope now, and a budget band that was too small may match a new, cheaper offer. A weekly review is how the criteria stay current.

Each week, pull a small sample from not_a_fit and nurture, along with a few from book_call. For each lead, read the original text, the extracted fields, and the route reasons. Ask three questions. Did extraction get a field wrong? Did a rule treat a reasonable lead unfairly? Did a booked call turn out to be a poor use of time, and which criterion should have caught it?

Change the written criteria or the extraction instructions, add a test case, and rerun the router tests. Keep notes on what you changed and why. A tool that records outcomes, such as whether a booked call became paid work, gives you something to compare with the criteria. With only a handful of leads per month, patterns are weak evidence. Treat a small sample as a prompt for a conversation, not a measurement.

Failure cases to plan for

Misread free text. The model reads "we are not in Texas" as a Texas lead. The blank-when-unsure rule and the original text beside the fields make this easy to spot in review.

A dropdown that does not fit. If many visitors choose "other", the list is missing a real service. That is information about your market, so read those messages.

Gaming the form. Some visitors will pick a bigger budget band to get a call. Qualification is a first filter, not proof, so confirm project details on the call.

Stale criteria. A rule written for last year's team capacity may now turn away good work. Put a date on the criteria and recheck them every quarter.

Duplicate leads. The same person may submit twice. Deduplicate on a stable field you already collect, such as the email address, and keep the stored copy small.

Over-collection creep. A new field is added "just in case". Remove any field that does not feed a route.

Limits

This design does not predict who will buy. It checks fit against rules you chose. Rules say nothing about intent, and a lead who matches every criterion can still never reply. It also does not replace judgment about unusual cases, which is why human_review exists. If your volume is low, a spreadsheet and the same criteria may serve you as well as any code.

Next step

Write your four criteria on one page. Turn them into a function like the one above, add eight synthetic test leads, and run it before you connect any form. When the routes match what you would have decided by hand, connect a form and keep a person in the loop for the first weeks. For monitoring the whole flow, see the guide to monitoring an agent without babysitting it, and for handling failed sends, see failures and retries.

Sources