Definition

The Multi-Source Underwriting Assistant is an enterprise RAG system that synthesizes borrower data from disparate sources (PDF tax returns, SQL core banking systems, and live property valuation APIs) to generate a preliminary underwriting recommendation.

It utilizes Hybrid Search for data retrieval and the Scratchpad Pattern to track the complex decision chain required for loan approval.


Architectural Workflow

1. Intent Analysis & Strategy

The agent receives a request: "Review the creditworthiness of Borrower #4491 for a $500k mortgage. Check if their debt-to-income (DTI) ratio meets our current guidelines."

  • Strategy: The agent identifies it must: (1) Fetch the borrower's total monthly debts, (2) Calculate monthly qualifying income from tax returns, and (3) Verify the property valuation supports the loan-to-value (LTV) requirement.

2. Hybrid Retrieval (Module 1.1)

The agent calls an Internal Data MCP Server:

  • Sparse (Keyword) Search: Queries the SQL database for "Borrower #4491" to retrieve current credit card and auto loan balances.
  • Dense (Semantic) Search: Searches the "Underwriting Guidelines 2026" PDF index for "Debt-to-Income (DTI) limits for Conventional loans."
  • Fusion: Results are merged via RRF to prioritize the borrower's specific debt records alongside the relevant policy sections.

3. Context Management (Scratchpad)

The agent uses a underwriting-decision-log.md to manage its reasoning steps.

  • Entry 1: "Verified monthly debt from SQL: $1,200 (Auto + Credit Card)."
  • Entry 2: "Analyzed 2025 Tax Return (PDF): Adjusted Gross Income is $120,000. Monthly: $10,000."
  • Entry 3: "Calculated DTI: 12% (Existing Debt) + 25% (Proposed Mortgage) = 37%."
  • Observation: 37% is within the 43% guideline limit found in retrieval.

4. Subagent Analysis (Appraisal Specialist)

To analyze a 50-page Appraisal Report without exhausting the main context window, the agent spawns an Appraisal Specialist subagent.

  • Task: "Extract the 'Appraised Value' and check for any 'Subject To' repair conditions."
  • Result: "Value: $550k. No repairs needed."

Technical Stack

  • Retrieval: Hybrid Search (PostgreSQL + pgvector for borrower records; Vertex AI Search for PDF Guidelines).
  • Reranking: Vertex AI Ranking API to ensure the specific DTI policy clause for Conventional loans is prioritized over FHA or VA clauses.
  • State Persistence: Redis to store the underwriting scratchpad across the multi-minute analysis process.
  • Normalization: Docling to transform complex tax forms into clean Markdown for income calculation.

Use Case: Qualifying Income Verification

  1. Input: Borrower provides a 100-page tax return package.
  2. Action: Agent uses Hybrid Search to find the specific "Schedule C" sections. It calculates income after subtracting non-recurring expenses.
  3. Output: A grounded recommendation: "Based on Section 2.1 of the 2026 Guidelines, the borrower's income qualifies at $10k/month. DTI is 37%, which is under the 43% ceiling. Recommend approval pending final title review."