$50 free credit for new accounts - ends in

Claim $50

Setup

How to set up ai agents for lead capture

How to set up ai agents for lead capture — answered from your own docs. How Knowledge Base Software teams use Chatref (ai agents, ai agents) to solve it. Start

Chatref Team5 min read / Updated June 25, 2026

Set up an AI agent on Chatref by training it on your knowledge base docs, turning on lead capture, and tailoring its behaviour to qualify visitors. In about 10 minutes, your website can automatically collect names and emails while answering questions, routing warm leads to your sales pipeline.

Before you start

Bring your Chatref account and at least one knowledge base document – a PDF, a set of URLs, or pasted text – that covers your product’s common questions. Every new account includes $50 in free credit, no card required, and lead capture is included on all plans. The agent will need correct, grounded answers before it can earn enough trust to ask for a visitor’s contact details. If you don’t have a full Knowledge Base Software set up yet, a single FAQ page is enough to get started.

The key prerequisite is deciding what kind of visitor you want to capture – a trial user stuck on a setup step, a buyer asking about pricing, or someone comparing features. The lead capture flow only triggers when you define a rule, so a rough idea of when it should fire makes setup faster.

Step-by-step setup

1. Create an agent and feed it your content

From the dashboard, create a new agent and give it a name that matches your site or product. Then upload your knowledge base content: add the URL of your help centre, upload PDF guides, or paste in your FAQ text. The agent will learn from only this material and never guess from the web. Give it a few minutes to process – large PDFs may take longer, but small sites finish in under a minute.

2. Turn on lead capture and set the trigger

In the agent’s settings, enable Lead Capture. You’ll see a prompt field where you define when and how the agent asks for details. The default trigger fires after the agent answers a question, but you can narrow it:

  • Ask only after the second user message, so the visitor sees a helpful answer first.
  • Ask only when a question contains pricing-related terms like “pricing”, “cost”, or “enterprise”.
  • Ask after a specific number of messages if the visitor hasn’t closed the chat.

Write a short prompt such as: “If the visitor asks about pricing or a demo, politely ask for their name and email so our team can follow up. If they decline, continue helping.” This keeps the capture human-friendly, not pushy.

3. Customize what you collect

Choose the fields – name, email, and phone are available. You can also add a free-text note so the agent captures a quick qualifying detail, like “which feature are you most interested in?”. The fewer fields, the higher the capture rate; a name and email alone typically converts better.

4. Embed the widget on your site

Copy the snippet from the agent’s embed tab and paste it into your website’s header or footer, or wherever your knowledge base pages live. The widget loads asynchronously and won’t slow down your pages. If you use a platform like Webflow or WordPress, the snippet works in any custom-code block.

5. Review the agent’s answers (optional but useful)

Before promoting the widget, test the agent in the playground. Ask it a few real support questions from your logs. If an answer feels off, refine your source documents – clearer headings and step-by-step instructions in your knowledge base produce better agent answers, which in turn raises lead capture trust.

Check it works

Open an incognito window or a different browser, visit a page where the widget is embedded, and start a conversation. Ask a question that should trigger the capture – for example, “Do you have a free trial?” or “How much does the pro plan cost?”. Confirm the agent first answers from your knowledge base, then asks for contact details in the same thread, not in a disconnected pop-up.

Once you submit test details, go to the Chatref conversation inbox. The conversation will appear under the agent, tagged with “lead” and showing the captured fields. If you don’t see it, check the lead capture rule: the trigger condition may not have matched your test question. Repeat with a different phrasing to rule out a tight keyword match.

Common issues

The agent never asks for details. This is almost always a trigger rule that’s too strict. If you set the trigger to “only after a pricing question” but the visitor asks “do you have a free trial?”, it may not fire. Widen the rule to include common variations, or use a simple “after two messages” condition while you test.

Leads come from questions the agent can’t answer. Visitors lose trust when the agent gives a wrong or vague answer. Review the chat logs to find the gap, update your knowledge base, and retrain the agent. An agent that consistently resolves the customer’s immediate need is far more likely to get a lead.

You see leads but no email. If the agent asks for details and the visitor simply closes the chat, you’ll get a partial record. To reduce drop-off, shorten the ask – just an email is often enough, and you can send a follow-up message automatically from your CRM.

Lead capture slows down the flow. Some teams worry that asking for details mid-conversation annoys users. If you see a drop in engagement, move the ask to later in the conversation or make it skippable – let the visitor type “no thanks” and continue the chat without leaving.

No leads at all after embedding. The widget might not be visible on your knowledge base pages – check for console errors or CSP policies blocking the script. Also, if your pages get very little traffic, wait a few days before judging performance.

After a few days of captures, use Chatref’s insights tab to spot which pages and questions lead to the most conversions. A spike around a particular help article can tell you exactly where to place a stronger call-to-action.

FAQ

What causes lead capture problems for Knowledge Base Software?

The two biggest causes are asking too soon – before the visitor feels helped – and relying on an agent that gives vague or incorrect answers because the knowledge base is thin. If the KB doesn’t cover the specific question someone lands on, they rarely stick around to share their email. Also, long forms or a capture ask that feels like a sales dodge rather than a helpful follow-up can drive people away.

How do I improve lead capture for Knowledge Base Software?

Start by strengthening the underlying content: every high-traffic help article should answer the question completely, with clear steps. Then test your lead capture trigger at different points – after the first answer, after two answers, or only on pricing pages. Offer something useful in exchange, like a short checklist or a case study, and phrase the ask as “so we can send you X” rather than “give us your email.” Finally, review the insights panel weekly to find which knowledge base topics produce the most captures and double down on those.

Put this into practice

Chatref answers your customers from your own content, day and night. Add it to your site and go live in minutes – free to start.

Get started