LeadHub
AI PlatformPersonal AI command center: agent platform, CRM, and analytics cockpit on one serverless backend
Overview
LeadHub is the platform that powers my personal AI infrastructure: a React 19 + Supabase application running 48+ production edge functions for AI agents, lead management, email automation, billing, and analytics. Its most visible component is the Justin AI widget — the chat agent running live on this website, answering questions about my work and booking appointments in real time.
The Challenge
Running multiple AI agents in production raises hard platform questions: how to switch between AI providers per agent without rewrites, how to keep long domain-specific system prompts fast and affordable, how to hand a conversation to a human mid-session, and how to connect agent output to external CRMs. Off-the-shelf automation tools solve none of this with enough control — so I built the platform myself.
The Solution
Multi-provider agent runtime
Each agent is configured with its own provider (Gemini, Claude, Mistral, or OpenAI), system prompt, and fallback chain. Domain-specific prompts run 650+ lines, with caching strategies to keep response cost and latency down.
The Justin AI widget
An embeddable chat widget — live on this site — combining canned Q&A, free AI conversation, and real-time appointment booking. Conversations stream through Supabase Edge Functions with proactive nudge triggers and a dark theme matching the host site.
HubSpot OAuth2 platform app
A verified HubSpot app (platform 2025.2) with a CRM Record Card that shows AI conversation transcripts and sync status inside HubSpot itself, including live staff takeover of an ongoing agent conversation.
CRM & lead pipeline
A full CRM sits behind the agents: leads flow in from the connected sites with a combined lead score, pipeline and MRR tracking, and Postmark email flows triggered by lifecycle status — so agent conversations turn into a managed sales pipeline automatically.
Analytics cockpit
Google Search Console, GA4, and Microsoft Clarity wired into one dashboard with real-time KPIs and anomaly alerts — one place to watch every property I run.
Key Features
Agent Runtime
Per-agent provider config with multi-model fallback
HubSpot App
OAuth2 platform app with CRM Record Card integration
RAG on pgvector
Knowledge bases ground every agent's answers
Email Automation
Postmark-driven flows triggered by lead lifecycle
Stripe Billing
Subscription and checkout handling on edge functions
Analytics Cockpit
GSC + GA4 + Clarity unified with anomaly alerts
Results
48+ Supabase Edge Functions running in production
One Supabase backend serves three sites: this portfolio, crewvee.com, and LeadHub itself
The Justin AI widget answers visitors on this site 24/7 — try it
HubSpot integration verified end-to-end, including live human takeover
Four AI providers orchestrated behind one agent configuration model