Back to Projects
Personal Project2026AI + Regulation

Lending Agent

A working prototype exploring what an AI-mediated, FCA-aligned consumer credit broking journey looks like end to end. Built in my own time as a personal research project, separate from any work I do for my employer.

Try the simulation
lending-agent.vercel.app

Open the installer surface, capture a project by voice, then walk the customer journey on a generated link. Every disclosure, consent, and lender outcome is real model output. No real credit search runs.

Open simulation

Why I built this

I've spent years thinking about consumer credit broking platforms. Forms have hit a ceiling. A long form is a long form whether it's paper or digital. Customers abandon at every page. Installers can't help fill them in because they're not allowed to. The format is the problem.

I wanted to build the thing I'd been writing and talking about, end to end, with my own time and my own API key. Not a product. Not a pitch deck artefact. A working prototype I could open on a Saturday morning and walk through with anyone (retailer, broker, lender, or regulator) to ground a conversation in something concrete.

This is a personal side project. It is not a product of any firm I work for. The codebase is mine, the architectural decisions are mine, the demo is mine. It exists to advance my own thinking and to give me something useful to point people at.

The journey, end to end

The demo simulates a solar finance journey but the structure is generic to any retailer-introduced consumer credit. Two surfaces and a back office:

Installer. Voice-first intake on the doorstep. The installer says "seventeen and a half thousand pounds solar plus battery, ten percent deposit, customer is Sarah, sarah at example dot com" and the agent extracts everything in seconds. A customer link is generated and sent.

Customer. A plain-English journey on the customer's phone. Status disclosure, eligibility check, indicative quote configurator, optional email opt-in, application details form (Information Request gate), Consumer Duty vulnerability indicators, credit search consent, pre-contract confirmation, application submission, sequential lender waterfall, counter-offer or decline path, acceptance.

Audit. Back-office compliance log with a chronological timeline of every event, full disclosure presented/acknowledged timing, consents, vulnerability flags, and waterfall outcomes. Plus a statistical replay engine that re-runs each disclosure N times to produce a per-disclosure compliance pass rate.

Architecture

The model is a narrator, not a controller. Every regulated state change either has a UI button that emits a deterministic event, or is reconciled server-side. The agent owns prose and pacing. It never owns state mutation alone. This matters because LLMs are probabilistic; the deterministic side is what makes the journey safe.

Centralised reconciliation. One pure function holds three rules that close gaps the model leaves open: ack the linked disclosure on consent, present the pre-contract summary on consent, run the waterfall when all gates pass. Every state-reading route calls it. Routes pick whether they're allowed to mutate (audit views never auto-submit a stalled case).

Structured event tag protocol. The model embeds <agent-event> tags in its prose. A streaming parser strips them out, applies them to case state, and the visible text goes to the transcript. Direct events from the UI use the same shape.

Stateless serverless with URL-borne state recovery. Vercel functions don't share memory across cold instances. Case state lives in an in-memory map and a base64-encoded seed parameter. Cold instances hydrate from the seed before reading.

Three-layer empty-turn defence. The Anthropic API rejects messages with empty text content. The codebase doesn't persist empty assistant turns, filters them when building model history, and collapses consecutive same-role turns left behind. Found by smoke-testing.

Verbatim disclosure presentation. The model never composes regulated content. It emits present_disclosure with an ID; the UI looks up the body and renders verbatim. The replay engine is what proves this empirically.

Who it's for

Retailers

Solar PV, batteries, EV chargepoints, home improvement, anywhere the customer typically finances a high-value install. The retailer is the introducer; the broker holds the regulatory permission. The agent moves the journey from a clunky web form to a doorstep conversation that completes on the customer's phone before the installer has packed up.

Credit brokers

An FCA-regulated entity arranging consumer credit through a panel. The agent is a stronger Consumer Duty surface than a form: same disclosures every time, same vulnerability check every time, replayable for compliance evidence. The trust gradient lets regulated moments render inline (high-trust user agents) or on the broker's own surface (low-trust user agents) without changing the underlying journey.

Lenders

Less changes than you'd think. The lender receives the same structured Information Request payload they'd get from any broker. What's new is the audit story. The broker can prove how the application was collected, replayable per disclosure. For lenders working with brokers under Consumer Duty scrutiny, that's a compliance asset.

Stack

Next.js 16TypeScriptTailwind CSS v4Vercel AI SDKClaude Sonnet 4.6Anthropic APIWeb Speech APIVercel

Status

Working prototype. Live on Vercel. The journey, audit, and replay layers are real. The lender panel, decisions, and credit search are all mocked. Documentation in the repo covers the architecture, the event protocol, the FCA / Consumer Duty framing, and adoption paths for each audience.

If this is interesting for your retail, broker, or lender operation, or you'd like to grab a coffee and talk about it, I'd love to hear from you.