AI AgentAutomationSalesCold EmailSelf-LearningProspecting

We Built a Self-Learning AI Sales System in 48 Hours

· 42 min read

Two days ago, our prospecting pipeline looked like this:

  • 1 Agent sending emails with a fixed template
  • 19 emails sent, 0 replies
  • No idea if anyone opened them
  • No idea what our bounce rate was
  • Send and forget

Two days later, it looks like this:

  • 4 Agents, each responsible for a different product line
  • AI-personalized opening lines for every email (Gemini)
  • Real-time tracking of opens, clicks, and bounces
  • Automatic A/B testing of subject lines — winners get promoted
  • Auto-blacklisting bounced domains
  • Most importantly: it learns from its own results and gets smarter every day

Cost? $0.


The Problem: Spray and Pray

We have 4 AI products to promote: MindThread (social media automation), UltraProbe (AI security scanner), Ultra Advisor (financial advisory platform), and Agent Fleet (AI agent platform).

Our first approach was brute force: Brave Search for targets → scan their website → send a template email.

Result? 0% reply rate.

Because every email looked exactly the same. Recipients could smell the mass-send from a mile away.


Architecture: 5 Stages × 4 Agents × Self-Learning

Discover → Qualify → Scan → Outreach → Nurture
    ↑                                      ↓
    └──── Learner (analyze results, adjust strategy) ←────┘

Stage 1: Discover

Each Agent has its own Brave Search keyword set. Runs 3x daily (10:00, 15:00, 20:00), searching 3 keyword groups per run to find new SMBs.

Cross-agent dedup ensures no domain gets emailed by two different Agents.

Stage 2: Qualify

Fetches the target's HTML and extracts signals:

  • Contact email found (+30 points)
  • Matches target industry (+40 points)
  • Has title and meta description (+10 each)
  • Learned industry bonus (Learner adjusts based on open rates: +20 or -10)

Tier C and D targets are skipped — don't waste bullets.

Stage 3: Scan

Runs UltraProbe SEO and AEO scans. The scan result IS the sales material.

"Your website scored 43/100 on SEO — here are 5 issues hurting your Google ranking" is 100x more effective than "We offer SEO services."

Stage 4: Outreach (AI-Personalized Cold Email)

This is where the biggest upgrade happened.

Before: "We analyzed xxx.com.tw and found some issues." (identical for every recipient)

After: Gemini 2.5 Flash generates for each email:

  • Personalized opening (mentions specific issues on their site)
  • Custom subject line
  • Targeted P.S.

Plus 3 A/B variants running simultaneously:

Variant Strategy Example
Score Show the grade "example.tw SEO Health Check: D — Free Report"
Issue Emphasize problems "5 issues found affecting your Google ranking"
Competitor Social pressure "Your competitors outrank you in SEO"

The Learner tracks which variant gets the highest open rate and automatically increases its selection probability.

Stage 5: Nurture (Auto Follow-Up)

  • 3 days after sending, no open → resend with different subject line
  • Opened but no click after 5 days → send a case study value-add

Real-Time Tracking: Resend Webhooks

Every email's lifecycle is tracked:

Sent → Delivered → Opened → Clicked
                ↘ Bounced → Auto-blacklist
                ↘ Complained → Auto-unsubscribe

We receive Resend webhook events (Svix signature verification), write to Firestore in real-time, then:

  • 👀 Someone opened → instant Telegram notification
  • 🔥 Someone clicked → Telegram + which link they clicked
  • ❌ Bounced → auto-add to blacklist, never send again
  • 🚨 Spam complaint → auto-unsubscribe permanently

Not hourly polling. The same second it happens.


The Core Innovation: Self-Learning Engine

This is the most valuable part of the entire system.

After each pipeline run, prospect-learner.js analyzes all webhook data and writes to learned-config.json. The next pipeline run reads this config and automatically adjusts behavior.

6 Learning Modules

1. A/B Weight Auto-Adjustment

Not simple "A won, only use A." It's weighted random:

30% open rate → weight 3.0x (3× more likely to be selected)
15% open rate → weight 1.5x
 0% open rate → weight 0.1x (nearly eliminated, but keeps exploration space)

2. Smart Send Time

Tracks opens per hour (UTC+8). If 2 PM has the highest open rate, the system knows.

3. Industry Success Rates

"Restaurant industry: 5 sent, 0 opens" → next qualify score automatically -10. "E-commerce: 3 sent, 2 opens" → qualify score +20.

The system naturally shifts toward industries that convert.

4. Scoring Calibration

If Tier B prospects actually get higher open rates than Tier A, the system flags "scoring model needs recalibration."

5. Bounce Pattern Detection

If the same domain pattern (e.g., .gov.tw) bounces 3+ times, it's auto-added to the skip list.

6. Lookalike Discovery

Identifies industries with the highest open rates, suggests new search keywords to expand the target pool.


4 Agents, Clear Division of Labor

Agent Product Daily Cap Qualify/Run Scan/Run
Probe UltraProbe Security Scanner 40 60 30
MindThread Threads Automation SaaS 25 50 25
Advisor AI Financial Advisory 20 40 20
Main Agent Fleet Platform 15 30 15
Total 100/day 180 90

3 runs/day = theoretical capacity of 540 qualifications + 270 scans + 100 emails.


Dashboard: Full Visibility

The admin panel's Prospecting Panel shows real-time:

  • Conversion Funnel: Targets → Qualified → Scanned → Emailed → Replied → Converted
  • Email Performance: Sent, Delivered, Opened, Clicked, Bounced, Complaints (with percentages)
  • Per-Agent Stats: Each Agent's funnel data
  • Recent Emails: Latest sent emails with status icons

All updated in real-time, no waiting for daily reports.


Daily Telegram Report

Every night at 8 PM, an auto-generated Telegram report:

🦞 4-Agent Daily Report (2026-03-21)

Probe: 12 emails
  → sinyi.com.tw
  → lativ.com.tw
  → accupass.com
  ...
MindThread: 8 emails
  → dalang.tw
  → eztable.com
  ...

Total: 25 emails
Global sent: 63 domains

Not just numbers — exactly who was emailed.

The Learner also sends its own report:

🧠 Learner Report #3

📊 A/B Winners:
  probe: score (2.4x)
  mindthread: fomo (3.0x)

🏭 Top Industries:
  ecommerce: 35% open (12 sent)
  education: 28% open (7 sent)

⏰ Best Hour: 14:00
🚫 Bounce patterns: 2

Gen 3

Cost Structure

Item Cost
Resend email $0 (free 100/day)
Gemini personalization $0 (free 200/day)
UltraProbe scans $0 (our own product)
Brave Search $0 (free API)
Firestore $0 (within free quota)
Vercel serverless $0 (Hobby plan)
Human labor $0 (fully autonomous)
Total $0/month

Tech Stack

  • Engine: Node.js (prospect-engine.js, 776 lines)
  • Learner: Node.js (prospect-learner.js, 344 lines)
  • Webhook: TypeScript Vercel Serverless (resend-webhook.ts, 418 lines)
  • Frontend: React + TypeScript (ProspectingPanel.tsx, 350 lines)
  • AI: Gemini 2.5 Flash (personalization) + Ollama 7B (reply classification)
  • Data: Firebase Firestore
  • Notifications: Telegram Bot API + Resend Webhooks (Svix)
  • Deployment: Vercel + WSL2 systemd timers

What's Next

The system is live and running. Now we let the data accumulate and observe the Learner's curve.

Metrics we're watching:

  • A/B winner stability by Generation 10
  • Whether industry preferences converge
  • Whether bounce rate keeps declining
  • Whether optimal send time stabilizes

This isn't a static sales tool. It's a system that evolves.

Every run, it learns a little more about what works and what doesn't. No one needs to tell it what to change — it reads the data and adjusts its own parameters.

This is what we believe AI sales systems should look like.


Built by Ultra Lab — the company that builds AI products with AI.

Want a free scan of your website? ultralab.tw/probe

Weekly AI Automation Playbook

No fluff — just templates, SOPs, and technical breakdowns you can use right away.

Join the Solo Lab Community

Free resource packs, daily build logs, and AI agents you can talk to. A community for solo devs who build with AI.

Need Technical Help?

Free consultation — reply within 24 hours.