Loading...

Z.

Autonomous AI Agents

AI Lead Engine — Autonomous 4-Agent Pipeline

Autonomous 4-agent outbound system (Alex, Sarah, Marcus, Chloe) that discovers leads from Google Maps, verifies SEO/chatbot gaps, and sends personalized AI emails on autopilot.

AI Lead Engine — Autonomous 4-Agent Pipeline

Case Study Overview

Value & Architecture Breakdown

1. Problem

Manual B2B lead prospecting, lead audit, and cold email outreach require enormous human labor and deliver poor response rates.

2. Solution

Designed a multi-agent orchestration pipeline using Playwright crawlers, PostgreSQL/BullMQ queue management, and OpenAI cold outreach generation.

3. Tech Stack

TypeScriptNext.js 15React 19Tailwind CSSPrismaPostgreSQLBullMQRedisPlaywrightCheerioOpenAI SDKNodemailerNextAuth.jsZustandZodDockerRadix UIRecharts

4. Business Impact

Processes 100+ qualified business leads per job automatically without human intervention.

Need an AI system tailored to your business?

Let's discuss custom AI automation, agents, or SaaS development.

Contact on WhatsApp →

System Architecture

Four agents, one pipeline

The system runs as a fully automated pipeline. Alex discovers leads (including social activity checks), Sarah qualifies them, Marcus reaches out via email, and Chloe handles social outreach — all without manual intervention. Each job processes hundreds of leads on a schedule you control.

🔍

Alex

Lead Collector

Scrapes Google Maps Business Profiles looking for businesses with 1–2 reviews, collects their name, review count, email, website, and social handles. Verifies whether their social accounts are active — checks if they posted in the last 2 days. If a business has a website but no email, Alex scrapes the site to extract it.

100 leads per job · 1–7 concurrent crawlers · Social activity check
Alex lead collection interface

Sarah

Lead Verifier

Takes Alex's leads and verifies each one for SEO readiness, page speed performance, design quality, and whether they have a chatbot. Assigns qualification tags so the right outreach angle is used.

100 leads verified per job
Sarah auditing leads interface
✉️

Marcus

Email Outreach

Crafts personalized emails for each verified lead using OpenAI. Sends through the user's chosen email provider — professional SMTP or Gmail — with human-like delivery timing to maximize open rates.

Personalized via OpenAI · Custom SMTP or Gmail
Marcus email outreach interface
🔒 In Progress
📱

Chloe

LOCKED

Social Outreach

Takes verified leads and sends personalized direct messages over Instagram and LinkedIn. Uses the social handles collected by Alex to engage leads on their active platforms with AI-crafted messaging.

Instagram DMs · LinkedIn messages · AI-personalized
This module is under development — core architecture is built but not yet deployed.
🔒 Under Development

How it all connects

Step 1

Alex crawls GMB for leads + social activity → stores in PostgreSQL via Prisma

Step 2

Sarah verifies each lead → BullMQ queue processes verification jobs

Step 3

Marcus generates + sends emails → OpenAI crafts copy, Nodemailer delivers

LOCKED

Step 4

Chloe sends social DMs → Instagram + LinkedIn outreach (under development)

Full Tech Stack

Every tool that powers this system

A comprehensive breakdown of all languages, frameworks, libraries, and services used.

Languages

TypeScript

All app code, server actions, API routes, worker services & automation engines

TSX / JSX

React components and pages (Next.js App Router)

Prisma Schema

Database modeling

Framework

Next.js 15

Full-stack React framework (App Router, API routes, server actions)

React 19

UI rendering

UI & Styling

Tailwind CSS 3.4

Utility-first CSS framework

Radix UI

Headless accessible UI primitives (avatar, dialog, dropdown, tabs, toast, etc.)

Framer Motion 11

Animations & transitions

Lucide React

Icon library

Recharts

Data visualization & charting

Data & State

TanStack React Query 5

Server state & async data fetching

TanStack React Table 8

Headless data table

Zustand 5

Client-side state management

Zod 3

Schema validation & type inference

Backend & Database

Prisma 6

ORM + schema migrations + type-safe database client

PostgreSQL

Production database (via Docker Compose)

SQLite

Local dev database

Authentication

NextAuth.js v5

Authentication framework with Prisma adapter

bcryptjs

Password hashing

jose

JWT / JWS handling

Job Queue & Background Processing

BullMQ 5

Redis-backed job queue for background tasks

ioredis

Redis client

Web Scraping & Automation

Playwright

Browser automation (headless Chromium) for GMB scraping

Cheerio

HTML parsing & DOM manipulation for email extraction

Email & Outreach

Nodemailer

SMTP email sending (professional email or Gmail)

imap / imap-simple

IMAP email reading (inbox monitoring)

AI

OpenAI SDK

GPT integration for personalized email content generation

DevOps & Utilities

Docker

Containerized deployment (Docker Compose)

date-fns

Date manipulation

pino

Structured JSON logging

p-limit

Concurrency control

Key Technologies

The tools that powered this project

TypeScriptNext.js 15React 19Tailwind CSSPrismaPostgreSQLBullMQRedisPlaywrightCheerioOpenAI SDKNodemailerNextAuth.jsZustandZodDockerRadix UIRecharts

Achievements

Measurable impact

100 leads analyzed per job across 1–7 concurrent crawlers
Automated SEO/speed/chatbot verification pipeline
Personalized email generation via OpenAI with human-like delivery