case study
Problem
An offer used to go out as a bare number. Accepting it is a trust decision, and a number alone gives the customer nothing to trust — no comparables, no reasoning, no answer to "why is this fair?"
What it does
For every quote, the system researches comparable sales, uses an LLM judge to select the strongest comps, and runs a self-correcting generator that writes a pitch grounded in them — so each offer arrives with its argument attached, automatically.
System
How a quote gets the case for its offer — and what runs underneath. Click Offer moment to open it.
LLM step
What builds the offer's case · ⊕ opens a step
Overview · 01/03
A quote finishes pricing. Offer moment builds the case for its offer in one Lambda. Click the box to open it.
Architecture
- 01Quote priced (event-driven trigger)
- 02Structured data retrieval to ground each card
- 03Comparable research: own sales, expert comps, or agent search
- 04Deterministic gate, then LLM-judge comp selection
- 05Pitch generation
- 06Faithfulness judge, with up to 4 revisions
- 07Pitch attached to the offer
Stack
- TriggerEvent-driven backbone (SQS + Lambda)
- RetrievalSQL over the platform replica + Snowflake sales
- ModelsGemini via pydantic-ai, structured outputs
- SelectionCode gate + LLM-as-judge picks by ID
- GenerationSelf-correcting generator ⇄ judge loop
- ObservabilityLangfuse traces · PostHog prompts + LLM analytics
- RuntimePython on AWS Lambda, S3 checkpoints
Outcomes
- Offer acceptance more than doubled in phase one: 11.5% → 26%
- Every quote ships with an evidence-backed pitch, no human in the loop
Code is private — happy to walk through it.