← Back to projects
Full-Stack · AI for Regulated Finance Live Alpha

NBFC Compliance Intelligence

A retrospective RBI-compliance auditor for Indian NBFC lenders — deployed and running, not a slide deck. It ingests a lender's own loan documents and collections-call transcripts, and issues a cited, auditable verdict on every obligation, with a hard guarantee that no verdict can cite a regulation that doesn't exist or wasn't in force on the date it matters.

Heads up if you're about to try the live product. This is a live alpha — I put it in front of people early on purpose. The trust properties are already at target: 0 hallucinated citations across every eval suite, 100% deterministic-rule accuracy on the numeric obligations (currency limits, mandatory timelines, etc.). The harder part — judgment calls on ambiguous compliance questions — is currently at ~31%, root-caused into retrieval-miss (~45% of failures) vs. model under-confidence (~55%), and is exactly what I'm iterating on right now. If you hit a wrong answer, that's why — and the fix path is the interesting engineering, not the number itself.

Recruiter or engineer with questions? Reach me at rajanofficial002@gmail.com or on LinkedIn — happy to walk through the architecture or discuss what I'm working on next.

The problem

Indian NBFCs operate under dense, frequently-amended RBI directions covering digital lending, recovery practices, disclosure, and grievance redressal. Compliance teams audit loan documents and call transcripts by hand against regulation text that keeps changing — slow, error-prone, and with no systematic way to prove which version of a rule applied to which event date. This system automates that retrospective audit end to end, while keeping a paper trail a human — or a regulator — can actually follow.

Architecture — four stages, each independently testable

Extract → an LLM pulls ~80 typed fields from raw document text against a versioned schema, every value grounded in a quoted, PII-redacted span of the source. Retrieve → resolves the regulatory corpus as of the event date (never "today"), via hybrid vector + lexical search fused with Reciprocal Rank Fusion. Decide → 28 hand-written deterministic rules run first; the model is only called when no rule resolves the fact, and every decision is logged with which one made it. Validate → the hard guarantee: no verdict ships without a citation that resolves to a real clause whose effective window contains the event date, enforced by a dedicated validator in code — a failure downgrades to "no clause found" rather than passing silently through.

~80typed fields extracted per document, each grounded in a redacted source quote
28deterministic compliance rules that run before any model call
4verdict classes: compliant, violation, ambiguous, no clause found
0raw documents ever persisted — not in the database, logs, or task queue

A real production bug, found and fixed

Not a hypothetical — this happened. A local, from-scratch reproduction of the full stack (Postgres, Redis, Celery — no Docker daemon available, so everything was provisioned from raw packages) surfaced that the assessment pipeline was making its per-fact LLM calls sequentially. Eight facts took 33.8 seconds; a real document with 15–20 facts would blow past any reasonable timeout. The fix: fan the independent per-fact assessments out concurrently, bounded by a semaphore — roughly a 4x wall-clock improvement, with a regression test written specifically so it can't silently regress back to sequential.

Before — 8 facts, sequential33.8s
After — concurrent, semaphore-bounded~4x faster

Security and data posture

Deployment

Live on Fly.io: four processes (Redis, Celery worker, backend API, reverse-proxy gateway) inside a single Firecracker microVM for near-zero cost, with the backend bound to loopback-only and only the gateway internet-facing — genuine defense-in-depth, not cosmetic. Neon serverless Postgres for the database tier, with a custom domain and TLS via Fly-managed Let's Encrypt certificates. The demo frontend is hand-built with no framework: client-side PDF parsing (no backend load) and a live 5-stage pipeline visualization driven entirely by real telemetry — no fabricated data.

Ownership

I designed and shipped this alone, end to end: the regulatory data model, the four-stage pipeline, the security posture, the deployment topology, and the incident above — root-caused by reproducing the full stack locally rather than guessing at the fix. Same shape of ownership I'd bring to a production LLM system on a team: not just the model-calling code, but the trade-offs, the failure modes, and being accountable for both.

← Back to projects Get in touch