Your tokenization from US$5,000
← Blog
AI Lead Qualification: Agent, Scoring Rules and CRM Step by Step
November 26, 2026·By Key Lab·Editorial team

AI Lead Qualification: Agent, Scoring Rules and CRM Step by Step

In short: To qualify leads with AI, first translate your sales process into concrete criteria, questions and fields. The agent (on WhatsApp, web or voice) holds the conversation and extracts that data in a structured format. Code with rules your team can audit calculates the score. A CRM integration creates or updates the contact without duplicates and leaves a summary plus the full conversation for the sales rep.

What qualifying a lead with AI actually means

Qualifying a lead means deciding, based on concrete information, whether a sales rep should spend time on it, with what priority and at which stage of the funnel it enters. Doing it with AI does not mean handing that decision to a language model. It means splitting the work between components that are good at different things:

ComponentWhat it doesWhat it shouldn't do
Conversational agent (LLM)Talks naturally, answers questions and extracts data into a fixed schemaDecide the final score or invent data the customer never gave
Rules in code (TypeScript or Python)Calculates the score and stage using criteria your sales team definedInterpret ambiguous free text
CRM integrationCreates or updates the contact, moves the stage, stores the conversationCreate a new contact every time someone writes in
Your sales teamSells, validates the qualification and tunes the rulesRepeat questions the agent already asked

When the model talks and the code decides, you can explain why a lead ended up as “ready for sales” or “nurture”, and you can change a threshold without rewriting the prompt.

How to define qualification criteria before writing the prompt

The most expensive mistake is starting with the prompt. Before writing a single line, sit down with two or three sales reps and review real leads: which ones bought, which ones didn't, and why. That's where your criteria come from.

Generic frameworks as a checklist

Well-known qualification frameworks such as BANT help you avoid forgetting basic dimensions. But copying them verbatim produces questions nobody answers over WhatsApp, like “What is your budget?”. Use them to check you're not missing anything, then translate them into your customer's language.

The questions specific to your business

Every company has one or two data points that predict a sale better than any generic framework. For a real estate developer, it may be whether the buyer already has a pre-approved mortgage. For a B2B service, how many locations or users the company has. For an aesthetic clinic, whether the patient has already had an assessment. That data point goes first.

Buying signals and disqualifiers

Also define what rules a lead out (a city you don't serve, a budget below your minimum, someone looking for a job rather than buying) and what speeds it up (asks for a visit, asks about payment options, mentions a date).

An illustrative example for a developer selling new homes in Colombia (amounts in Colombian pesos):

CriterionConversational questionCRM fieldExample rule
NeedAre you looking to live there or to invest?purchase_purposeBoth valid; changes the rep's script
Ability to payAre you planning to buy with a mortgage, your own funds or a mix?payment_methodPre-approved mortgage adds more points
BudgetWhat price range are you considering?budget_min and budget_max (numbers)If the lower bound is below the project's minimum price: nurture
TimingWhen would you like to have the property?purchase_timelineUnder 6 months adds points
AuthorityAre you making the decision alone or with someone else?decision_makersIf there's another decision-maker, invite them to the visit
LocationWhich area are you interested in?area_of_interestArea with no projects: disqualify

Store the budget as two numbers, not text, so the rules can compare it without interpreting sentences. With this table you already have three things: the agent's script, the data schema and the scoring rules. Only then does it make sense to write the prompt.

How the agent qualifies without interrogating

An agent that fires six questions in a row feels like a form, and people drop off. These are the guidelines we apply:

  1. Answer what the customer asked first. If someone asks the price, the agent gives the range and then asks its question.
  2. One question per turn, ordered by value: the data point that best predicts a sale comes first.
  3. Accept ranges and approximate answers. “Between 380 and 450 million” is enough to qualify.
  4. Don't ask what you already know. If the lead comes from an ad form with name and email, the agent receives them as context.
  5. Let non-qualified leads exit quickly, with a useful alternative: receiving updates or information about another project.
  6. Keep the scope narrow. The agent talks about your offer and the next step, not about anything under the sun.

A sample WhatsApp conversation (illustrative prices in Colombian pesos):

Customer: Hi, I saw the ad for the project in Envigado, how much is it? Agent: Hi! In that project, apartments range from 380 to 520 million pesos, depending on size and floor. Are you looking to live there or as an investment? Customer: To live, with my wife. We have between 380 and 450. Agent: Great, there are two-bedroom options in that range. Are you planning to buy with a mortgage, your own funds or a mix? Customer: Mortgage, it's already pre-approved. Agent: Excellent, that speeds things up a lot. When would you like to have the apartment?

Behind every turn, the model fills in a structured object. Require the output to follow a fixed schema, use null when a data point wasn't stated, and store the verbatim phrase that supports each value:

{
  "purchase_purpose": "residence",
  "payment_method": "preapproved_mortgage",
  "budget_min": 380000000,
  "budget_max": 450000000,
  "purchase_timeline": null,
  "decision_makers": "couple",
  "area_of_interest": "Envigado",
  "requested_visit": false,
  "model_signal": "high_intent",
  "evidence": {
    "payment_method": "it's already pre-approved",
    "budget_min": "We have between 380 and 450"
  }
}

The evidence field looks like a detail, but it's what lets you audit later whether the agent understood correctly or filled in data on its own. The model_signal field is the only model opinion that feeds into the score, and it does so with a cap.

WhatsApp, web or voice: which channel to use and what each conversation costs

The qualification logic is the same across all three channels. What changes is the cost and the platform rules.

WhatsApp after the October 2026 change

On the WhatsApp Business Platform you can only send free-form messages within a 24-hour customer service window opened by the customer. Since October 1, 2026, Meta charges for every service message, which had been free since November 2024; your own agent's replies within the window fall into that category. The same documentation states these rates may be updated as often as quarterly. In addition, utility templates sent within an open window stopped being free on the same date.

In practice, every unnecessary question now costs money, on top of tiring the customer. A short, well-ordered script is also a financial decision. For details on how an agent works in this channel, see our guide to WhatsApp AI agents for sales and customer service.

Your own agent or Meta Business Agent

Since August 1, 2026, Meta charges per token for messages from its own Meta Business Agent, in a category separate from service messages. That documentation covers pricing, but doesn't detail how configurable its qualification criteria are or how it writes to your CRM. If you evaluate it, get those answers before comparing it with your own agent, where you control the rules, the fields and the deduplication.

Meta's policy on AI assistants

According to third-party analyses of Meta's terms, the platform prohibits general-purpose AI assistants when they are the primary product offered, allows agents that are ancillary to the business, and reserves sole discretion to decide what counts as primary. That restriction applies to all API users since January 15, 2026 and, according to this summary, now appears as clause 4.7 of Meta's WhatsApp Business Platform Terms. We couldn't link Meta's primary text here, so read it directly in their current terms. A qualification agent with fixed questions, defined fields and handoff to a human will likely be considered ancillary use, but Meta makes the call. Treat this as general information and check it with your advisor before launching.

Web and voice

On your website you don't pay Meta per message, only model usage and infrastructure, and you can combine chat with a form. On voice, latency rules: use even fewer questions and confirm the data at the end of the call. We cover architecture, response times and cost per minute in our guide on how to implement an AI voice agent for sales and support.

Scoring with auditable rules or letting the model decide

Asking the model to “rate this lead from 1 to 10” is tempting and fast. It's also the source of most qualifications nobody can explain.

ApproachAdvantagesRisks
The model decides the scoreFast to set up, handles nuanceInconsistent across conversations, hard to audit, changes when you switch models
Code rules over extracted dataPredictable, explainable, the sales team can tune itRequires disciplined criteria definition
HybridRules drive the score; the model adds a qualitative signal with limited weightYou need to cap that signal

We recommend the hybrid, with most of the weight on the rules. A simplified TypeScript example:

function scoreLead(lead: ExtractedLead): Result {
  if (lead.area_of_interest && !AREAS_WITH_PROJECTS.includes(lead.area_of_interest)) {
    return { score: 0, stage: 'disqualified', reasons: ['area_not_served'] };
  }
  let points = 0;
  const reasons: string[] = [];
  if (lead.payment_method === 'preapproved_mortgage') { points += 30; reasons.push('mortgage'); }
  if (lead.purchase_timeline === 'under_6_months') { points += 25; reasons.push('timeline'); }
  if (lead.budget_min !== null && lead.budget_min >= MIN_PRICE) {
    points += 25; reasons.push('budget');
  }
  if (lead.requested_visit) { points += 20; reasons.push('visit'); }
  // Model signal: adds points, but capped so it never decides alone
  if (lead.model_signal === 'high_intent') {
    points += Math.min(10, MODEL_SIGNAL_WEIGHT); reasons.push('model_signal');
  }
  return { score: points, stage: points >= 60 ? 'ready_for_sales' : 'nurture', reasons };
}

Every point has a readable reason, and the model signal can never push a lead over the threshold on its own. When the sales manager says “a pre-approved mortgage matters more than we thought”, you change one number, version it and measure.

How to integrate the AI agent with your CRM without duplicates

The conversation can be flawless and the system can still fail if the CRM fills up with duplicate contacts or lost writes. This is the most underestimated engineering piece.

Fields, stages and where the score lives

Create a CRM property for each schema field, plus the score, the reasons, the rules version and the source channel. Define which pipeline stage maps to each outcome: disqualified, nurture, ready for sales.

If you use HubSpot, there's an alternative: HubSpot's native lead scoring for contacts, available only in Marketing Hub. It supports engagement, fit or combined scores; the combined option creates three properties: total, engagement and fit. With Marketing Hub, your agent can fill the fit properties and let that score use them. If you're on another plan, keep the score in your code and store only the result and reasons in the CRM. Either way, keep a single source of truth, not two scores that contradict each other.

Search before you create

In HubSpot, the contacts API supports batch upsert using an idProperty, either email or a custom unique property: if the contact exists, it's updated; if not, it's created. You can also look up a contact directly by email. Since on WhatsApp you rarely have the email at the start, normalize the phone number to the international E.164 format (for example, +573001234567) and use it as your own unique property. That way “300 123 4567” and “+57 3001234567” don't end up as two different people.

HubSpot now versions its API by date (for example, 2026-09) and marks previous routes as legacy. Pin the version in your integration so a platform change doesn't silently break your writes.

In Salesforce, Pipedrive, Zoho or an in-house CRM, the principle is the same: normalized unique identifier, search before create and a pinned API version. Check each platform's documentation for the specific endpoints.

Retries, idempotency and an error queue

APIs fail: rate limits, brief outages, expired tokens. Every write should carry an idempotency key (for example, the conversation ID plus the turn number) so a retry doesn't duplicate notes. If it still fails after several retries, the write goes to an error queue with an alert, not to the trash. A lead lost silently is worse than a poorly qualified one.

We wire these actions up as agent tools, via direct API or MCP, and log every call so we can reconstruct what happened to each lead.

When to hand the lead to a rep without repeating questions

Write down the handoff triggers:

  • The score passes the agreed threshold.
  • The customer asks to talk to a person, even if they don't qualify.
  • The question is outside the agent's scope (special terms, negotiation, complaints).
  • The customer shows frustration or confusion.
  • The lead is high value based on a single signal (for example, a multi-unit purchase).

The rep should receive, both in the CRM and in their notification, a summary like this:

Summary for the sales rep: Couple looking for an apartment to live in, in Envigado. Pre-approved mortgage. Budget between 380 and 450 million pesos. Want to move in within 6 months. Score: 90 (mortgage 30 + budget 25 + timeline 25 + model signal 10). Suggested next step: propose two-bedroom units in their range and schedule a visit.

Below it goes the full conversation as a note or activity on the contact. The agent tells the customer who will contact them and when. That message keeps them from writing again and opening a parallel conversation.

Personal data when capturing leads: what to check

The qualification conversation collects personal data, such as phone numbers or ability to pay, so the flow must comply with data protection rules in every country where you operate. Validate the specific requirements for consent, purposes and proof with a specialist before launch; in the design, plan for an opening message linking to your privacy policy and a CRM field to store the evidence.

Also review the platform rules: according to summaries of Meta's terms, if you use an AI provider, WhatsApp data can't be used to train models, except to fine-tune one used exclusively by your company. Check both local law and each channel's current terms with a specialized lawyer.

Common mistakes when qualifying leads with AI

  1. The agent interrogates instead of talking. Six questions in a row, without answering what the customer wanted to know. Result: drop-off and, on WhatsApp, more billed messages.
  2. The score is left to the model. Nobody can explain why two similar leads got different scores.
  3. Duplicates in the CRM. Unnormalized phone numbers and creating without searching first. The rep calls the same person twice.
  4. Personal data is left for the end. Launching without a specialist review and without a field to store consent.
  5. No baseline. Launching the agent without measuring how qualification worked before, so later nobody can say whether it improved.
  6. Open-ended scope. An agent that answers everything is harder to control and gets closer to what Meta's policy restricts.

A 4-week pilot to validate qualification before scaling

A short pilot answers the question that matters: does the agent qualify as well as or better than your team, at a reasonable cost?

  1. Week 1: baseline and criteria. Don't try to build the baseline from scratch in seven days. Pull the last 1 to 3 months of history from the CRM to calculate time to first contact and lead-to-meeting rate, and add an estimate of the hours your team spends filtering. Finalize the table of criteria, questions, fields and rules.
  2. Week 2: build. Agent with a structured schema, rules in code, CRM integration with deduplication and an error queue, and the personal data message validated.
  3. Week 3: controlled operation. Turn the agent on in a single channel or campaign. Reps qualify a sample of leads in parallel without seeing the agent's score. As a practical reference, aim for at least 50 leads qualified by both before drawing conclusions: with 20, a single disagreement moves agreement by 5 points.
  4. Week 4: comparison and tuning. Compare against the baseline, adjust rules and script, and decide whether to scale. If the sample didn't reach the minimum, extend the controlled operation before deciding.

The metrics we review:

MetricWhat it tells you
Agent–rep agreement on the sampleWhether the rules reflect the team's real judgment
Completeness of key fieldsWhether the conversation gets the data without forcing it
Time to human contact for qualified leadsWhether good leads arrive sooner than in the historical data
Qualified lead-to-meeting conversionWhether the score predicts anything useful
Cost per qualified lead (Meta + LLM)Whether the economics hold up with per-message pricing
Failed writes or writes in the error queueWhether the integration is reliable

For the full return calculation, with costs and hours saved, use our guide on how to measure the ROI of an AI agent in sales and customer support.

How we do it at Key Lab

We don't adapt your sales process to a tool; we adapt the technology to the way your company sells. The order is always the same: we understand your model, map how your sales team operates, identify where good leads go cold and where time is lost, design the architecture and then build the system.

We write automations in our own code with TypeScript and Python, connect the agent to your tools via API or MCP, and build durable workflows with retries and traceability, so every lead has a record of what was asked, what was extracted and why it got its score. We work with conversational and real-time voice agents (with tools like ElevenLabs and Twilio) and, when privacy requires it, we deploy open models in your own cloud.

With our methodology, an MVP is usually ready in about 4 weeks: diagnosis and architecture, prototype, development with security and QA, and deployment. If the project requires complex integrations with several systems, we give you a clear timeline after the diagnosis.

Frequently asked questions

Can I plug ChatGPT directly into WhatsApp to qualify leads?

According to third-party analyses of Meta's terms, WhatsApp Business prohibits general-purpose AI assistants as the primary product, allows agents that are ancillary to the business, and Meta decides at its discretion what counts as primary. A narrowly scoped qualification agent, with defined questions and handoff to a human, will likely be considered ancillary use even if it runs on OpenAI or other providers' models, but there's no guarantee. Read Meta's current terms and validate them with your advisor before launching.

Should the AI set the lead score?

We recommend it doesn't do so alone. The model talks and extracts data into a fixed schema, and the score is calculated with code rules your sales team can read and adjust; the model's opinion only enters as a capped signal. That keeps every qualification explainable and consistent, and you can switch models without changing your criteria.

How much does each qualification conversation on WhatsApp cost?

Since October 1, 2026, Meta charges for every service message, in addition to templates, and its rates may be updated as often as quarterly. On top of that comes language model usage. That's why it pays to measure cost per qualified lead in a pilot and keep the script short.

How do I avoid duplicate contacts in HubSpot or another CRM?

Use a normalized unique identifier, such as email or the phone number in E.164 format, and search before creating. In HubSpot, batch upsert with idProperty updates the contact if it exists and creates it if it doesn't. Add idempotency keys and an error queue so retries don't duplicate records and no leads get lost.

Does this work with an in-house CRM or one other than HubSpot?

Yes. The architecture is the same with Salesforce, Pipedrive, Zoho or an internal system: data schema, scoring rules in code and API integration with search-before-create, retries and traceability. What changes are each platform's endpoints and limits.


If your sales team is losing hours filtering contacts and good leads are going cold, let's talk. On a first call we learn how you sell, review your channels and your CRM, and then send you a proposal with architecture, timeline and budget. Book a meeting with the Key Lab team.