Case study · Production AI engineering

ProspectIQ

An agentic AI system that turns a single company name into a verified B2B sales dossier — live in a paid pilot across four countries.

The hard part of production AI for sales isn't calling a model — it's making sure it never lies, and never runs up an unbounded bill. ProspectIQ pairs a five-stage agentic pipeline with a verification layer that validates every numeric claim against its source, and a hard cost ceiling that stops a runaway model from bankrupting a run. Researched, designed, built, shipped and operated end-to-end, solo.

RoleSole engineer — research → design → build → ship → operate
StatusPaid pilot · presales teams, 4 countries
SurfaceNext.js · Cloudflare Workers · Supabase · Gemini/Vertex

Live · prospect-iq.org (login-gated) ↗

Paid pilot
Live production, real users & real money on the line
4
Country teams — France · USA · Japan · Vietnam
~13
Account managers on a 15-seat pilot
€1.50 → €0.48
Hard per-run abort ceiling vs. real measured cost
~475
Automated tests + live smoke checks
95–98%
Cheaper per prospect than incumbent sales tools

The problem

In B2B sales, an AI that confidently invents a revenue figure or a stakeholder is worse than no AI at all — a rep who quotes it once loses the room.

Account managers need a fast, trustworthy read on a target company — financials, structure, decision-makers, footprint, fit — but generic LLM output hallucinates numbers, blends a parent company with its subsidiaries, and offers no guarantee it can be believed. The engineering challenge wasn't "generate a dossier." It was: generate one a salesperson can defend, at a cost the business can bound, without a single team seeing another's data.

The pipeline

Stage 1
Research
Gathers raw signal on the target — public financials, structure, footprint, people.
Stage 2–5
Synthesis B1–B4
Four synthesis passes build the dossier: analysis, stakeholder map, geography, service-fit + a scored verdict.
Gate
Verification
Every claim checked against its source before it's allowed into the dossier.

Streams progress to the browser live over SSE · a failed sub-stage degrades the dossier, never destroys it · 24-section output, exportable as a branded PDF.

What makes it hard — the three moats

01 · Verification-driven quality

Every numeric claim is validated against its source

The pipeline's output isn't trusted — it's proven. A dedicated verification layer runs a ladder of validators before anything reaches the salesperson.

  • A strict citation gate — claims without a traceable source are rejected.
  • Numeric-claim verification with scope- and period-matching: a 2024 figure can't be passed off as this year's.
  • Entity-scope discipline — a parent company's dossier never silently absorbs a same-named subsidiary's data.
  • Fail-safe re-checks on a cheaper model, real-coordinate geography, and repair-and-retry on malformed output.
02 · Cost governance

A runaway model can't bankrupt a run

Agentic pipelines fan out into many model calls — the failure mode is a silent, unbounded bill. ProspectIQ makes spend a first-class, bounded quantity.

  • A hard €1.50 per-run abort ceiling — runs measure ~€0.48 in practice, with headroom, not hope.
  • Per-user caps on secondary AI routes + a durable rate limiter + runaway-spend abort wiring.
  • Net result: 95–98% cheaper per prospect than the sales-intelligence tools it replaces.
03 · Resilience

Degraded ≠ failed — and vendors will die on you

Production means the unhappy path is the real path. The system is built to bend, not break.

  • Every stage soft-fails independently (degraded output beats a blank screen) with centralized fallbacks.
  • Re-architected around a multi-provider fallback after a core data vendor shut down mid-pilot — retry + rate-limit layer kept the tool live.
  • Token caps, JSON-repair, and one-shot retry on truncation so a bad model response never drops a section.

Security & rigor

9-point security review
CSRF, timing-safe hashing, brute-force lockout, prompt-injection defenses, error sanitization, URL-scheme validation, LLM body caps, per-route spend caps.
A P0 caught & closed
Found and fixed a cross-team dossier-read leak before it reached a user — the kind of multi-tenant bug that ends pilots.
~475 tests + live smoke
A real QA bar for a solo build — unit suite plus live smoke runs against the deployed worker on every change.
Custom auth, no shortcuts
HMAC session cookies, per-user seeded passwords with forced rotation, brute-force counters keyed on IP + email.

The stack

Next.js App Router TypeScript · React Cloudflare Workers (OpenNext) Supabase Postgres (EU) Gemini via Vertex AI SSE streaming Recharts · Leaflet HMAC auth jsPDF export
"The interesting part isn't the AI call — it's the verification layer and the cost ceiling. Every numeric claim gets validated against its source, and a hard €1.50 abort ceiling means a runaway model can't bankrupt a run." — on what actually matters in production AI

What it proves

Production AI with real users and real money — engineered with the verification, cost ceilings, resilience and security that separate a shipped product from a demo.