AI SDR Platform
Self-hosted AI Sales Development Representative platform for account enrichment, 5-dimension ICP + BANT/MEDDIC scoring, opt-out suppression, and CRM hygiene.
01. Problem & Context
Outbound sales development teams struggle with fragmented prospecting spreadsheets, stale CRM records, unverified personalization, and compliance risks when AI tools fire outbound emails without honoring opt-out lists or manager review.
02. Engineering Solution
Architected a self-hosted Phase 1 & 2 AI SDR platform pairing a FastAPI + Celery/Redis backend (`prospecting/`, `retrieval/`, `qualification/`, `sequences/`, `crm_sync/`, `workers/`, `core/`, `audit/`) with a multi-tab React 18 TypeScript workspace. Combines dense vector buying-signal retrieval (`deterministic` or `ollama`), 5-dimension ICP (`A`–`D`) and BANT/MEDDIC scoring, manager-gated multi-touch sequence dispatch, automated inbound reply classification, and bi-directional HubSpot/Salesforce CRM sync.
03. System Architecture
Modular FastAPI domain packages (`prospecting/`, `retrieval/`, `qualification/`, `sequences/`, `crm_sync/`, `workers/`, `core/`, and `audit/`) run atop async SQLAlchemy 2.0 and PostgreSQL `pgvector`, protected by `scrypt`-hashed persisted user auth, Redis/in-memory rate limiting, OpenTelemetry tracing, Prometheus `/api/v1/metrics/prometheus`, and a SHA-256 hash-chained audit ledger.
Core Architectural Components
Outbound Prospecting & Semantic Retrieval (`prospecting/`, `retrieval/`)
Enriches target accounts, indexes public buying signals and case-study playbooks with dense vector embeddings (`deterministic` or `ollama`), supports bulk CSV contact imports, and enforces immediate email/domain opt-out suppression.
5-Dimension ICP & BANT/MEDDIC Qualification (`qualification/`)
Scores accounts on customizable 5-dimension ICP rubrics (`A`–`D`), assigns buying-intent tiers (`high`/`medium`/`low`/`disqualified`), and extracts structured BANT and MEDDIC fields backed by signal and semantic evidence citations.
Manager-Gated Sequences & Inbound Reply Triage (`sequences/`)
Drafts grounded multi-touch sequences with mandatory unsubscribe footers behind manager approval gates across pluggable providers (`mock`, `smtp`, `resend`, `sendgrid`), while classifying inbound replies (`unsubscribe`, `interested`, `ooo`, `objection`, `neutral`) and auto-suppressing opt-outs.
CRM Pipeline Hygiene & Bi-Directional Sync (`crm_sync/`, `workers/`)
Computes deal-stage hygiene scores, detects duplicate contacts with opt-out-preserving HITL merges, runs Celery + Redis scheduled sweeps (`crm_hygiene_sweep`, `sequence_followup_sweep`), and syncs idempotent HMAC inbound webhooks and `mock`/`hubspot`/`salesforce` connectors.
04. Notable Engineering Decisions
Opt-Out Preservation Across Sequences, Replies & CRM Merges
Unsubscribe compliance cannot be bypassed by duplicate contacts or reply loops. Inbound `unsubscribe` replies auto-suppress domains/emails, sequences enforce unsubscribe footers, and HITL duplicate merges preserve opt-out flags.
Manager-Gated Outbound Dispatch with Pluggable Delivery Providers
Separating sequence drafting from dispatch guarantees human sign-off before emails leave via `mock`, `smtp`, `resend`, or `sendgrid`, preventing unreviewed outbound bursts.
Observability, Outbound PII Scrubbing & SHA-256 Audit Trails
Pairing `scrypt` authentication, outbound cloud PII scrubbing, Prometheus `/api/v1/metrics/prometheus`, OpenTelemetry tracing, and SHA-256 hash-chained audit logs provides enterprise accountability end-to-end.
05. Engineering Challenges & Solutions
Challenge: Preventing duplicate CRM records or concurrent inbound replies from re-enabling suppressed contacts.
Engineering Solution: Implemented deterministic email/domain suppression checks prior to dispatch alongside opt-out-preserving HITL merge logic and idempotent HMAC-verified CRM webhooks.
Challenge: Keeping prospect scoring explainable rather than opaque black-box scores.
Engineering Solution: Grounded every `A`–`D` ICP grade and BANT/MEDDIC extraction directly in cited buying signals and pgvector case-study/playbook chunks.
06. Implementation Highlights
- Full Phase 1 & 2 implementation across `prospecting/`, `retrieval/`, `qualification/`, `sequences/`, `crm_sync/`, `workers/`, and `audit/`
- Dense vector signal & playbook embeddings (`deterministic` / `ollama`) with bulk CSV contact import and opt-out suppression
- 5-dimension ICP rubric (`A`–`D`), intent tiering, and cited BANT/MEDDIC extraction
- Manager-gated multi-touch sequences (`mock`/`smtp`/`resend`/`sendgrid`) and automatic inbound reply classification
- HITL duplicate merges, idempotent HMAC CRM webhooks, `hubspot`/`salesforce` connectors, and Celery + Redis scheduled sweeps
- React 18 TypeScript workspace with `scrypt` auth, OpenTelemetry, Prometheus metrics, cloud PII scrubbing, and GitHub Actions CI