Skip to main content
Partial — samples shipping

Agent-native lending and mortgage operations

ClawQL’s lending vertical (clawql-lending) composes the IDP pipeline, vault memory, HITL review, and workflow automation for loan origination: W-2s, bank statements, and underwriting packages with structured audit trails throughout.

Lending compose stacks and W-2 samples use synthetic data only. Consult qualified legal, compliance, and underwriting professionals before production use.
Overview

ClawQL for lending

Mortgage, auto, BNPL, payday, and commercial lending share the same document-heavy intake problem: borrowers submit heterogeneous PDFs, underwriters re-ask for the same conditions, and API integrations sprawl across LOS, credit, and document vendors. Modularization v2.1 defines clawql-lending as five sub-verticals on one gateway — MortgagePlugin, AutoPlugin, BNPLPlugin, PaydayPlugin, and CommercialPlugin — plus shared UnderwritingPlugin and CompliancePlugin for Reg Z, ECOA, and fair-lending guardrails. Today you can run the lending Docker Compose stack and the shipped W-2 reference pack; full LOS tool registration ships with the vertical package.

Challenges

Problems agents solve in this vertical

These are the operational friction points clawql-lending targets — on top of ClawQL Core search, execute, memory, audit, and the IDP pipeline.

Spec dumps burn planning tokens

Credit bureau, GSE, and LOS OpenAPI surfaces are enormous. search returns ranked operationIds; execute validates args server-side — so the spec stays in the MCP server, not the prompt.

Context dies between underwriting sessions

Cleared conditions and vendor analysis live in email threads. memory_ingest and memory_recall give underwriters durable borrower context across Cursor, OpenClaw, and your LOS-adjacent automations.

Low-confidence OCR needs humans in the loop

W-2 box misreads create repurchase risk. classify_document routes by type; hitl_enqueue_label_studio suspends Argo workflows until a reviewer confirms fields.

Platform

Shared ClawQL capabilities

Every vertical package composes these horizontal layers — security, memory, and document intelligence.

  • IDP pipeline: pdf-inspector route + Docling, Tika, Gotenberg, Stirling, archive, Onyx, Coneshare
  • Vault memory with wikilinks for borrower files and underwriting decisions
  • Argo Workflows suspend/resume integrated with Label Studio HITL
  • Cosign-signed MCP images with Kyverno admission on Helm deploys
  • Optional Fabric consortium features via clawql-blockchain peer dependency
Domain tools

Tools from clawql-lending

Planned or shipping MCP tools from modularization v2.1 — registered when the vertical package is enabled via CLAWQL_ENABLE_* or Operator flags.

gse_validate()

Validate loan data against agency guidelines indexed in Onyx.

condition_clear()

Record and recall underwriting conditions with vault threading.

pii_redact()

Strip borrower PII before documents enter search indexes.

loan_archive()

Tag and archive loan packages in Paperless or the native archive layer.

bnpl_decision / fraud_check()

Sub-second decision loops for BNPL with Cuckoo dedup on doc batches.

Document types

What the IDP pipeline processes

Representative inputs agents classify, extract, redact, and archive in this vertical.

  • W-2 and 1099 income forms
  • Pay stubs and VOE letters
  • Bank statements and asset statements
  • Appraisal and title commitments
  • Purchase agreements and closing disclosures
Use cases

Why ClawQL for lending

Vertical packages extend the same Agentic Gateway — search, execute, memory, IDP, audit — with domain tools from clawql-lending.

Income document ingestion

Parse W-2s and pay stubs with Docling layout OCR, classify by document type, route low-confidence extractions to Label Studio, and archive tagged outcomes for underwriters with correspondent metadata.

Underwriting memory across sessions

memory_recall surfaces prior borrower conditions, cleared stipulations, and vendor analysis so underwriters pick up where the prior session left off whenever a loan file reopens in a new agent thread.

Multi-product LOS coverage

Mortgage, auto, BNPL, payday, and commercial modules share compliance plugins but register distinct MCP tools — enable only the products you originate via CLAWQL_ENABLE_* and Operator vertical flags.

Compliance-aware automation

Shared CompliancePlugin targets Reg Z, ECOA, and fair-lending checks. audit logs structured MCP events; dedicated managed hosting isolates tenant workloads for strict lenders.

Examples

Example agent workflows

Representative MCP tool sequences with step-by-step detail — production deployments add tenant classifiers, RBAC, and your compliance policies on top.

Shipped reference path — synthetic W-2 through Docling, classify, HITL, vault.

W-2 intake with confidence routing

The lending W-2 pack demonstrates the full pattern agents use for income verification: parse, score confidence, human review when needed, persist decisions durably.

  1. 1Route PDFinspect_pdf on W-2 PDF — TextBased → local markdown; else Docling OCR.
  2. 2Parse layoutexecute docling_convert_file on fixtures/synthetic-w2.txt — layout-aware OCR for boxed forms.
  3. 3Classifyclassify_document routes W-2 vs pay stub vs bank statement before extraction schema selection.
  4. 4Route low confidenceScore below threshold → hitl_enqueue_label_studio with Label Studio project from label-studio-config.xml.
  5. 5Persist reviewWebhook fires → memory_ingest appends reviewer fields with wikilinks to the loan file note.
inspect_pdf()execute()classify_document()hitl_enqueue_label_studio()memory_ingest()

Production-style workflow template with explicit suspend step.

Argo suspend / resume for underwriting HITL

workflow submits clawql-lending-w2-ingest; operators resume after Label Studio while pipeline state is preserved in Argo.

  1. 1Submit workflowworkflow operation submits WorkflowTemplate clawql-lending-w2-ingest with confidence_threshold parameter.
  2. 2SuspendTemplate hits suspend when classify confidence < threshold; the file waits in Argo rather than blocking chat context.
  3. 3Human reviewUnderwriter completes Label Studio task; webhook validates CLAWQL_HITL_WEBHOOK_TOKEN.
  4. 4Resumeworkflow resume continues to finalize step; audit captures correlation_id for the loan.
workflow()hitl_enqueue_label_studio()memory_recall()

OpenClaw or Cursor picks up where the last underwriter left off.

Cross-session borrower recall

A fresh agent thread calls memory_recall with the borrower name and condition keywords — vault returns ranked snippets without re-uploading prior PDFs.

  1. 1Recallmemory_recall query "borrower Smith conditions cleared 2026" with maxDepth for wikilink graph.
  2. 2Discover APIssearch finds LOS or credit APIs for status updates — no 9 MB spec in prompt.
  3. 3Executeexecute updates condition status with validated args and bearer token from env.
  4. 4Ingest outcomememory_ingest appends what changed with append: true on stable title.
memory_recall()audit()search()

POC underwriting environment via Docker Compose.

One-command local lending stack

docker compose -f lending.compose.yml brings up MCP, Docling, classifier, LangExtract demo, and Label Studio CE — documented in docker/compose/README.md.

  1. 1Bootstrapcp lending.env.example; docker compose up -d --build.
  2. 2Wire HITLPaste label-studio-config.xml; set CLAWQL_LABEL_STUDIO_API_TOKEN; configure webhook to /hitl/label-studio/webhook.
  3. 3Connect agentPoint Cursor or OpenClaw at http://localhost:8080/mcp (streamable-http).
  4. 4Smoke W-2 flowRun classify → HITL path from deployment/samples/lending-w2/README.md.
search()execute()audit()
Security & compliance

Built for regulated workflows

Industry pages summarize platform capabilities — your legal, compliance, and security teams should review docs.clawql.com/security before production data.

  • PII redaction via Stirling in the IDP pipeline before archive and Onyx indexing
  • Structured audit ring buffer plus optional vault postmortems for examiner requests
  • Vertical RLS and ATR scoping planned via clawql-auth — underwriter role bound to mortgage vertical
  • Cosign-signed images and Kyverno verifyImages on self-hosted Helm
  • Fair-lending and Reg Z hooks in shared CompliancePlugin (modularization v2.1)

Ready to demo ClawQL for lending?

Self-host the lending compose stack today, or join the managed waitlist for hosted MCP, vault, and IDP tailored to lending workflows. Start your 14-day trial or self-host free with npm or Helm — full Apache 2.0 stack, no license fee.