May 7, 2025
Every day a customer waits for loan approval increases chances of abandonment, slows deal velocity, and ultimately hinders operations and growth.
With some loan approval processes lasting as long as 90 days, your company may become an easy target for more agile competition and a fast-moving market.
AI can’t replace your underwriters, but it can speed up their judgment to improve productivity and assess creditworthiness.
This can reduce the time taken to understand which clients are a good fit for your institution and which increase your exposure, impacting pricing and risk management.
In this guide, you’ll learn how to build an AI loan underwriting agent with Stack AI, a no-code AI builder platform.
See how to upload the financial documents of a prospect, get a detailed breakdown of core metrics, and receive AI-generated insights for decisioning.
How to Build an AI Loan Underwriting Agent
Here's a step-by-step walkthrough on how to build an AI loan underwriting agent using the Stack AI platform.
Upload financial documents
First, register a free account for Stack AI. From the dashboard, select New Project -> Workflow Builder. Select the New Project template.
First, we’ll add support for uploading financial documents. On the left menu, expand the Inputs section, drag and drop a Files node onto the canvas.

Extract data from documents with Gemini
The Gemini models are known for their massive context window, enabling them to work with up to 1 million tokens at a time (~512 pages of text). Beyond this, they’re multimodal, meaning they can handle data extraction tasks from uploaded files.
This is useful if you plan to use a lot of historical financial data to generate a more accurate report, without pre-processing the data with OCR.
Click the Settings icon on the OpenAI LLM.

Click the provider dropdown and select Google.

Expand the model dropdown and choose Gemini 2.5 Pro.

Scroll down the settings to increase the Max Output Tokens to 60,000. This will let the model generate as much data as needed to extract all the transactions and financial information from uploaded documents.
Tip: you can double-click the number and type the value manually.

Connect the Files node to the Google node.

This isn’t the last step of our reasoning workflow. Hover the connection between the Google LLM and the Output nodes and click the delete icon to remove it.

The model needs instructions to understand what to do. Paste the following text into the Instructions input field:
You are a financial document analysis assistant. Your role is to read and interpret uploaded documents (such as bank statements, invoices, and financial reports) and extract relevant financial information.
You do not calculate totals or perform any mathematical reasoning. Your focus is strictly on identifying and extracting data points clearly and consistently.
Follow these steps for each document:

Notice that this model will not run any calculations: traditional LLMs such as Gemini 2.5 usually hallucinate mathematical results. Its purpose is merely data extraction. We’ll address calculations in the next section.
Delete the text currently in the Input field of the Google node and paste the following:
User Financial Data:
Type a forward slash after the text and select the Files input from the dropdown.

Summarize financial data
The OpenAI o4 Mini, a reasoning model, is a much better match for calculations and math. We’ll be using it to transform the extracted data to provide insights and metrics that support the next stages of the reasoning.
Expand the LLMs section, drag and drop the OpenAI node onto the canvas.

Click the model selection dropdown and choose o4 Mini.

Connect the Google to the Open AI node.

o4 needs to know how to process data. Paste the following text into the Instructions input field and edit it to include any metrics or calculations proprietary to your underwriting process:
You are a Financial Summary Assistant. Your job is to take raw transaction data from an upstream extractor model and produce a concise, human-readable summary of key calculations and metrics. Your output must be plain text only—do not wrap it in JSON or any other code format.
For each input, include:

Delete the text inside the Prompt field. Pass the data from the Gemini model in the prompt of the o4 model:
Data:
Then, type a forward slash and select the Gemini model from the dropdown.

Determine creditworthiness with AI
Now that we have a summary and calculations on a prospect’s financial history, we will use AI to determine creditworthiness, offering insights that will help you make decisions.
Expand the LLMs section on the left side, drag and drop another OpenAI node onto the canvas.

Select the o4 model from the dropdown.

Connect the newest LLM node to the previous OpenAI one and the Output node.

This model has a different task. Edit these suggested instructions to comply with your underwriting process and paste them in the Instructions input field:

As for the prompt, we’ll pass the additional instructions set by the user in case your team wants to steer the reasoning process. Write the following into the Prompt input field:
In front of Additional Instructions, type a forward slash and select Text Input. As for Data, type a forward slash again and select the previous OpenAI node’s output.

Format the output into a report
With Stack AI, you can easily build a report by combining the results of multiple models into a single output. Click the Settings icon on the Output node.

Add a Template to the response by clicking the corresponding button.

We’ll display the summary of the extracted financial information along with the AI creditworthiness assessment. Use the header formatting to add the following to the template:
Summary of uploaded financial documents
AI reasoning
Type a forward slash below the first section and select the first OpenAI LLM node. Repeat the process for the second section (AI reasoning) but choose the last OpenAI LLM node instead.

The project’s architecture is complete. Click Publish to save these changes.

Expand with financial APIs
This guide covers the basic functionality of an AI-driven creditworthiness scoring tool. Since AI works better with as much accurate data as possible, you can integrate your internal and third-party financial APIs to run custom calculations based on user data and use the results to generate a more comprehensive final report.
Stack AI integrates with custom services via its Data API node. You can set up API calls to infrastructure, such as Experian, Plaid, or others, seamlessly running calculations and checks to increase automation and productivity.
Regulation, governance, security, and compliance
The financial industry is a highly-regulated ecosystem. Here’s how Stack AI can help you navigate these requirements from both a platform and project architecture perspective.
Stack AI has SOC 2, GDPR, and HIPAA compliance, meaning it has high data security and protection standards. You can process information privately and securely within the platform. It has enterprise-grade security controls, including role-based access (RBAC) for effective permission management and interface-level protection.
Stack AI projects offer robust data input and output methods, so you can connect any or all parts of the workflow to external databases and information storage systems. This is important as you can store decision-making processes, audit trails, and customer data in external sources.
Regarding observability and transparency, you can implement as many checks as necessary to enable human-in-the-loop frameworks and auditing. You can do so by:
Creating multiple Stack AI projects and having your underwriters trigger each section of the logic manually, weaving human and AI judgment into a single workflow
Enhancing your existing internal tools with a workflow interface that connects multiple Stack AI projects, with each midpoint as a human approval gate (your IT team can either embed the Stack AI interfaces or use the Stack AI API for programmatic access)
Adding multiple output nodes in Stack AI after LLM reasoning steps to store the output, creating an audit trail to troubleshoot data drift, faulty reasoning, or imprecision
The architecture suggested in this guide does not make binding decisions unless you connect it with deal greenlighting systems. Underwriters can use AI output to enrich their assessment or safely disregard it without business impact.
The Stack AI team is ready to answer any questions about privacy, security, and project architecture requirements with objective suggestions and solutions. Schedule a free demo to learn more.
Configure the user interface
We’ll build a form interface that will let your team upload multiple financial documents, add instructions, and get the report once the project finishes running. Click the Export tab to start the configuration.

The form interface is selected by default. Start by naming and adding a description of your tool to improve user experience.

Make sure the files and additional instructions inputs are exposed in the interface. You can also change the alias and required status of each field to make the functionality clearer for your team.

Use the Security features to protect this interface from unauthorized use. You can set an access password, SSO, and embedding rules if you’re planning to integrate it with existing interfaces.

Click the Save Interface to make these changes available to your team.

Share it with your team by copying the link above the preview window and paste it in an email or in an internal communications channel.

Track analytics
Keep track of tool performance for troubleshooting and optimization via the Analytics tab. You can track total users, runs, tokens and errors, along with a breakdown of past runs. Generate AI reports and download logs for deeper analysis.

Faster creditworthiness assessments
AI can reduce the time to assess creditworthiness, helping your team build deals that are more relevant and less risky. The added deal velocity will translate into growth, agility, and greater capacity to handle demand.
Start automating this and other financial use cases with a free Stack AI account.

Jonathan Kleiman
Customer Success at Stack AI
Articles