Lead OG
Architected a high-velocity B2B AI solution for lead organization that automates deep prospect research and CRM synchronization. Implemented a custom storage engine for faster session caching and seamless bulk management for Freshsales.
2 Months
Lead Architect / Full-Stack Engineer
B2B Sales Teams & SDRs
The Problem
In B2B outbound sales, timing and personalization are everything. However, the sales development team faced a massive bottleneck: lead data was scattered across multiple landing pages, Google AdWords campaigns, and LinkedIn lead forms, resulting in fragmented lists with zero standardization.
Manual research was a slow, error-prone chore. SDRs spent hours searching for prospect details, copy-pasting info, and checking for duplicates. Crucially, basic lead lists lacked deep contact context—often missing verified LinkedIn profiles, direct phone lines, and target company initiatives.
With lists stored across separate spreadsheets, disconnected session management led to duplicate CRM records and outdated context, directly impacting overall outbound performance.
The Approach
We needed to transition from manual, error-prone data entry to a centralized, automated lead ingestion and matching workspace.
The core requirement was building a robust matching system that could parse messy CSV uploads, check them against thousands of existing CRM contacts in real time, and pass them into an automated enrichment pipeline.
To ensure high user adoption, the UI needed to handle messy inputs gracefully—warning users about custom CSV delimiters, preventing bad data types (e.g. invalid dates or numbers) from reaching the CRM, and mapping custom CRM fields to intuitive, type-safe inputs dynamically.
The Enrichment Pipeline
To empower SDRs with high-fidelity context, I engineered a multi-stage asynchronous enrichment pipeline deployed as a Supabase Edge Function.
First, the pipeline queries the Apollo API to fetch structural metadata, including direct phone lines, verified work emails, target job titles, and company demographics (size, industry, and annual revenue).
Second, it invokes the Firecrawl API to perform targeted web searches and scrape the prospect's company website, extracting real-time business signals, recent press releases, and strategic initiatives.
Finally, the aggregated Apollo profiles and Firecrawl scrapes are fed into the Gemini LLM. Gemini analyzes ideal customer fit, extracts relevant custom tags, pinpoints organizational pain points, and drafts hyper-personalized outbound copy optimized for high read and reply rates.
- • Direct Business Email
- • Verified Cell/Work Phone
- • Full Job Title & Location
- • Organization size & revenue
- • Crawl official company sites
- • Extract recent brand initiatives
- • Identify current strategic pains
- • Scrape context-aware details
- • Score Ideal Customer Profile fit
- • Pull matching tags dynamically
- • Summarize prospect pain points
- • Draft custom outbound templates
Technical Architecture
To power the matching engine, I built a weighted similarity matching algorithm that scores data overlaps. Exact matches receive a score of 100, while fuzzy matches (60%-84% token overlap) are flagged for human review. To maximize accuracy, the algorithm awards scoring bonuses (+20 for person+company alignment and +15 for surname+company matches).
To prevent redundant API calls and manage external rate limits, I implemented a robust database and session caching layer (readPersonCache/writePersonCache). This stores enriched schemas and CRM contact metadata locally with a strict expiry mechanism.
The entire app runs on a fast client-server flow. A Supabase Postgres database stores import jobs and row states, secured with Row Level Security (RLS). A secure Edge Function proxy manages high-throughput, rate-limited requests to the Freshsales CRM API.
Results & Impact
Deploying the Lead OG workspace transformed the lead management pipeline. Automated CSV parsing and matching, combined with the enrichment pipeline, reduced manual lead enrichment times by 95%, allowing SDRs to contact prospects in minutes rather than days.
Duplicate records were completely eliminated, protecting CRM integrity and preventing embarrassing double-outreach situations.
Most importantly, because SDRs had instant access to rich, enriched prospect context and AI-drafted copy, outreach personalization scaled dramatically. This resulted in a 40% increase in email read rates and a 25% bump in customer response rates.
Impact & Outcomes
Interested in a similar solution?
Let's discuss how agentic AI can solve your operational challenges.