Architecture Note · Operations & RevOps
Deterministic B2B Enrichment Waterfall, Rolling 30-Day Intent Scoring, and RevOps Routing Gates
Why ad-hoc enrichment scripts and prompt-based account scoring corrupt CRM territory ownership—and how deterministic caching, decay-bounded math, and mandatory human sign-off gates keep outbound routing auditable.
The Problem: Credit Burn, Stale Intent, and Polluted CRM Routing
Enterprise revenue operations teams routinely stitch together separate firmographic APIs, technographic scrapers, email verifiers, and spreadsheet territory maps across AMER, UKI, DACH, and APAC hubs. When an account list arrives before a regional outbound push, every uncached run re-queries paid providers for the same domains, stale quarter-old news inflates priority tiers, and subsidiary domains slip into the wrong account executive’s queue—or worse, opted-out contacts land in active sales sequences.
Why Naive Enrichment Scripts and AI Wrappers Fail
Delegating enrichment orchestration, tiering, and territory assignment to brittle glue scripts or LLM prompts breaks along four predictable lines:
- Uncached provider fan-out: Calling every firmographic, technographic, and email vendor in parallel burns credits even when the first reliable source already populated the record, while leaving zero trace of which vendor supplied which field.
- Nondeterministic scoring and stale-signal drift: Asking a language model to assign
hot,warm, orcoldtiers produces drifting thresholds across runs and allows six-month-old funding announcements to outrank this week’s hiring or compliance triggers. - Silent territory collisions and compliance gaps: Auto-assigning accounts by country code alone misses parent-subsidiary domain relationships, creating duplicate AE owners on related entities, and fails to block GDPR, UK PECR, or CAN-SPAM opt-outs before CRM sync.
- Ungoverned CSV exports and raw list retention: Leaving uploaded prospect spreadsheets on disk indefinitely expands breach exposure, while exporting unescaped cells into Excel or CRM importers invites CSV formula injection.
The Deterministic Architecture That Fixes It
The production FastAPI and SQLite (WAL mode) architecture separates deterministic enrichment, scoring, and compliance enforcement from optional narrative summarization, backing every state transition with explicit gates.
- Cached, short-circuiting waterfall enrichment:
POST /api/accounts/enrichexecutes configurable provider chains acrossfirmographic,technographic, andwork_emaillayers, halting a layer as soon as required fields resolve and recording a per-step provider trace with weighted confidence (0.40firmographic,0.30technographic,0.30work email). Results cache in SQLite keyed by a canonical SHA-256 hash of tenant, domain, waterfall order, disabled providers, and input hints. Multipart batch uploads write toENRICH_UPLOAD_DIRwith0600permissions and auto-wipe after 1 hour (3600s), retaining only the file’s SHA-256 digest. - Strict 30-day rolling intent decay and offline-first summaries:
POST /api/signals/scoreevaluateshiring,technographic,compliance_mandate, andnews_fundingevents strictly inside a 30-day window, excluding stale (>30 days) or far-future (>1 hour) events and applying linear recency decay floored at0.25. Weighted intent blends with deterministic ICP fit (headcount, cloud stack, geography) beforeOfflineDeterministicAdaptersynthesizes a zero-egress summary by default—falling back cleanly even if an optionalOpenAICompatibleAdapterendpoint fails. - Hard suppression blocks and HTTP 409 RevOps gates:
POST /api/routing/assignmaps accounts to regional territories (AMER-East,AMER-West,UKI,DACH,APAC,EMEA-Other) and checks domain and contact suppression entries first, rejecting blocked targets with HTTP422. If the router detects an active or parent-subsidiary duplicate owner, a territory override, or a bulk reassignment, it halts with HTTP409 Conflictuntilhuman_confirmed=trueand a named reviewer are supplied. Every decision appends to a SHA-256 hash-chainedaudit_logstable verifiable viaGET /api/audit/logs. - Formula-safe CRM exports:
GET /api/exports/crmandGET /api/exports/crm.csvstrip suppressed accounts and opted-out contacts and neutralize leading OWASP formula characters (=,+,-,@, tab, CR) before emitting RFC 4180 CSV rows.
Operational Takeaway
High-velocity RevOps pipelines should treat vendor cascades, recency decay, suppression rules, and duplicate-owner checks as deterministic code—not prompt instructions. By caching verified provider traces, expiring raw batch uploads after one hour, blocking conflicted territory overrides with an explicit human sign-off gate, and chaining every routing decision with SHA-256 hashes, teams scale outbound targeting without eroding CRM trust.