Inspiration

I was inspired by the sheer inefficiency of the corporate lending market. Highly skilled loan agents spend 3+ days a week manually "staring and comparing" 300-page PDF agreements just to extract a few dozen commercial terms. It's an archaic process in a digital world. I wanted to see if I could use the latest multimodal AI to turn this unstructured chaos into a real-time market intelligence hub—cutting that review time from 3 days to 3 seconds.

What it does

LoanPulse AI is a Market Intelligence Hub for the Loan Market Association (LMA) ecosystem.

  1. Ingests complex loan facility agreements (PDFs).
  2. Extracts key commercial terms (Borrower, Margin, Maturity, Covenants) using Google Gemini 2.5 Flash with >95% confidence.
  3. Validates the document against 10 standard LMA terms to generate a real-time "Compliance Score."
  4. Analyze the data immediately, offering interactive charts that compare interest margins against the wider market and visualize portfolio health.

How we built it

I built LoanPulse AI as a modern, monolithic web application using Laravel 12 (PHP) on the backend and React 18 with Inertia.js on the frontend for a seamless single-page application experience.

  • AI Engine: The core logic uses Google Gemini 2.5 Flash via the API. I crafted specialized prompts to force structured JSON output from raw legal text.
  • Pipeline: To handle large PDFs without freezing the UI, I implemented an asynchronous job queue using Laravel Queues.
  • UI/UX: I designed a custom Glassmorphism interface using TailwindCSS and Lucide React icons to give it a premium, "Bloomberg Terminal" feel.
  • Visualization: I used Recharts for the interactive analytics and margin comparison charts.

Challenges we ran into

  • Hallucinations vs. Reality: Early tests with generic prompts led to the AI guessing terms. I solved this by implementing a strict "Confidence Score" system and a regex-based fallback engine for double-verification.
  • Async UX: Handling long-running AI tasks in a web UI is tricky. I had to build a robust real-time polling system to show the "Processing..." progress bar and trigger toast notifications without requiring a page reload.
  • PDF Parsing: Extracting clean text from multi-column legal layouts was difficult. I optimized the text extraction pipeline to feed Gemini cleaner data, significantly improving accuracy.

Accomplishments that we're proud of

  • 95%+ Accuracy: achieving near-human level extraction on complex LMA terms.
  • The "Happy Path" UX: The drag-and-drop to "Analysis Complete" flow feels magical. It really does happen in seconds, and filteringthe LMA compliance heatmap by date.
  • Integrated PDF Viewer: I built a custom checking interface where users can view the original PDF side-by-side with the extracted data, solving the "trust" problem inherent in AI tools.

What we learned

I learned that Gemini 2.5 Flash is incredibly capable at understanding legal nuance, often better than regex alone. I also learned the importance of "Human in the Loop" design—building the UI not just to automate the work, but to empower the human agent to verify and trust the automation.

What's next for LoanPulse AI

  • OCR Integration: Adding Tesseract to handle scanned/physical documents.
  • Covenant Logic: Moving beyond simple term extraction to complex financial covenant logic parsing (e.g., "if leverage ratio > 3.0x then...").
  • Market Benchmarking: Aggregating anonymous data to provide industry-wide interest rate benchmarks.

Built With

Share this project:

Updates