Duck
Tutorials7 min read

How to Build a Conversational AI Agent for Lead Qualification

Samet Turan— Editor··7 min read

Learn to build a conversational AI agent that qualifies leads, handles FAQs, and logs notes—no code required. Step‑by‑step, real prompts, pricing, and debugging tips.

How to Build a Conversational AI Agent for Lead Qualification

Many solopreneurs waste hours each week answering the same questions from prospects while trying to spot genuine buying signals. A conversational AI agent can take over the repetitive chat, qualify leads with a simple scoring rule, and push qualified ones to your CRM—all without writing a single line of code. By the end of this guide you’ll have a working agent, a set of tested prompts, and a checklist for when it stumbles.

What a lead‑qualifying agent actually does

At its core the agent does three things: it greets the visitor, it asks a few qualification questions, and it routes the conversation based on the answers. Think of it as a tireless front‑desk clerk who never gets bored of repeating the same script. The qualification logic can be as simple as “if budget > $5k and timeline < 3 months then send to sales”.

Because the agent lives in a chat widget, it captures every reply in real time. You can store those replies in a Google Sheet or push them straight into a CRM via a webhook. The beauty is that the heavy lifting—understanding natural language—is done by a large language model behind the scenes, while you only define the flow.

One thing most tutorials skip is the fallback path. If the user says something the model doesn’t understand, you need a polite way to ask for clarification or to hand off to a human. Ignoring this edge case leaves prospects staring at a dead‑end chat.

Choosing the right no‑code platform

I’ve tried a handful of builders and settled on Voiceflow for its visual flow editor and easy API hooks. The free tier lets you prototype, but you hit a wall quickly: version history is limited to 30 days and you can’t add custom code blocks. That’s why I upgraded to the Pro plan at $49/mo.

$49/mo feels fair given the built‑in analytics, the ability to call external webhooks, and the collaborative canvas that lets a teammate review the flow without touching code. (If you’ve tried Zapier, you know what I mean—Voiceflow feels more purpose‑built for conversational logic.)

What most guides get wrong here is assuming any chatbot builder will work. Many platforms lock you into proprietary NLU models that can’t be swapped out for GPT‑4 or Claude. Voiceflow lets you bring your own model via an API call, which is essential for keeping responses on brand.

Concrete gripe: the version history limit on the free plan is annoying because I once rolled back a flow only to discover the change I wanted was already purged. I had to rebuild from scratch.

Concrete love: the test chat pane shows the exact JSON payload the AI returns, which makes debugging prompts a breeze. You can see whether the model is returning the expected “budget” field or a null value.

Building the conversation flow: intents, entities, and the qualification script

Start by creating three intents: Greeting, BudgetQuestion, and TimelineQuestion. Each intent needs a handful of training phrases. For Greeting you might use “hi”, “hello”, “hey there”. For BudgetQuestion use phrases like “what’s your budget?”, “how much are you looking to spend?”, “can you share your price range?”. Keep the list short—overloading the intent with similar phrases can confuse the model.

Next, add two entities: budget (a number) and timeline (a duration). In Voiceflow you define these as custom entities with a few examples: “5000”, “five thousand”, “$5k” for budget; “1 month”, “six weeks”, “quarter” for timeline.

Now the qualification script. After the greeting, the flow asks the budget question, captures the user’s reply, sends it to an OpenAI endpoint with a prompt that extracts the number, then does the same for timeline. Here’s the exact prompt I use for budget extraction:

You are a helpful assistant. Extract the budget amount from the user's message. Reply with only the number (no currency symbol, no text). If no amount is clear, reply with 0.

User message: "{{user_input}}"

The double curly braces are Voiceflow’s syntax for injecting the latest user text into the prompt. The model returns something like “7500” which we then store in the budget entity.

One‑sentence paragraph: The key is to keep the prompt razor‑focused—extra fluff makes the model hallucinate.

After you have both numbers, a simple decision node checks if budget >= 5000 and timeline <= 90 (days). If true, the flow triggers a webhook to your CRM with a “qualified lead” payload; otherwise it sends a polite follow‑up and ends the chat.

Why does the agent ignore my fallback prompt?

This is a common headache. You’ve added a fallback route that should trigger when the confidence score is low, yet the agent keeps looping back to the main flow. The reason usually lies in how Voiceflow evaluates confidence.

Voiceflow treats any response from the LLM as a successful intent match unless you explicitly set a confidence threshold. If your extraction prompt always returns a number (even 0 for “no budget”), the engine thinks it understood the user and never falls back.

Fix: add a validation step after the extraction prompt. If the returned value is 0, set a flag that the budget was not detected. Then route to the fallback based on that flag, not on the LLM confidence.

Another tip: log the raw LLM output in a hidden variable. When you see a string like “I’m not sure” instead of a number, you know the prompt needs tightening.

What most guides get wrong about AI agent training data

Many tutorials tell you to upload hundreds of example phrases for each intent. In practice, that leads to diminishing returns and a bloated model that’s slower to respond. I’ve found that 10‑15 well‑chosen phrases per intent give you >90% accuracy for a narrow domain like lead qualification.

Over‑training also makes the agent brittle. If you add phrases that are too broad (“I need help”), the model starts matching unrelated chatter to the BudgetQuestion intent, which then triggers a request for a number where none exists. The result is a flood of 0 values and confused leads.

Instead of quantity, focus on diversity. Cover the different ways a real prospect might ask about budget: formal (“May I inquire about your budget range?”), casual (“What’s your spend?”), and even slang (“How much you willing to drop?”). That variety teaches the model the underlying intent without memorizing every possible wording.

How to debug when this breaks

When the agent stops qualifying leads, follow this checklist:

  1. Open the test chat in Voiceflow and reproduce the exact user message that failed.
  2. Check the “Logs” pane—look for the raw output from the extraction prompt. If you see unexpected text, the prompt needs tightening.
  3. Verify that the entity values are being stored correctly. Use a “Set variable” block to echo the budget and timeline entities into a visible chat bubble for debugging.
  4. If the webhook isn’t firing, inspect the the Make platform (or Zapier) scenario. Confirm that the incoming payload matches the expected JSON shape and that the scenario isn’t halted by a filter.
  5. Finally, check the CRM side. Sometimes the lead appears but gets dropped by a duplicate‑record rule.

One concrete example: last month I noticed the budget entity stayed at 0 even when the user typed “five thousand”. The logs showed the LLM returning “five thousand” instead of “5000”. I revised the prompt to add the phrase “Reply with only the number, spelling out numbers is not allowed.” After that change the extraction worked reliably.

Cost breakdown and opinion on pricing

Here’s what a modest setup looks like per month:

  • Voiceflow Pro: $49
  • OpenAI API (GPT‑4o, ~5000 tokens): ~$5
  • Make.com (basic plan for webhooks): $10
  • CRM (HubSpot’s CRM free tier): $0

Total ~$64/mo. I think that’s a fair price for a fully automated lead‑qualification front desk that saves me roughly 10 hours a week. If you’re just testing, the free Voiceflow tier plus the OpenAI playground is enough to validate the idea—though you’ll miss the version history and webhook features.

One mild aside: the OpenAI token pricing can creep up if you let the conversation wander; I added a hard limit of two turns after qualification to keep costs predictable.

We cover this in more depth elsewhere — deeper coverage of AI agent platforms.

If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a blueprint at deepusecase.com/vault.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.