LeadWise — AI Lead Qualification Engine
AI-powered lead qualification engine · Two verticals: Banking & Travel
Complete BA Specification Case Study · Business Analyst
| Author | Zahra · Business Analyst |
| Verticals | 🏦 Banking · ✈️ Travel |
| Code | GitHub — zahraeh/LeadWise |
| Version | v1.0 · 2026 |
| Status | Portfolio · Sample/fictional data |
Business Context & Problem Statement
BankWise Retail is a fictional French retail bank positioned on the digital-first segment. As part of its seasonal campaign Livret A Boosté — Spring 2025, the bank generates several thousand marketing leads per week through its digital channels (Google Ads, email, comparison sites, push notifications).
This entire flow is currently processed manually by branch advisors, with no prioritization tool or structured GDPR compliance system.
Diagnosis of Pain Points
| Identified Pain Point | Operational Impact |
|---|---|
| 100% manual processing of inbound leads | Total dependency on human effort, frequent data-entry errors |
| Callback delay exceeding 72h | Loss of "Hot" leads to direct competitors |
| Conversion rate below 8% | Estimated lost revenue of +€30K/month |
| No scoring or prioritization | Overloaded advisors, poor resource allocation |
| GDPR compliance not under control | Risk of CNIL sanctions and regulatory disputes |
| No traceability of consents | Maximum exposure in the event of an external audit |
Average contact delay (leading banks): 4h
Conversion rate: 12–20%
Automated scoring: standard practice at 78% of digital banks
Project Objectives
| # | Objective | Target |
|---|---|---|
| OBJ-1 | Reduce processing time | < 24h |
| OBJ-2 | Improve conversion rate | 15% |
| OBJ-3 | Automate scoring | 100% |
| OBJ-4 | Ensure GDPR compliance | 0 CNIL non-conformities |
| OBJ-5 | Centralize tracking in Salesforce | 100% tracked |
| OBJ-6 | Contact 80% of leads within 48h | 80% |
Project Framing — Scope & Governance
Functional Scope
✅ In Scope
- Lead capture and qualification
- Consent management & GDPR traceability
- Automatic AI scoring (Claude API)
- Automatic assignment to advisors
- Full lead lifecycle tracking
- Real-time KPI dashboard
- Automatic deduplication
❌ Out of Scope
- Existing customer management
- Online subscription module
- Financial reporting / accounting
- Banking back-office integration
- Native mobile application
- Complaints management
- Customer loyalty module
Regulatory & Legal Constraints
| Reference | Requirement | Criticality |
|---|---|---|
| GDPR Art. 6 | Explicit consent required on every submission | CRITICAL |
| GDPR Art. 17 | DELETE /leads/{id} endpoint operational within 72h | CRITICAL |
| GDPR Art. 21 | Opt-out → immediate stop + data anonymization | CRITICAL |
| CNIL · Retention | Automatic deletion after 3 years if not converted | MAJOR |
| AML-CFT | KYC verification before any commercial offer | MAJOR |
| PSD2 | Encryption of banking data in transit and at rest | MAJOR |
RACI Matrix
| Stakeholder | Role | Framing | Specs | Tests | UAT |
|---|---|---|---|---|---|
| Marie Dupont | Product Owner | A | A | I | A |
| Jean-Marc Lefebvre | Marketing Lead | C | C | I | R |
| Sophie Arnaud | GDPR Counsel | C | R | C | A |
| Romain Petit | Tech Lead | I | C | R | I |
| Zahra ★ | Business Analyst | R | R | R | R |
R = Responsible · A = Accountable · C = Consulted · I = Informed
Functional Specifications
Business Rules
| ID | Description | Priority |
|---|---|---|
| RG-001 | Consent required — no lead is processed without explicit opt-in | CRITICAL |
| RG-002 | Score < 3 → Cold segment → automatic nurturing sequence | CRITICAL |
| RG-003 | Score ≥ 7 → advisor contacts within 24h (SLA) | CRITICAL |
| RG-004 | Prospect data deleted after 3 years if not converted | CRITICAL |
| RG-005 | Opt-out → immediate stop + anonymization | CRITICAL |
| RG-006 | Lead assigned to the advisor at the nearest branch (postal code) | MAJOR |
| RG-007 | Duplicate (email OR phone) → silent merge + log | MAJOR |
| RG-008 | Consent date/time archived in the database (audit trail) | CRITICAL |
| RG-009 | Score 4–6 → advisor assignment within 48h | MAJOR |
| RG-010 | Every AI call logged with input/output for audit | MAJOR |
User Stories — BDD Format
"As a prospect interested in the Livret A Boosté offer, I want to fill out an online form so that I can be contacted by a BankWise advisor."
- Required fields: Last Name, First Name, Email, Phone, Postal Code, Source
- Explicit, mandatory GDPR checkbox — submission blocked if unchecked
- Automatic confirmation email within 5 minutes
- Lead created in Salesforce with status "Prospect"
- Consent timestamp archived (RG-008)
- Duplicate detection on email AND phone (RG-007)
"As a marketing manager, I want every new lead to be automatically scored by AI so that I can prioritize outreach."
- Score computed on a 1–10 scale in under 3 seconds
- Weighted criteria: source (25%), web behavior (20%), age (20%), postal code (20%), time of day (15%)
- Classification: Cold (1–3) / Warm (4–6) / Hot (7–10)
- Score and AI justification visible in Salesforce within 2 minutes
- Scoring log retained (input, output, timestamp) for auditability
"As a branch manager, I want qualified leads to be automatically assigned to an available advisor."
- Assignment based on geolocation (postal code) AND workload
- Advisor notification: email + Salesforce alert upon assignment
- Priority queue if no advisor is available within the SLA
- Hot SLA: 24h | Warm SLA: 48h
"As a prospect, I want to be able to withdraw my consent at any time via an unsubscribe link."
- Unsubscribe link present in every marketing email
- Opt-out request processed and confirmed within 72h (GDPR Art. 21)
- Immediate stop of all marketing communications upon opt-out
- Data anonymized (retained only if legally required under AML-CFT)
"As a marketing manager, I want to view my campaign performance indicators in real time."
- Lead volume, conversion rate, opt-in rate, average contact delay
- Data refreshed every 60 minutes — filters: campaign, date, channel, segment
- CSV export available for external analysis
"As an advisor, I want to avoid receiving the same prospect twice in my pipeline."
- Detection on email AND phone for every new submission
- Silent merge: enrichment of the existing lead record
- Notification to the original advisor with a diff of the information
Technical Architecture & AI Agent
Technology Stack
Streamlit
Frontend — form & KPI dashboardFastAPI
Backend — REST API, flow orchestrationClaude API
claude-sonnet — AI scoring & justificationPydantic v2
Schema validation & business rulesSalesforce
Simulated CRM (JSON) — leads & assignmentsLocust
Perf. testing — 50/200/500 concurrent usersData Flow — End-to-End Architecture
Streamlit — Form
Prospect submits contact details + GDPR consent
FastAPI — POST /leads <0.5s
Pydantic validation, consent timestamp, deduplication
Claude API — AI Agent <3s
Profile analysis, 1–10 score calculation, text justification
FastAPI — Assignment Engine <0.5s
Advisor selection (geo + workload), SLA creation
Salesforce Mock — CRM <0.5s
Lead record created with score, segment, assigned advisor
Email + Notification <5 min
Prospect confirmation + advisor alert (email + CRM)
AI Scoring Matrix
| Criterion | Weight | Max Score | Min Score |
|---|---|---|---|
| Lead source | 25% | Direct email form | Unsolicited push notification |
| Web behavior | 20% | 3+ visits > 5 min | 0 product page visits |
| Age bracket | 20% | 25–45 years | <18 or >65 years |
| Geographic area | 20% | Paris, Lyon, Bordeaux | Isolated rural area |
| Submission time | 15% | Mon–Fri 9am–6pm | Night or weekend |
Segment Classification
API Endpoints — FastAPI
| Method | Endpoint | GDPR Constraint |
|---|---|---|
| POST | /leads | Consent verified |
| GET | /leads | Token required |
| GET | /leads/{id} | Token required |
| POST | /leads/{id}/score | Token required |
| PUT | /leads/{id}/statut | Token required |
| DELETE | /leads/{id} | Admin + mandatory logging |
| GET | /dashboard/kpis | Token required |
| POST | /leads/{id}/optout | No token required |
Test Strategy & Validation Results
Overview
| Level | Tool | Coverage | Status |
|---|---|---|---|
| Unit tests | pytest | 90% of code | DONE |
| Integration tests | pytest + httpx | All endpoints | DONE |
| Functional tests | Squash TM | 6 US / 10 BR | IN PROGRESS |
| GDPR tests | Squash TM | 6 GDPR articles | IN PROGRESS |
| UAT tests | Excel / Notion | 5 scenarios | TO SCHEDULE |
| Performance tests | Locust | 3 load scenarios | TO SCHEDULE |
Functional Test Cases
| ID | Title | Status |
|---|---|---|
| CT-001 | Valid form submission | PASSED |
| CT-002 | Blocked without GDPR consent | PASSED |
| CT-003 | Invalid email blocked (422) | PASSED |
| CT-004 | Hot lead scoring (score ≥ 7) | PASSED |
| CT-005 | Cold lead scoring (score ≤ 3) | PASSED |
| CT-006 | Automatic advisor assignment | TO RUN |
| CT-007 | GDPR opt-out via email link | TO RUN |
| CT-008 | Duplicate detection (same email) | TO RUN |
| CT-009 | Dashboard CSV export | TO RUN |
KPI Tracking & Delivery Summary
Target KPI Dashboard
| Indicator | Baseline | Target | Current Result |
|---|---|---|---|
| Lead → opportunity conversion rate | <8% | 15% | To be measured |
| Lead processing time | >72h | <24h | ~45s ✔ |
| Leads contacted within 48h | — | 80% | To be measured |
| Opt-in consent rate | — | 60% | To be measured |
| AI scoring response time | — | <3s | ~1.8s ✔ |
| System availability | — | >99% | To be measured in prod |
BA Skills Demonstrated
Business Context & Problem Statement
LinguaWise International is a fictional language-travel agency, inspired by the EF Education First model. Its flagship campaign, Intensive English Course — Summer 2025, generates several thousand prospect inquiries per week via Google Ads, travel comparison sites, web forms and social media.
These leads are currently processed manually by travel advisors, with no prioritization or structured pipeline. The conversion rate stalls below 10%, well behind the sector's leading players.
Diagnosis of Pain Points
| Identified Pain Point | Operational Impact |
|---|---|
| 100% manual processing of inbound inquiries | Assignment errors, frequent oversights, uneven workload |
| Callback delay exceeding 72h | Loss of hot leads to competitors (EF, Kaplan) |
| Conversion rate below 10% | Estimated lost revenue of +€25K/month |
| No scoring or prioritization by destination/budget | Generalist advisors instead of destination specialists |
| GDPR compliance not structured | CNIL risk on sensitive data (minors, passports) |
| No prospect lifecycle tracking | Follow-ups based on gut feeling, no nurturing sequence |
Sector benchmark: conversion rate 15–25%
Project Objectives
| # | Objective | Target |
|---|---|---|
| OBJ-1 | Reduce callback delay | < 24h |
| OBJ-2 | Improve conversion rate | 18% |
| OBJ-3 | Automate AI scoring | 100% |
| OBJ-4 | Ensure GDPR compliance | 0 CNIL non-conformities |
| OBJ-5 | GDPR opt-in rate | 65% |
| OBJ-6 | Contact 85% of leads within 48h | 85% |
Project Framing — Scope & Governance
Functional Scope
✅ In Scope
- Prospect capture and qualification
- Consent & GDPR traceability
- AI scoring by destination and profile
- Assignment to the specialist advisor
- Full lead lifecycle tracking
- Real-time KPI dashboard
- Automatic deduplication
❌ Out of Scope
- Online booking and payment
- Visa and passport management
- Accommodation / housing module
- Native mobile application
- Existing customer management
- Loyalty module
- Accounting back-office
Regulatory & Legal Constraints
| Reference | Requirement | Criticality |
|---|---|---|
| GDPR Art. 6 | Explicit consent required — minor prospects require parental consent | CRITICAL |
| GDPR Art. 17 | DELETE /leads/{id} endpoint operational within 72h | CRITICAL |
| GDPR Art. 21 | Opt-out → immediate stop + data anonymization | CRITICAL |
| CNIL · Retention | Automatic deletion after 3 years if not converted | MAJOR |
| Sensitive data | Passport/ID data collected only at booking, not at lead stage | MAJOR |
RACI Matrix
| Stakeholder | Role | Framing | Specs | Tests | UAT |
|---|---|---|---|---|---|
| Sarah Morel | Product Owner | A | A | I | A |
| Antoine Lebrun | Marketing Lead | C | C | I | R |
| Claire Vidal | GDPR Counsel | C | R | C | A |
| Karim Benali | Tech Lead | I | C | R | I |
| Emma Rousseau | Sr Travel Advisor | C | C | R | R |
| Zahra ★ | Business Analyst | R | R | R | R |
R = Responsible · A = Accountable · C = Consulted · I = Informed
Functional Specifications
Business Rules
| ID | Description | Priority |
|---|---|---|
| RG-T01 | Consent required — parental consent required if prospect < 18 years old | CRITICAL |
| RG-T02 | Score < 4 → Cold segment → automatic email nurturing sequence | CRITICAL |
| RG-T03 | Score ≥ 7 → destination specialist advisor contacts within 24h (SLA) | CRITICAL |
| RG-T04 | Prospect data deleted after 3 years if not converted | CRITICAL |
| RG-T05 | Opt-out → immediate stop of all communications + anonymization | CRITICAL |
| RG-T06 | Lead assigned to the specialist advisor for the chosen destination | MAJOR |
| RG-T07 | Duplicate (email OR phone) → silent merge + log + advisor notification | MAJOR |
| RG-T08 | Consent timestamp archived (GDPR audit trail) | CRITICAL |
| RG-T09 | Score 4–6 → advisor assignment within 48h | MAJOR |
| RG-T10 | Average AI score < 6 for a destination → alert to marketing manager | MAJOR |
User Stories — BDD Format
"As a prospect interested in a language-immersion trip, I want to fill out an online form so that I can be contacted by a LinguaWise advisor specializing in my destination."
- Required fields: Last Name, First Name, Email, Phone, Destination, Duration, Budget, Desired Date
- Explicit GDPR checkbox — parental consent mandatory if age < 18
- Automatic confirmation email within 5 minutes
- Lead created in Salesforce with destination and budget segment
- Consent timestamp archived (RG-T08)
"As a marketing manager, I want every prospect to be automatically scored based on their profile and destination so that I can prioritize advisors."
- Score computed on a 1–10 scale in under 3 seconds
- Criteria: source (25%), departure urgency (20%), budget (20%), traveler profile (20%), time of day (15%)
- Classification: Cold (1–3) / Warm (4–6) / Hot (7–10)
- AI justification visible in Salesforce within 2 minutes (e.g., "Budget > €3,000, departing in 6 weeks")
"As a sales director, I want every lead to be automatically assigned to the advisor who is an expert in the requested destination."
- Assignment based on chosen destination AND advisor availability
- If specialist unavailable → escalation to the senior travel advisor (Emma Rousseau)
- Advisor notification: email + Salesforce alert upon assignment
- Hot SLA: 24h | Warm SLA: 48h (RG-T03, RG-T09)
"As a prospect, I want to be able to withdraw my consent at any time via a link in every email I receive."
- Unsubscribe link present in every communication
- Opt-out processed and confirmed within 72h (GDPR Art. 21)
- Immediate stop of all marketing communications
- Data anonymized in Salesforce CRM
"As a marketing manager, I want to view performance indicators for each destination in real time."
- Lead volume, conversion rate, average score per destination
- Filters: destination, date, channel, segment · Refreshed every 60 minutes
- CSV export for monthly reporting
"As an advisor, I want to avoid receiving the same inquiry twice for the same destination."
- Detection on email AND phone for every new submission
- Silent merge with destination/budget enrichment if changed
- Notification to the original advisor with the diff
Technical Architecture & AI Agent
Technology Stack — same as the Banking vertical
Streamlit
Travel form + KPI dashboardFastAPI
REST API — lead flow orchestrationClaude API
AI scoring — destination + profilePydantic v2
Travel business schema validationSalesforce
Simulated CRM — leads & assignmentsRender
Cloud deployment — app available onlineData Flow — End-to-End Architecture
Streamlit — Travel form
Prospect enters destination, budget, desired dates + GDPR consent
FastAPI — POST /leads <0.5s
Pydantic validation (valid destination, budget > 0, consistent dates), deduplication
Claude API — AI Agent <3s
Traveler profile analysis, departure urgency, budget — 1–10 score + text justification
FastAPI — Assignment Engine <0.5s
Selection of the destination specialist advisor + availability check
Salesforce Mock — CRM <0.5s
Lead record created with destination, score, segment, assigned advisor
Email + Notification <5 min
Confirmation email to the prospect + destination advisor alert
AI Scoring Matrix — Travel Vertical
| Criterion | Weight | Max Score | Min Score |
|---|---|---|---|
| Lead source | 25% | Direct form / referral | Untargeted social ad |
| Departure urgency | 20% | Departure < 6 weeks | Departure > 12 months |
| Stated budget | 20% | > €3,000 | < €1,000 |
| Traveler profile | 20% | Professional, 25–40 years old | Minor without parental consent |
| Submission time | 15% | Mon–Fri 9am–6pm | Night or weekend |
Segment Classification
Test Strategy & Validation Results
Overview
| Level | Tool | Coverage | Status |
|---|---|---|---|
| Unit tests | pytest | 90% of code | DONE |
| Integration tests | pytest + httpx | All endpoints | DONE |
| Functional tests | Squash TM | 6 US / 10 BR | IN PROGRESS |
| GDPR tests | Squash TM | 5 GDPR articles | IN PROGRESS |
| UAT tests | Excel / Notion | 5 scenarios | TO SCHEDULE |
| Performance tests | Locust | 3 load scenarios | TO SCHEDULE |
Functional Test Cases
| ID | Title | Status |
|---|---|---|
| CT-T01 | Valid form (destination London, budget €2,500) | PASSED |
| CT-T02 | Blocked without GDPR consent | PASSED |
| CT-T03 | Invalid email blocked (422) | PASSED |
| CT-T04 | Hot lead scoring (budget >€3K, departure <6 weeks) | PASSED |
| CT-T05 | Cold lead scoring (budget <€1K, departure +12 months) | PASSED |
| CT-T06 | Assignment to the New York specialist advisor | TO RUN |
| CT-T07 | GDPR opt-out via email link | TO RUN |
| CT-T08 | Duplicate (same email, different destination) → enrichment | TO RUN |
| CT-T09 | Parental consent required if age < 18 | TO RUN |
KPI Tracking & Delivery Summary
Target KPI Dashboard
| Indicator | Baseline | Target | Current Result |
|---|---|---|---|
| Lead → booking conversion rate | <10% | 18% | To be measured |
| Advisor callback delay | >72h | <24h | ~45s ✔ |
| Leads contacted within 48h | — | 85% | To be measured |
| Opt-in consent rate | — | 65% | To be measured |
| Average qualified score (≥ 6/10) | — | ≥ 6 | To be measured |
| AI scoring response time | — | <3s | ~1.8s ✔ |
BA Skills Demonstrated
Appendices — Business & CRM Glossary
- Lead CRM
- A prospect who has expressed commercial interest and provided explicit GDPR consent
- Opt-in GDPR
- A prospect's explicit, informed consent to have their data processed for marketing purposes
- Opt-out GDPR
- The act by which a prospect withdraws consent — triggers the immediate stop of all processing
- Scoring AI / CRM
- Assigning a 1–10 score that assesses a lead's maturity and conversion potential
- Hot Segment CRM
- Lead with score ≥ 7 — contact SLA: 24h — priority advisor assignment
- Warm Segment CRM
- Lead with score 4–6 — contact SLA: 48h — standard processing
- Cold Segment CRM
- Lead with score 1–3 — no assignment — automatic nurturing sequence
- Nurturing Marketing
- A sequence of automated communications designed to mature a lead toward purchase readiness
- White-label Product
- Architecture that lets the same LeadWise engine be deployed into a new industry via config.py alone
- SLA Contract
- Service Level Agreement — a committed level of service (e.g., contact within 24h)
- RACI Governance
- A responsibility-assignment matrix: Responsible, Accountable, Consulted, Informed
- Audit trail Compliance
- A traceability log that allows the full history of every system action to be reconstructed
Want to know more?
Check out the source code, the Notion documentation, or my other projects.