LionsHead Analytics Group

Engagements

What the work actually looks like.

Five systems, ordered by how broadly the architecture translates across breakout-principal practices. Cadence makes your whole operation visible at the surface where the work actually happens. Voicemail surfaces existing clients in real time before cold inbound. EnrollmentTraQ routes inbound to the right practitioner as you scale past doing it all yourself. Those first three apply to any breakout practice. The last two go deeper but run narrower. Herald leads that tier: it watches a high-velocity sales floor in real time and speaks the moment a deal closes, cost runs hot, or an agent genuinely needs help. It needs a fast paid-lead floor to apply, but reaches across insurance, call-center, and high-velocity advisory. CALIPER keeps quality high once you're no longer making every call, narrower still (regulated, phone-based work). The architecture ports the same way across all of them. The 'Same pattern, different surface' callout on each engagement names the verticals it's been mapped to.

Operational Visibility · Workforce Surface · Platform Anchor

Cadence™: Your Whole Operation, Visible

Practice Operations · Calendar-as-Surface Coordination · Principal Architect

  • Python
  • LionsHead Integration Library v2.6
  • Three-layer handler/interpreter/config separation
  • Two-layer dedupe (exact + fuzzy adopt)
  • OAuth user flow + refresh-token persistence
  • Token-bucket rate limiter
  • Append-only audit log (fsync per write)
  • BI-ready JSON-Lines pipeline trace
  • Starter dashboard + SQL drop-in

Problem

Your system of record holds the truth. Appointments, callbacks, the schedule everything downstream depends on. But your team doesn't live inside the system of record during the working day. They live in their calendar. Whatever the system of record knows that the calendar doesn't is invisible to the people doing the work. They either keep two windows open and remember to cross-check, or they let things slip. When something slips, the relationship's trust degrades, the renewal probability falls, the case dies quietly. The naive fix is each person hand-copying entries onto their own calendar. That produces duplicates, drift, and forgotten records. The slightly less naive fix is to abandon the system of record's scheduling layer and let the calendar carry the truth, which works until compliance, audit, or recordkeeping needs those records and the disconnect costs you under review. Originally deployed against a dialer-centric insurance CRM. The same gap appears anywhere a calendar and a system of record live in separate places.

Architectural Solution

A continuous one-way sync that keeps the system of record authoritative and projects its truth onto the team's calendar within minutes. Built on the LionsHead Integration Library with a strict three-layer separation: handler interfaces speak workforce vocabulary only (employee_id, scheduled_at, is_complete, contact_phone), platform interpreters plus declarative configs handle each platform's wire conventions, and per-client config files supply the tenant pointers (calendar id, custom field projections, dedupe windows). The destination handler runs a two-layer dedupe pass on every record. An exact-marker lookup catches every event the bot has written before. A fuzzy adoption pass searches a configurable window around the scheduled time for events the user typed in by hand. When one matches, the bot patches it in place rather than creating a duplicate. State transitions are visual: a completed entry's event prefixes with [Done] and its colour mutes to graphite rather than disappearing. Three log streams keep operational, audit, and pipeline-trace concerns isolated. Operational logging answers 'is it running.' Audit logging is append-only with fsync per write and answers 'what did the bot do to this account.' The pipeline trace is JSON-Lines-per-day with pre-computed dimensional fields so BI tools ingest it without intermediate data engineering. A starter dashboard ships with the project and renders trailing-thirty-day totals in the terminal. A SQL file drops the same metrics into Tableau, Power BI, Looker Studio, Metabase, or Excel via Power Query.

Tangible Result

The team opens their calendar; the day is laid out. Each event title carries the client name and disposition, each location carries the dialable phone number, each description carries the notes left in the system of record the last time anyone touched the lead. Completed entries visually cross out in place rather than vanishing. Adopted manual entries stop generating duplicates after the first cycle. The compliance officer can reconstruct any individual event's lifecycle from the audit log. The principal can show a prospect or a renewal client a live dashboard of throughput against the trace stream, no manual data reconstruction required. The integration is not just a sync. It produces its own evidence of value as it operates, in a format the client's BI tools consume directly.

Same pattern, different surface

The same architecture translates wherever a system of record holds the truth and a calendar is where the working day actually happens. Different industries, same gap.

  • Medical practice: appointment book + EHR scheduling system
  • Law firm: matter calendar + case management software
  • Investment advisor: client meetings + CRM
  • Dental: operatory schedule + practice management software

Where it scales

Per-cycle workload for a typical book runs in roughly two seconds against approximately one source call and twenty destination calls. Transport is wrapped in a token-bucket rate limiter with classified error retry (rate-limit, auth, validation, transient) so cycles survive upstream hiccups without dropping records. Daily rollups land in a flat file BI tools ingest directly. High-cardinality identifiers are isolated from low-cardinality dimensional fields so trace queries stay fast as volume grows. A new tenant on the same platform pair is one client-config file. No library work, no platform interpreter changes.

Where it mutates

Replacing the source CRM (HubSpot, Salesforce, Pipedrive, Zoho, GoHighLevel, Close) is one handler module plus one platform config. Replacing the destination calendar (Outlook, iCloud, CalDAV) is the symmetric change. Handler code never references a platform-specific field name. The interpreter resolves abstract names against the config, so the orchestrator, the dedupe layer, the audit stream, and the dashboard all stay unchanged across platform swaps. Event templates, field mappings, dedupe window, and per-state styling are all declarative in the platform config. Extending to a new vertical (dental hygienist appointments, financial-advisor meetings) is one payload definition.

googleCalendarHandler.py

# Two-layer dedupe. Every record runs both paths.
# 1. Exact-marker lookup catches every event written before.
# 2. Fuzzy adoption catches events typed in by hand.
# Patching adopts them by writing the marker.
 
event_body = self._build_event(record)
existing_id = self._find_event_id(marker) # exact
adopted = False
 
if not existing_id:
existing_id = self._fuzzy_find_event_id(record) # adopt
adopted = existing_id is not None
 
if existing_id:
self._service.events().patch(
calendarId=self.calendar_id,
eventId=existing_id,
body=event_body,
).execute()
self._audit.record("ADOPT" if adopted else "UPDATE", ...)
else:
inserted = self._service.events().insert(
calendarId=self.calendar_id,
body=event_body,
).execute()
self._audit.record("CREATE", record_id=inserted["id"], ...)

Client Recognition · Priority Surfacing · Real-Time

Voicemail Priority Pipeline: Existing Clients First

Client Recognition · Real-Time Priority Surfacing · Principal Architect

  • Python
  • LionsHead Integration Library v2.8.4
  • Three-layer handler / interpreter / config
  • Four-layer crash redundancy (atexit · backfill · resurrection · watchdog)
  • Gmail API + OAuth (classified retry, exponential backoff)
  • Slack Block Kit + Socket Mode + audio uploads
  • PyInstaller tenant-isolated builds (credentials in sys._MEIPASS)
  • 11 smoke harnesses · ~360 automated checks
  • 13 hot-reload slash commands

Problem

Existing clients calling about something important should never wait while you triage cold inbound. But most practices' voicemail surface doesn't know the difference. Every voicemail lands in the same generic inbox, indistinguishable, and sits there unread for hours or days until somebody manually triages. The worst case is the one that compounds: a missed call from someone who's already paying you, calling about something that needs an answer today, rolling into a generic no-context summary the next morning. The relationship erodes. The renewal slips. Sometimes the case goes with it. Customer-facing teams need live visibility into every voicemail AND a way to instantly know which callers are known to the practice versus cold. Originally deployed at an insurance agency on Asterisk PBX, Gmail, and Slack. The pattern applies anywhere a practice has to distinguish 'someone we know' from 'someone we don't' the moment a call lands.

Architectural Solution

A polling pipeline that reaps PBX-generated voicemail emails from Gmail (OAuth-scoped read-only), extracts the caller's phone number, cross-references the book of record to find the matching lead, then queries status to determine priority. Known-client callers trigger live Slack alerts with the actual voicemail audio auto-uploaded as a threaded reply that plays inline in the channel. No inbox-diving, no link-clicking, no app-switching required. Unknown callers are silenced during business hours and rolled into a single morning digest the next day. When a caller leaves multiple voicemails between cycles, the pipeline groups them by normalized phone and posts one consolidated alert with every audio threaded chronologically underneath, rather than N separate alerts the team has to mentally reassemble.

Tangible Result

Thirty-five days of production data: 907 voicemails captured, 97.9% delivered with audio attached as a threaded Slack reply, median 2.7 seconds from PBX-drop to channel-playable (95th percentile under 5). 26.8% received an explicit team reaction inside Slack, a measurable floor on how often inbound got actively triaged. In the old workflow, that visibility was zero and surfacing time was measured in hours. The team now responds to active-client voicemails during the same call window the customer is still expecting an answer, not the next morning. The self-healing backfill pass recovers the 2.1% of upload failures automatically. The v3 rebuild moved the system from a 7,045-line single-file script to roughly 80 files across handler/interpreter/config layers, behind ~360 automated checks, with cutover from old to new completed in roughly five seconds via the one-click installer. Live in production today serving a CS team across multiple shifts. Full instrumented breakdown published in the Field Notes blog post.

How it's built

Three-layer separation

Built to the LionsHead Integration Library Specification v2.8.4. Handler interfaces speak workforce vocabulary only (post_message, upload_audio_to_thread, get_reactions). Platform interpreters carry the Slack-specific endpoints, OAuth scopes, ID-prefix validation, and Socket Mode plumbing as class constants. Per-tenant JSON overlays supply channel ids and credential pointers. A second tenant is a new config file; a future port to Teams, Discord, or Webex replaces one file.

Four-layer crash redundancy

Atexit on clean shutdowns. An end-of-cycle audio-backfill pass rescans channel history via conversations.history + conversations.replies and re-uploads any thread missing its audio. A throttled hourly orphan-resurrection check walks the metrics CSV against the channel and reposts what the channel never received. A Windows Scheduled Task watchdog runs every ten minutes from a separate process to catch the failure modes atexit silently misses: hard kill, BSOD, sleep, OOM, power loss.

Operator surface

Thirteen hot-reload slash commands rotate Slack tokens, Gmail OAuth files, dev allowlist, and cycle cadence with auth.test live verification before each swap (old token stays in place on failure). PyInstaller tenant-isolated build extracts credentials to sys._MEIPASS at runtime, so the workstation filesystem never carries them. Eleven smoke harnesses behind ~360 automated checks gate every change before it ships.

Same pattern, different surface

The same priority-aware voicemail surfacing applies wherever existing-client calls have to be distinguished from cold inbound in real time, and the operational surface is a messenger or shared inbox, not the phone system.

  • Medical practice: established-patient calls vs. new-patient inquiries
  • Law firm: active-matter clients vs. cold intake
  • Investment advisor: existing-client calls vs. prospect inbound
  • Insurance agency: policy-holders vs. lead inbound (original)

Where it scales

Polling cadence, page size, business-window logic, and cycle interval are all configuration; cycle interval is hot-reloadable from inside Slack itself via /interval. Both Gmail and book-of-record API calls are wrapped in classified retry-with-jitter (transient, rate-limit, auth, validation) with per-class retry policies and Retry-After honored. State files (processed_ids, no_op_ids, missed_voicemails) prune against business dates every cycle so ledgers never grow unbounded. Atomic JSON writes guarantee state is never corrupted by a mid-write process kill, and the Watchdog runs every ten minutes from a separate process to catch the failure modes atexit silently misses (BSOD, sleep, OOM, hard kill, power loss). A second tenant lands as a thin JSON overlay plus a separate PyInstaller build; the integration core is unchanged.

Where it mutates

A port to Teams, Discord, Webex, or any other messenger replaces one file (the platform interpreter) and one tenant config. The book-of-record phone-column lookup is a list; adding a new field to the search is a one-line change. Hang-up threshold, summary post time, priority criteria, backfill window, and recovery cadence all live in config. Credentials (Slack bot token, Slack app token, Gmail OAuth file, dev allowlist) rotate via slash commands at runtime with live verification before the swap (auth.test on the candidate token; old token stays in place on failure) — no restart, no risk of bricking the running bot with a bad paste. Per-tenant branding (display_name, icon_emoji) overrides on every post via the chat:write.customize scope.

voicemail_rollup.py

# Rollup pass. Group eligible candidates by normalized
# phone, post one consolidated alert per group, thread
# every audio underneath in chronological order.
 
groups: dict = {}
for cand in candidates:
key = cand["phone_key"] or cand["fallback_id"]
groups.setdefault(key, []).append(cand)
 
for key, group in groups.items():
group.sort(key=lambda c: c["received_at"])
primary, call_count = group[0], len(group)
 
parent = messenger.post_message(
channel,
attachments=[render_alert(primary, group, call_count)],
)
 
for idx, item in enumerate(group):
messenger.upload_audio(
channel, item["audio"], thread_ts=parent["ts"],
title=role_label(idx, call_count),
)

Practitioner Routing · Live Coordination · Portable Framework

EnrollmentTraQ™: Route Inbound to the Right Practitioner

Multi-Practitioner Coordination · Live Inbound Routing · Principal Architect

  • Python
  • Slack Block Kit + Socket Mode
  • Pluggable HandlerFactory pattern
  • Abstract RoutingRule interface
  • Live in-memory status store
  • Rate-limit-aware cleanup pass
  • Audit logging + dry-run mode
  • YAML config-driven

Problem

The moment your practice scales past one practitioner, the inbound has to find the right one. Not just anyone, the right one. By specialty. By license. By state. By availability. By whatever constraints actually govern your routing. Without an enforcement layer, it lives in shoulder-taps and tribal knowledge. Some people claim work they aren't actually available for. Others are available but invisible. The rules get applied inconsistently. Stale requests clutter the working channel for weeks after the work has already closed. The team needs real-time visibility into who's free, automatic enforcement of the rules that actually govern routing, and a way to keep the working channel readable as volume scales. Originally deployed inside a customer-service floor at an insurance enrollment center on Slack. The same engine applies to any multi-practitioner practice distributing live inbound: medical groups routing patients to specialists, law firms distributing matters to associates, brokerages routing leads by license and state.

Architectural Solution

A real-time routing engine that runs inside the team's messenger channel. The bot watches for inbound requests, parses the relevant attributes from the message, then routes to a live-tracked pool of available practitioners. It pulls only those whose latest status is Ready, declared via Block Kit availability polls posted directly inside the channel. Rule-aware pool selection applies the firm's routing rule. Fallback to the secondary pool fires automatically when the primary has nobody ready. A nightly cleanup pass removes stale request messages and their entire reply thread, with full audit log, rate-limit-aware retry, and a dry-run mode for safe rollout. The architecture is the first production deployment of the LionsHead Integration Library: Source, Messenger, and Routing Rule are all pluggable via a HandlerFactory. The same engine ports to Teams, Discord, Webex, or any other surface by registering one new Messenger plugin. No rewrite of the routing core.

Tangible Result

Requests route to the first actually-available practitioner in seconds, not minutes-of-shouting. Misrouted requests drop to near-zero, because the system explains in plain English why a given routing isn't allowed. The channel stays clean: stale requests and their bot replies vanish on a daily cadence with a full audit trail. And because the architecture is a library rather than a one-off, the next routing engine inherits all of this for free.

Same pattern, different surface

The same routing engine applies anywhere a small group of licensed practitioners has to coordinate live inbound demand against availability, specialty, and geographic or state-licensure constraints.

  • Medical group: inbound calls routed to first available physician by specialty
  • Law firm: matters routed to associates by practice area + availability
  • Brokerage: leads routed by license type + state + readiness
  • Customer service team: transfers routed by writing group + status (original)

Where it scales

Roster, channel list, eligible rule set, cleanup window, and poll cadence are all config. No code changes to grow the system. New routing dimensions add via new RoutingRule subclasses without touching the main run loop. Multi-channel and multi-tenant deployments are supported by registering additional Source + Messenger pairs in config. The cleanup pass is rate-limit-aware with Retry-After honored.

Where it mutates

The HandlerFactory pattern means swapping the messenger (Slack to Teams), the data source, or the routing rule is a YAML config change, not a code rewrite. Each new engagement gets its own concrete handler set. The library core stays unchanged. DEBUG modes let you exercise the full status-tracking flow without applying group filtering.

handler_factory.py

# HandlerFactory. Register a class, the library wires it up
# from YAML config alone.
 
SOURCE_REGISTRY = {
"usersJson": UserRosterSource,
"messageGrabber": MessageGrabber,
}
 
MESSENGER_REGISTRY = {
"slack": SlackMessenger,
# "teams": TeamsMessenger, # one plugin to add
# "discord": DiscordMessenger, # the next
}
 
RULE_REGISTRY = {
"carrierRouting": CarrierRoutingRule,
}

Real-Time Recognition · Statistical Performance Flag · Cost Intelligence

Herald: The Floor, Heard the Moment It Moves

High-Velocity Sales Operations · Real-Time Recognition & Cost Intelligence · Principal Architect

  • Python
  • Live CRM + dialer polling (20s cadence)
  • Proprietary peer-conversion significance model (volume-aware)
  • Live agency CPA + High CPA Watch
  • Slack Block Kit + DM fan-out (channel · closer · enroller)
  • Three-tier Slack governance (member / admin / super-admin)
  • Per-delivery confirmation + audit log
  • Timezone-locked business day
  • Headless self-hosted · portable state (roster / history / dedup)

Problem

On a fast floor, the scoreboard is always stale. A deal closes in the CRM at 10:41; the manager learns about it in a spreadsheet after lunch, coaches on it the next morning, and reconciles cost-per-sale at the end of the week. By then the moment — the recognition, the correction, the save — has passed. The friction isn't a missing tool. It's the gap between the tools: the dialer knows the calls, the CRM knows the sales, the finance side knows the lead spend, and no single instrument sees all three at once, in time to act. Worse, the question that actually matters — is this agent underperforming, or did they just draw an expensive lead? — gets answered by feel, because a blunt cost threshold can't tell a slow morning everyone shares from a genuine problem. Originally deployed against a paid-lead insurance sales practice. The same gap opens on any high-velocity floor where lead spend, live conversion, and recognition live in three separate places.

Architectural Solution

A headless, always-on metasystem that reads fact and signal across the systems the practice already runs and turns it into a single live voice the whole floor hears. On a twenty-second poll it recognizes every close the instant it's written and fans three concurrent voices out of one event: a card to the sales channel, a DM to the closer, a DM to the enroller who set it up. Every alert carries agency cost-per-sale live, plus a running High CPA Watch that names the agents running hot and, for each, exactly how many more closes bring them back under target. The instrument that sets Herald apart is a peer-conversion significance test run on each agent: given how many paid leads they worked, is their close count low enough that chance alone is unlikely, measured against how the rest of the floor is converting right now? The benchmark moves with the day, so no one is flagged for a slow morning everyone shares, and it's volume-aware, so one sale on three leads never reads the same as one on forty. It surfaces the agent who genuinely needs a hand — not the one who simply drew an expensive lead. A pace-and-projection line closes each card: today against the same minute yesterday, with a run-rate projection to end-of-day once the signal is strong enough to trust, colored green when they'll beat yesterday and red when they won't, recomputed on every sale so a mid-day slump pulls the number down honestly.

Tangible Result

It hands the week back. The manual round-trip — pulling the report, tallying the day, chasing who's over on cost, reconstructing yesterday to know if today is good — disappears. In its place: a floor that recognizes itself in real time, twenty seconds from close to alert; a cost signal that arrives while it can still change an outcome; and a performance flag precise enough to trust with a person's confidence. Recognition reaches three voices at once — channel, closer, enroller — and one statistical flag replaces gut-feel coaching. Beyond the wins, the full arc of the book arrives as its own threaded, deduplicated alerts: rejected and trashed policies, weekly performance roll-ups, deals waiting to be dropped. The manager stops assembling the picture and starts acting on it.

How it's built

Statistical performance flag

Rather than a cost threshold, a proprietary peer-conversion model with a defensible false-positive rate. Each agent is measured against the floor's live conversion — the benchmark the rest of the team is setting right now — and gated on minimum lead volume so a small sample never trips it. The method itself is the instrument that sets Herald apart, and it stays inside the practice; what a manager sees is a single trustworthy verdict — flagged or not — with the confidence behind it. Securities-grade rigor, pointed at conversion. And the system detects while a person decides: before any agent is told their numbers are off, an admin is asked, because a mistimed nudge costs more than it saves.

Coordinated, never replaced

Herald sits above the practice's dialer, CRM, and Slack and makes them speak as one. Nothing is ripped out, nothing is migrated — the team keeps every tool it chose. Governance runs entirely from Slack on a three-tier command model (member, admin, super-admin), so enrolling an agent, silencing a channel, or standing the system down is a typed command with the right permission behind it, not a ticket to engineering.

Instrumented & sovereign

Every delivery — channel post, each DM — is confirmed and logged, so the system can prove what it did; observability is how the thing is built, not a feature bolted on. Self-hosted, headless, and portable: the whole system — roster, history, dedup state — moves between the client's own machines and resumes without a re-blast, and the data never leaves the practice. The business day is locked to the floor's own timezone, so 'today,' pace, and every once-per-day rule mean what the team means, never what a server's clock happens to say.

Same pattern, different surface

The metasystem is the constant; the source it watches is the variable. The same real-time recognition, live cost signal, and significance-tested performance flag apply to any breakout practice with a paid-lead motion and a fast floor.

  • Insurance agency: paid-lead policy sales floor (original)
  • Call-center sales: high-velocity outbound close motion
  • High-velocity advisory: paid-lead appointment-to-close floor
  • Inside sales / SDR: cost-per-lead against live conversion

Where it scales

Poll cadence, business-day window, timezone, alert routing, roster, and every once-per-day rule are configuration, managed live from Slack via the three-tier command model — no redeploy to enroll an agent, silence a channel, or change cadence. The significance test's floor benchmark recomputes each cycle, so it scales with headcount without retuning; volume gates keep low-sample agents out of the flag until there's signal to trust. Dedup state is self-pruning against the business date so ledgers never grow unbounded, and every delivery is confirmed and logged so the system can prove what it sent.

Where it mutates

Herald coordinates the tools the practice already runs, so swapping the source CRM or dialer is a handler change, not a rewrite; the recognition core, significance test, cost watch, and governance layer stay unchanged. A port off Slack to another messenger replaces the platform interpreter. Target CPA, significance threshold (alpha), minimum lead volume, projection trust point, and the roster all live in config the floor's admins edit from Slack. Because roster, history, and dedup state are portable, the whole system moves between the client's own machines and resumes without a re-blast.

heraldFlag.py

# Performance flag. Herald decides who to surface with a
# calibrated peer-conversion model, measured against how the
# floor is converting right now - not a blunt cost line.
# The scoring kernel is proprietary; what's shown here is the
# guardrail around it, not the math inside it.
 
def proposeFlag(agent, cohort, cfg):
floor = FloorSnapshot.forBusinessDay(tz=cfg.timezone)
cohort = floor.exclude(agent) # judged against peers, live
 
# Not enough of the day to judge on yet -> stay silent.
if agent.paidLeads < cfg.minLeads or cohort.paidLeads < cfg.minCohort:
return None
 
# Proprietary significance model. Volume-aware, self-
# calibrating to the live floor. Returns a confidence,
# not a raw threshold crossing.
verdict = SignificanceModel(cfg.model).evaluate(agent, cohort)
 
if verdict.confidence < cfg.alpha: # bounded false-positive rate
return None
 
# The system detects; a person decides. No agent is told
# their numbers are off until an admin confirms the nudge.
return FlagProposal(agent, verdict, requiresAdminAck=True)

Quality at Scale · AI Scoring · Compliance Export

Beta

CALIPER™: Quality at Scale

Regulated Communications · QA Compliance Automation · Principal Architect

  • Python
  • Abstract Handler ABCs (Source/Dest/Messenger × category)
  • YAML config-driven deployments
  • Pluggable auth (API key, basic, OAuth)
  • Classified transport-layer retry
  • SQLite hash-ledger upsert contract
  • openpyxl template preservation
  • Multi-vendor AI-scoring abstraction

Problem

The moment your practice scales past you doing every conversation yourself, the question shifts. It's no longer 'am I good enough on this call.' It's 'is everyone in my practice good enough on every call.' That's a different problem. In regulated spaces (medical patient outreach, financial advisory recommendations, legal intake, insurance enrollment) it's the problem that closes your firm if you get it wrong. Every recorded conversation has to demonstrably clear a quality rubric: needs analysis, consent capture, scorecard threshold, disclosure handling. The AI-scoring vendors that produce those scores each expose the data differently. The compliance templates that have to be populated all want the same data shaped slightly differently. Building a one-off integration per vendor-and-template pair is how compliance ops drowns. Worse: when a scoring system updates a call's score days after the call closed, because a reviewer overrode a measure or because the rubric itself changed, there's no clean way to know which historical exports need to be re-issued. Originally deployed against a Medicare Advantage scorecard. The framework applies to any regulated, phone-based context.

Architectural Solution

A four-category handler framework (Source, Destination, Messenger, and a category-specific AIScoringHandler interface) wired together by a YAML config file. One deployment equals one YAML. The Source category abstracts every AI-scoring vendor behind a single fetch_calls(start, end, **filters) interface that yields canonical Call+Score payloads; concrete handlers translate each vendor's wire format. The Destination category abstracts the output template (XLSX agency workbook, BI warehouse, CSV export); concrete handlers preserve template styling, sheet names, and cell formatting per row. A classified transport layer wraps every external call: TransientError, RateLimitError, AuthError, ClientError, ValidationError, each with its own retry policy, Retry-After header honored, exponential backoff with jitter on transient failures. A SQLite-backed state ledger sits at the seam between source and destination. It stores each call's content hash and implements an upsert contract (insert, unchanged, updated) so late-arriving score revisions automatically trigger a re-export. Auth is itself pluggable (API key, basic, OAuth) so the same handler ports across an entire vendor category without an auth rewrite.

Tangible Result

A scoring and compliance pipeline that runs unattended overnight and lands a fully-formatted carrier-template export in the right folder by morning. Late score revisions from the AI vendor flow through the ledger and re-export on the next cycle with zero human intervention. Onboarding a new AI scoring vendor or a new compliance template is one handler module and one config block. Not a rewrite. The framework itself is the deliverable. Every subsequent compliance-automation engagement inherits the transport, the ledger, the auth modules, and the abstract category interfaces for free.

Same pattern, different surface

The same multi-vendor scoring abstraction and compliance-template engine port to any regulated, phone-based interaction where structured documentation has to land in a specific format for audit or regulator review.

  • Medical patient outreach: HIPAA-bounded call review + scorecard export
  • Investment advisor: suitability calls + recommendation documentation
  • Legal intake: engagement scope, conflict checks, retainer capture
  • Regulated sales: Medicare Advantage, insurance, ACA compliance

Where it scales

Per-vendor handlers are isolated. Adding the seventh AI scoring vendor doesn't touch the six already deployed. The state ledger is keyed by call_id with a stable hash contract, so multi-day windows replay deterministically. Transport-layer retries are config-tunable per deployment (max_retries, backoff_base, default_timeout) and the rate-limit branch honors any Retry-After the upstream supplies. Multiple deployments share a Python install. Each one is a separate YAML pointing at its own credentials reference.

Where it mutates

Source vendor (Balto to CallMiner to Observe.AI), destination template (carrier A workbook to carrier B workbook to BI warehouse), messenger (Slack alert to email to PagerDuty), and auth scheme (API key to OAuth to basic) are all selected by YAML. The Caliper config schema documents every section. The loader validates against the supported-handlers registry at startup, so a misconfigured deployment fails fast with a readable error rather than silently producing the wrong export. New AI-scoring vendors register a single class under handlers/ai_scoring/. The rest of the library is unchanged.

handlers/base.py

# Caliper. Handlers. Root Interfaces.
# Three root categories. Concrete category interfaces
# (AIScoringHandler, CRMHandler, SpreadsheetHandler) inherit
# from these and add their own per-category methods.
 
class Handler(ABC):
@abstractmethod
def authenticate(self, credentials):
raise NotImplementedError
 
class SourceHandler(Handler):
@abstractmethod
def fetch(self, params):
raise NotImplementedError
 
class DestinationHandler(Handler):
@abstractmethod
def write(self, records, params):
raise NotImplementedError
 
class MessengerHandler(Handler):
@abstractmethod
def notify_success(self, result):
raise NotImplementedError

Disclosure

What you're not seeing here.

A curated selection

The case studies above are a deliberate sample of recent work. Additional engagements, deeper architectures, and adjacent tooling exist in the private archive. Client names, system endpoints, credentials, schema-level identifiers, and any logic that could be reverse-engineered are intentionally omitted.

View the full project archive

Available under engagement

Live demos, full architecture briefs, and verifiable production metrics are available during a Discovery & Architecture Blueprint engagement. Request access via the contact form and we'll send the materials under NDA.

Request the dossier

Engage

Recognize your firm in one of these?

Most do. The patterns repeat across every breakout-founder practice. Medical, legal, advisory, dental, and every other operation that has to build the infrastructure the institution used to provide. The Blueprint is the qualifying engagement.