Project 08
DFW Insurance Group Demo
A complete website for a fictional insurance agency, used to show real agency owners a working AI chat assistant and quote intake on a site like theirs.
Who uses it
Independent insurance agency owners I am pitching, who open it from a demo video or a prospect page and click through it themselves. The site is labeled as a demo with a dismissible banner, and the agency is not real.
Why it was built
Describing an AI assistant to an agency owner does not land. Letting them type a question into one on a site that looks like their own does. I built a fictional agency so I could show the whole system, chat, quote forms, declarations page upload and the data behind it, without touching a client's real site or data.
What it does
The site has a home page, a page for each line of coverage (personal auto, homeowners, umbrella, life, commercial auto, commercial property), team, about, FAQ, contact and a learning center. A chat assistant answers visitor questions from the agency's own content and, when a visitor clearly wants a quote and consents, collects their details and sends them to a licensed agent. A quote wizard and a Speed Up My Quote flow let a visitor upload a declarations page, which Claude reads to pull carrier, premium, limits and renewal dates so the agent email arrives quote ready. A visitor can also ask to be texted a link to upload the page later, with the consent wording recorded.
What it serves
It is the proof behind Rivyn's pitch and the template for the insurance vertical. Success is an agency owner trying the assistant, seeing a quote request and a declarations page turn into a quote ready email, and wanting the same thing on their own site.
Under the hood
Next.js 16 with React 19, TypeScript and Tailwind CSS v4, deployed on Vercel. The assistant is retrieval augmented: the site's markdown content is chunked into a Pinecone index that embeds it with a hosted model, each question pulls eight candidates and reranks them to four, and Claude Haiku answers from that source material with a cached system prompt and a capture_lead tool, streamed back as plain text. Leads, conversations, renewal dates, declarations pages and a lead event funnel live in a multi tenant Supabase schema with row level security on every table and no policies, reached only from the server with the service role key. Lead emails go out through Resend, and every paid route is capped per IP and per day in Upstash Redis.
Flow
- Visitor question
- Pinecone retrieve and rerank
- Claude answer
- capture_lead tool
- Agent email and Supabase
Built with
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS v4
- Claude API
- Pinecone
- Supabase
- Resend
- Upstash Redis
- PostHog
- Vercel
How I built it
- I started from a fresh Next.js app and built the agency site, then rebuilt the whole front end from a Claude Design handoff into a navy enterprise look with a written design system.
- I wrote the knowledge base ingest script that chunks the site's own markdown into Pinecone, and the chat route that retrieves, reranks and answers from it.
- I designed the Supabase data layer as tenant one of a reusable schema: clients, leads, conversations, calls, renewals, events and monthly metrics, with a setup and verify script and an inspect script.
- I added security guardrails early: a server-only import guard so the database module can never reach the browser, and a pre-commit hook that blocks env files and staged lines that look like keys or tokens.
- I built the declarations page accelerator, with Claude vision extraction, a private storage bucket, a lead event funnel and the text me a link path, then did a mobile pass and removed the voice affordances because the voice agent was not live yet.
- Before using it in outreach I put hard caps on every paid route, moved the counters to Upstash Redis, made the capped reply hand off to an agent instead of admitting a limit, and added PostHog events.
Key decisions
- I used Pinecone integrated inference for embeddings and reranking, so the only AI vendor is Anthropic and the only retrieval vendor is Pinecone, and every index, model and namespace is overridable by env var so a new client build changes config, not code.
- Lead capture is a Claude tool with strict rules: it only fires with explicit consent and a valid name, ZIP, email and phone, the server validates again, and the tool loop is capped at three turns so a misbehaving model cannot loop.
- Spend caps on the chat route are 8 requests per IP per minute, 15 per IP per day and 600 across all visitors per day, with tighter caps on declarations page upload (2, 6, 60), SMS (1, 3, 30) and quote leads (3, 20, 150). Over the cap the visitor gets a canned hand off to an agent and nothing paid runs.
- Row level security is on with no policies on every table, so the anon and authenticated roles are denied entirely and all access goes through server code with the service role key.
- Every integration degrades instead of failing: no Anthropic key gives a canned reply, no Pinecone key answers from agency facts only, and no Resend or Telnyx keys run in simulated mode, so the demo works end to end with nothing switched on.
- The model's em and en dashes are replaced in the stream on the server, so the house style holds in every reply.
