You are a senior AI automation architect and lead-generation systems engineer.
I want to build a safe, quality-first lead-generation system for an AI web design or automation agency. The goal is not to scrape random leads and spam them. The goal is to find businesses that have a real website gap, qualify them carefully, and route them into manual review before any outreach happens.
Design the system with two lead lanes:
Lane 1: Google Maps No-Website ProspectorFind local businesses that:
- appear on Google Maps or a similar local search source
- have a meaningful number of reviews
- have a real phone/address/category signal
- appear to have no owned website
- are relevant to the search query
- are likely to be real active businesses
This lane should not assume email is available. Route leads into:
- Qualified_Phone_Review
- Needs_Enrichment
- Manual_Review
- Suppressed
Do not force these into email outreach unless enrichment finds a real contact email.
Lane 2: Slow Website / PageSpeed ProspectorFind businesses that:
- already have an owned website
- have a valid contact email
- have a slow or weak mobile website
- have a commercial reason to improve the website
- are not a directory, booking platform, article, association profile, or weak ICP lead
Use PageSpeed or similar audit evidence, but translate technical metrics into business pain:
- visitors leaving before calling
- mobile visitors not waiting
- missed quote requests
- weaker trust compared to competitors
- local search opportunity loss
Design the architecture with these components:
- Lead intake.
- Deduplication.
- Email validation.
- Query relevance scoring.
- Owned-site detection.
- Third-party platform detection.
- ICP and commercial-fit detection.
- PageSpeed audit.
- Lead scoring.
- Suppression logic.
- Manual approval routing.
- Source run logging.
- Dry-run mode.
- Gmail draft mode, disabled by default.
- Autonomous sending, disabled by default.
Required feature flags:
- TOFU_QUALIFICATION_ENABLED
- TOFU_MAPS_DRAFT_MODE=dry_run
- TOFU_PAGESPEED_DRAFT_MODE=dry_run
- TOFU_DEFAULT_SENDING_PROVIDER=manual_queue
- TOFU_AUTONOMOUS_SENDING_ENABLED=false
- TOFU_EMAIL_PROSPECT_ON_MANUAL_DEMO=false
- TOFU_ROLE_EMAIL_POLICY=deprioritize
- PAGESPEED_TIMEOUT_SECONDS=90
Required safety rules:
- Never send emails automatically.
- Never create batch Gmail drafts until dry-run data is reviewed.
- Never build demos automatically unless a reply is high intent or I manually approve it.
- Never write last_email_copy unless a draft is successfully created.
- Never log API keys or secret query parameters.
- Every qualification run must be inspectable in the database.
Design the data model or database fields for:
- normalized_status
- lead_score
- score_breakdown
- qualification_reason
- suppression_reason
- campaign_key
- outreach_channel
- sending_provider
- send_mode
- source_query
- source_run_id
- source_quality_score
- intent_label
- intent_score
- demo_status
- demo_last_triggered_at
Deliver:
- Recommended architecture.
- Database fields.
- Status system.
- Scoring logic.
- Suppression rules.
- Feature flags.
- Dry-run flow.
- Gmail draft flow.
- Test plan.
- Rollout plan.
- Rollback plan.
- Example pseudocode for both lead lanes.
Do not write production code until I approve the plan.