Adam BlansettSenior Full-Stack & AI Engineer
AI Engineering
10 min read
Adam Blansett

Building a Guarded AI SDR Platform: Opt-Out Suppression, 5-Dimension ICP Scoring, and Bi-Directional CRM Sync

How ai-sdr combines FastAPI, pgvector buying-signal retrieval, 5-dimension ICP + BANT/MEDDIC scoring, retroactive email/domain opt-out suppression, manager-gated sequences, and bi-directional HubSpot/Salesforce sync.

Revenue OperationsCRM SyncpgvectorCeleryFastAPIHITL ApprovalsAudit Chains

Automated sales development tools frequently damage sender reputation and customer trust when AI sequences fire without human review, ignore domain-level unsubscribe requests, or overwrite clean CRM records with duplicate contacts.

In AI SDR Platform (source on GitHub), outbound prospecting, lead qualification, sequence drafting, and CRM pipeline hygiene run on a unified Python 3.12 FastAPI, PostgreSQL `pgvector`, Celery/Redis, and React 18 stack where deterministic opt-out suppression and manager approval gates always supersede generation.

Buying-Signal Retrieval & Retroactive Opt-Out Suppression#

The `prospecting/` and `retrieval/` modules ingest target accounts, bulk CSV contact lists, public buying signals, and internal sales playbooks, indexing chunks with dense vector embeddings (`deterministic` mode for offline CI or local `ollama` in production). Before any account brief or outreach draft is queued, email and domain opt-out suppression tables block suppressed recipients retroactively—even if a teammate imports them again via CSV.

5-Dimension ICP Rubrics & Cited BANT/MEDDIC Qualification#

Instead of emitting an unexplained numerical score, `qualification/` evaluates accounts against a 5-dimension Ideal Customer Profile rubric producing grades `A`–`D` alongside buying-intent tiers (`high`, `medium`, `low`, `disqualified`) and structured BANT/MEDDIC extraction. Every qualification conclusion links directly back to the triggering signal and semantic playbook evidence.

Manager-Gated Sequences, Inbound Reply Triage & Bi-Directional CRM Sync#

Outbound sequences in `sequences/` are drafted with grounded case-study references and mandatory unsubscribe footers, then paused in a manager approval queue before dispatching via `mock`, `smtp`, `resend`, or `sendgrid`:

sequence_dispatch_gate.py
async def dispatch_approved_touch(touch: SequenceTouch, repo: SuppressionRepo) -> DispatchResult:
    if not touch.manager_approved:
        raise HTTPException(status_code=409, detail="Manager approval required before send")
    if await repo.is_suppressed(touch.recipient_email, touch.company_domain):
        return DispatchResult(status="blocked_opt_out", sent=False)
    return await provider_adapter.send(touch)
  • Inbound Reply Classification: Classifies responses as `unsubscribe`, `interested`, `ooo`, `objection`, or `neutral`, auto-suppressing opt-outs immediately and cancelling pending follow-ups.
  • CRM Hygiene & HITL Duplicate Merges (`crm_sync/`): Computes deal-stage hygiene scores, synthesizes next steps, detects duplicate contacts with opt-out-preserving HITL merges, and syncs idempotent HMAC inbound CRM webhooks alongside `mock`, `hubspot`, and `salesforce` connectors.
  • Workers & Production Hardening (`workers/`, `core/`, `audit/`): Runs Celery + Redis sweeps (`crm_hygiene_sweep`, `sequence_followup_sweep`), `scrypt`-hashed persisted JWT auth, Redis/in-memory rate limiting, OpenTelemetry tracing, Prometheus `/api/v1/metrics/prometheus`, outbound cloud PII scrubbing, and a SHA-256 hash-chained audit trail.
Instant Demo Seeding: Setting `SEED_DEMO_DATA=true` or calling `POST /api/v1/seed/demo` populates sample accounts, signals, a 3-touch sequence, CRM deals, a duplicate merge candidate, an inbound reply, and worker sweep metrics for local evaluation.

Planning revenue automation or bi-directional CRM integrations with strict compliance guardrails? Explore my AI Engineering and Software Architecture services or book a consultation.

Applied Architecture

Production Case Studies & Capabilities

Explore how these engineering patterns are deployed in production systems and available through client engagements.

Case Study

AI SDR Platform

An open-source Python 3.12 (FastAPI), async SQLAlchemy 2.0 + PostgreSQL/pgvector, and React 18 outbound revenue platform combining buying-signal enrichment, immediate email/domain opt-out suppression, manager-gated sequence drafts, HITL duplicate merges, and HMAC CRM sync.

Read Case Study
Related Engineering Service

AI Engineering & LLM Integration

Many AI initiatives fail in production due to prompt fragility, high token latency, hallucination risks, and lack of structured evaluation. I bridge the gap between experimental LLM prompts and deterministic software engineering.

Related Engineering Service

Software Architecture & System Design

Fast-moving teams frequently accrue hidden architectural liabilities: tangled domain logic, unmaintainable monoliths, or over-engineered microservices that paralyze development.

Frequently Asked Questions

How does ai-sdr prevent opted-out contacts from receiving follow-up emails after CRM merges?
Opt-out suppression applies retroactively across both email addresses and corporate domains prior to every sequence send, inbound reply classification auto-suppresses unsubscribe responses immediately, and HITL duplicate contact merges explicitly preserve opt-out flags.
What makes lead scoring auditable rather than an opaque AI score?
Every qualification record evaluates a customizable 5-dimension ICP rubric (grades A–D), assigns an intent tier, extracts BANT and MEDDIC fields, and attaches direct citations to indexed buying signals and pgvector case-study chunks.
Which email and CRM providers are supported out of the box?
Sequences dispatch through pluggable mock, SMTP, Resend, and SendGrid adapters after manager sign-off, while CRM sync supports mock, HubSpot, and Salesforce connectors plus idempotent HMAC-verified inbound CRM webhooks.
Share this technical guide

Need Help Solving This in Your Application?

I partner with founders, executives, and engineering leaders to design architectures, resolve production bottlenecks, and deliver resilient software.

Related Technical Articles