Skip to main content
ProjectsLoanWise AI

Project 08 / 12

Pipelined Multi-Agent Workflow

LoanWise AI

Loan origination demo that runs applications through a pipeline of specialized agents (risk, bias, documents) in a fixed order, so every approval or denial traces back to the specific rule that produced it, not a black box.

loanwise-ai-weld.vercel.app
LoanWise AI preview
Stack
FastAPISQLiteOpenAIGemini
Modules
4
Key decisions
2

01Problem

What was broken

A loan officer denies an application and the applicant asks why. "The model said so" does not survive an audit. Credit decisions need to trace back to a specific rule, reproduce the same result on a retry, and get checked for bias, and an LLM that just outputs approve or deny can't do any of that.

02Impact

What it does now

Every decision exposes its own reasoning: DTI ratio, credit score factors, and the specific risk rule that fired, so an approval or denial can be explained and reproduced instead of just trusted.

03Architecture

How it is built

Each application moves through a fixed sequence of agents: RiskAssessor, BiasDetector, DocumentVerifier, EmailGenerator. State for the fast-track flow lives in FastAPI background tasks, and nothing runs out of order.

Modules

  • RiskAssessor
  • BiasDetector
  • DocumentVerifier
  • Fallback Router

04Intelligence

Where the AI sits

Prompts route to the primary LLM (Gemini 2.5 Flash) first, fall back to OpenAI GPT-4o-mini on failure, and fall back again to deterministic heuristics if both time out, so a bad model day never stalls an application.

05Decisions

Trade-offs I chose

  1. 01

    Fixed Pipeline Order, No Agent Loop

    There's no agent loop here, just a fixed pipeline order. Each agent runs once and hands its output to the next, so the same input produces the same sequence of steps every time, which is what auditability actually requires.

  2. 02

    Heuristics Overriding AI

    Before a credit outcome saves, a Python logic layer checks it against DTI max percentages and other regulatory limits. The LLM's output has to pass that layer; it can't override it.