The underwriting rules engine is live!

The underwriting rules engine is live!

Remember the underwriting rules engine I mentioned a couple posts back? The API and frontend I said “hasn’t started yet” are done now, and live. Here’s the update.

The API is a thin FastAPI layer over the same Postgres functions from before - evaluate_quote_full, evaluate_quote_short_circuit, the rest - no business logic duplicated in application code, just HTTP in and out. It also grew an admin side: endpoints to create a product, add its questions, and add its rules, all gated behind an admin key, so building a new product’s catalog is a request instead of a hand-written SQL file. I added one thing the original design didn’t have too: an endpoint that reports which specific rule decided a quote’s outcome and which answer drove it - useful for the UI, and honestly just more trustworthy than handing back a bare “decline” with no reason.

On top of that, a React frontend: pick a product, answer its questions, run either evaluation model, and see a running history of every evaluation on that quote. The same admin key unlocks a page to build a new product from scratch, or browse the questions and rules on an existing one.

Three separate repos in the end - the SQL project, the API, and the frontend - same pattern as the chatbot before it. This time I also added a small Jupyter notebook as an extra client, mostly so I could poke at the API from a REPL without opening a browser.

It’s all deployed now: Postgres on Neon, the API on Render, the frontend on Vercel. You can try it yourself at paco-uw-web.vercel.app - pick a product, answer a few questions, and see what it decides.