Case Study · Web

AI-Powered Lead Qualification System

AI-Powered Lead Qualification System - case study by The Code Vendor

AI agent that auto-scores and routes inbound leads for a SaaS company, cutting response time from hours to minutes.

Engagement brief TCV
Sector
Web
Stack
Laravel · OpenAI API · Python · Webhook Integrations · MySQL
Outcome
Lead response time dropped from 4 hours to under 5 minutes. Sales team conversion rate improved by 35% in the first quarter after launch.

01 Background

The client sells software to other businesses, and like most SaaS companies at that stage, growth depended on inbound interest rather than outbound calling. Demo requests, trial signups and contact form submissions all landed in the same queue, and a small sales team worked through them roughly in the order they arrived.

That works while volume is low. It stops working as soon as the queue is longer than the team can read carefully. Every lead looks identical in a CRM list: a name, a company, an email address and a timestamp. Nothing in that view separates a procurement lead with budget approval from a student researching an assignment. The only way to tell was to open each one, look up the company, read what the person had written, and form a judgement.

Done properly that takes a few minutes per lead. Across a day's inbound it becomes most of somebody's morning spent on triage rather than selling. The work also degrades under exactly the conditions where it matters most: when the queue is long, the research gets skipped and leads get judged on a glance at the company name.

The cost showed up in two places. The first is speed. Buyers who submit an enquiry for business software are usually evaluating several vendors at once, and the first credible reply tends to shape the conversation that follows. A lead answered four hours later is often answered into a decision that has already moved on. The second is selection. When triage is rushed, attention goes to the leads that look impressive on the surface, and genuinely high-intent buyers with unremarkable company names sit in the queue.

The team could always identify the leads they wished they had reached sooner, because hindsight made them obvious. What they could not do was recognise them in the first five minutes, consistently, several dozen times a day.

02 The Problem

A SaaS company sales team spent hours manually reviewing and scoring inbound leads, causing slow follow-ups and missed high-intent prospects.

03 What We Built

Built an AI agent using OpenAI that automatically scores leads, categorizes them by intent, and routes each to the right sales rep based on company profile and behaviour signals.

04 How We Built It

The system sits between the forms that collect leads and the CRM the sales team works from. Leads arrive over webhooks, so a submission reaches the application the moment it is made rather than waiting for a scheduled import. Laravel handles the application layer and the queue, a Python service handles enrichment, the OpenAI API performs the scoring and intent categorisation, and MySQL stores the result alongside the reasoning behind it.

The ordering matters more than any individual component. A webhook has to answer quickly and scoring is the slow part, so scoring never happens inside the request. The webhook records the lead and returns immediately; scoring runs on a queue straight afterwards. That keeps the forms fast, and more importantly it means a slow or unavailable model can never block a lead from being captured in the first place.

Three decisions decide whether a system like this earns a sales team's trust, and all three are about failure rather than accuracy.

The first is consistency. A model asked to judge a lead in open-ended terms will give slightly different answers to the same input on different days. Scoring has to run against a fixed rubric with defined bands, so that the same lead scored twice lands in the same band, and so a rep can see why something scored as it did instead of being handed an unexplained number.

The second is safe failure. If the model is unavailable, or returns something that cannot be parsed, the lead still has to reach a human. The dangerous failure mode of a system like this is not a wrong score, it is a lead that quietly disappears. Anything that cannot be scored confidently is routed as normal rather than dropped or guessed at.

The third is that the score advises and never decides. It changes the order a queue is worked in and which rep a lead reaches. It does not close leads, delete them, or mark them unqualified. Sales teams abandon tools that hide opportunities from them, and a scoring system allowed to discard leads only has to be wrong once in an expensive way.

The rubric itself was built to be changed. What counts as a good lead is a commercial judgement rather than a technical one, and it moves as the product and the target market move, so the criteria stay editable rather than baked into code.

05 Impact for the Client

Sales reps now focus only on high-intent leads. The team closed 40% more deals in the same time period without increasing headcount.

Building something similar? See how we approach AI development for SaaS and e-commerce, or hire senior engineers for your own build.

Have a similar problem to solve?

Tell us what you are building and we will scope it with you on a free call.

Start a Conversation