Digital lending is a crucial enterprise enabler for banks and monetary establishments. Clients apply for a mortgage on-line after finishing the know your buyer (KYC) course of. A typical digital lending course of entails varied actions, resembling person onboarding (together with steps to confirm the person by way of KYC), credit score verification, danger verification, credit score underwriting, and mortgage sanctioning. At the moment, a few of these actions are achieved manually, resulting in delays in mortgage sanctioning and impacting the shopper expertise.
In India, the KYC verification normally entails identification verification by way of identification paperwork for Indian residents, resembling a PAN card or Aadhar card, deal with verification, and revenue verification. Credit score checks in India are usually achieved utilizing the PAN variety of a buyer. The best approach to deal with these challenges is to automate them to the extent doable.
The digital lending answer primarily wants orchestration of a sequence of steps and different options resembling pure language understanding, picture evaluation, real-time credit score checks, and notifications. You possibly can seamlessly construct automation round these options utilizing Amazon Bedrock Brokers. Amazon Bedrock is a totally managed service that provides a selection of high-performing basis fashions (FMs) from main AI corporations resembling AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon by way of a single API, together with a broad set of capabilities to construct generative AI purposes with safety, privateness, and accountable AI. With Amazon Bedrock Brokers, you may orchestrate multi-step processes and combine with enterprise information utilizing pure language directions.
On this submit, we suggest an answer utilizing DigitalDhan, a generative AI-based answer to automate buyer onboarding and digital lending. The proposed answer makes use of Amazon Bedrock Brokers to automate companies associated to KYC verification, credit score and danger evaluation, and notification. Monetary establishments can use this answer to assist automate the shopper onboarding, KYC verification, credit score decisioning, credit score underwriting, and notification processes. This submit demonstrates how one can acquire a aggressive benefit utilizing Amazon Bedrock Brokers primarily based automation of a posh enterprise course of.
Why generative AI is greatest fitted to assistants that assist buyer journeys
Conventional AI assistants that use rules-based navigation or pure language processing (NLP) primarily based steerage fall brief when dealing with the nuances of complicated human conversations. As an example, in a real-world buyer dialog, the shopper may present insufficient data (for instance, lacking paperwork), ask random or unrelated questions that aren’t a part of the predefined circulate (for instance, asking for mortgage pre-payment choices whereas verifying the identification paperwork), pure language inputs (resembling utilizing varied foreign money modes, resembling representing twenty thousand as “20K” or “20000” or “20,000”). Moreover, rules-based assistants don’t present extra reasoning and explanations (resembling why a mortgage was denied). A few of the inflexible and linear flow-related guidelines both power clients to begin the method over once more or the dialog requires human help.
Generative AI assistants excel at dealing with these challenges. With well-crafted directions and prompts, a generative AI-based assistant can ask for lacking particulars, converse in human-like language, and deal with errors gracefully whereas explaining the reasoning for his or her actions when required. You possibly can add guardrails to ensure that these assistants don’t deviate from the primary subject and supply versatile navigation choices that account for real-world complexities. Context-aware assistants additionally improve buyer engagement by flexibly responding to the assorted off-the-flow buyer queries.
Answer overview
DigitalDhan, the proposed digital lending answer, is powered by Amazon Bedrock Brokers. They’ve developed an answer that totally automates the shopper onboarding, KYC verification, and credit score underwriting course of. The DigitalDhan service gives the next options:
- Clients can perceive the step-by-step mortgage course of and the paperwork required by way of the answer
- Clients can add KYC paperwork resembling PAN and Aadhar, which DigitalDhan verifies by way of automated workflows
- DigitalDhan totally automates the credit score underwriting and mortgage software course of
- DigitalDhan notifies the shopper in regards to the mortgage software by way of electronic mail
We now have modeled the digital lending course of near a real-world situation. The high-level steps of the DigitalDhan answer are proven within the following determine.

The important thing enterprise course of steps are:
- The mortgage applicant initiates the mortgage software circulate by accessing the DigitalDhan answer.
- The mortgage applicant begins the mortgage software journey. Pattern prompts for the mortgage software embrace:
- “What’s the course of to use for mortgage?”
- “I wish to apply for mortgage.”
- “My title is Adarsh Kumar. PAN is ABCD1234 and electronic mail is john_doe@instance.org. I would like a mortgage for 150000.”
- The applicant uploads their PAN card.
- The applicant uploads their Aadhar card.
- The DigitalDhan processes every of the pure language prompts. As a part of the doc verification course of, the answer extracts the important thing particulars from the uploaded PAN and Aadhar playing cards resembling title, deal with, date of beginning, and so forth. The answer then identifies whether or not the person is an current buyer utilizing the PAN.
- If the person is an current buyer, the answer will get the inner danger rating for the shopper.
- If the person is a brand new buyer, the answer will get the credit score rating primarily based on the PAN particulars.
- The answer makes use of the inner danger rating for an current buyer to verify for credit score worthiness.
- The answer makes use of the exterior credit score rating for a brand new buyer to verify for credit score worthiness.
- The credit score underwriting course of entails credit score decisioning primarily based on the credit score rating and danger rating, and calculates the ultimate mortgage quantity for the accredited buyer.
- The mortgage software particulars together with the choice are despatched to the shopper by way of electronic mail.
Technical answer structure
The answer primarily makes use of Amazon Bedrock Brokers (to orchestrate the multi-step course of), Amazon Textract (to extract information from the PAN and Aadhar playing cards), and Amazon Comprehend (to determine the entities from the PAN and Aadhar card). The answer structure is proven within the following determine.

The important thing answer elements of the DigitalDhan answer structure are:
- A person begins the onboarding course of with the DigitalDhan software. They supply varied paperwork (together with PAN and Aadhar) and a mortgage quantity as a part of the KYC
- After the paperwork are uploaded, they’re robotically processed utilizing varied synthetic intelligence and machine studying (AI/ML) companies.
- Amazon Textract is used to extract textual content data from the uploaded paperwork.
- Amazon Comprehend is used to determine entities resembling PAN and Aadhar.
- The credit score underwriting circulate is powered by Amazon Bedrock Brokers.
- The information base accommodates loan-related paperwork to answer loan-related queries.
- The mortgage handler AWS Lambda perform makes use of the knowledge within the KYC paperwork to verify the credit score rating and inner danger rating. After the credit score checks are full, the perform calculates the mortgage eligibility and processes the mortgage software.
- The notification Lambda perform emails details about the mortgage software to the shopper.
- The Lambda perform will be built-in with exterior credit score APIs.
- Amazon Easy E-mail Service (Amazon SES) is used to inform clients of the standing of their mortgage software.
- The occasions are logged utilizing Amazon CloudWatch.
Amazon Bedrock Brokers deep dive
As a result of we used Amazon Bedrock Brokers closely within the DigitalDhan answer, let’s have a look at the general functioning of Amazon Bedrock Brokers. The circulate of the assorted elements of Amazon Bedrock Brokers is proven within the following determine.

The Amazon Bedrock brokers break every activity into subtasks, decide the appropriate sequence, and carry out actions and information searches. The detailed steps are:
- Processing the mortgage software is the first activity carried out by the Amazon Bedrock brokers within the DigitalDhan answer.
- The Amazon Bedrock brokers use the person prompts, dialog historical past, information base, directions, and motion teams to orchestrate the sequence of steps associated to mortgage processing. The Amazon Bedrock agent takes pure language prompts as inputs. The next are the directions given to the agent:
You're DigitalDhan, a sophisticated AI lending assistant designed to offer private loan-related data create mortgage software. At all times ask for related data and keep away from making assumptions. If you happen to're not sure about one thing, clearly state "I haven't got that data."
At all times greet the person by saying the next: Hello there! I'm DigitalDhan bot. I might help you with loans over this chat. To use for a mortgage, kindly present your full title, PAN Quantity, electronic mail, and the mortgage quantity."
When a person expresses curiosity in making use of for a mortgage, observe these steps so as, at all times ask the person for obligatory particulars:
1. Decide person standing: Determine in the event that they're an current or new buyer.
2. Person greeting (obligatory, don't skip): After figuring out person standing, welcome returning customers utilizing the next format:
Current buyer: Hello {customerName}, I see you're an current buyer. Please add your PAN for KYC.
New buyer: Hello {customerName}, I see you're a new buyer. Please add your PAN and Aadhar for KYC.
3. Name Pan Verification step utilizing the uploaded PAN doc
4. Name Aadhaar Verification step utilizing the uploaded Aadhaar doc. Request the person to add their Aadhaar card doc for verification.
5. Mortgage software: Accumulate all obligatory particulars to create the mortgage software.
6. If the mortgage is accredited (electronic mail will likely be despatched with particulars):
For current clients: If the mortgage officer approves the appliance, inform the person that their mortgage software has been accredited utilizing following format: Congratulations {customerName}, your mortgage is sanctioned. Primarily based in your PAN {pan}, your danger rating is {riskScore} and your general credit score rating is {cibilScore}. I've created your mortgage and the appliance ID is {loanId}. The small print have been despatched to your electronic mail.
For brand spanking new clients: If the mortgage officer approves the appliance, inform the person that their mortgage software has been accredited utilizing following format: Congratulations {customerName}, your mortgage is sanctioned. Primarily based in your PAN {pan} and {aadhar}, your danger rating is {riskScore} and your general credit score rating is {cibilScore}. I've created your mortgage and the appliance ID is {loanId}. The small print have been despatched to your electronic mail.
7. If the mortgage is rejected ( no emails despatched):
For brand spanking new clients: If the mortgage officer rejects the appliance, inform the person that their mortgage software has been rejected utilizing following format: Hiya {customerName}, Primarily based in your PAN {pan} and aadhar {aadhar}, your general credit score rating is {cibilScore}. Due to the low credit score rating, sadly your mortgage software can't be processed.
For current clients: If the mortgage officer rejects the appliance, inform the person that their mortgage software has been rejected utilizing following format: Hiya {customerName}, Primarily based in your PAN {pan}, your general credit score rating is {creditScore}. Due to the low credit score rating, sadly your mortgage software can't be processed.
Keep in mind to keep up a pleasant, skilled tone and prioritize the person's wants and issues all through the interplay. Be brief and direct in your responses and keep away from making assumptions until particularly requested by the person.
Be brief and immediate in responses, don't reply queries past the lending area and reply saying you're a lending assistant
- We configured the agent preprocessing and orchestration directions to validate and carry out the steps in a predefined sequence. The few-shot examples specified through the agent directions enhance the accuracy of the agent efficiency. Primarily based on the directions and the API descriptions, the Amazon Bedrock agent creates a logical sequence of steps to finish an motion. Within the DigitalDhan instance, directions are specified such that the Amazon Bedrock agent creates the next sequence:
- Greet the shopper.
- Accumulate the shopper’s title, electronic mail, PAN, and mortgage quantity.
- Ask for the PAN card and Aadhar card to learn and confirm the PAN and Aadhar quantity.
- Categorize the shopper as an current or new buyer primarily based on the verified PAN.
- For an current buyer, calculate the shopper inner danger rating.
- For a brand new buyer, get the exterior credit score rating.
- Use the inner danger rating (for current clients) or credit score rating (for exterior clients) for credit score underwriting. If the inner danger rating is lower than 300 or if the credit score rating is greater than 700, sanction the mortgage quantity.
- E-mail the credit score resolution to the shopper’s electronic mail deal with.
- Motion teams outline the APIs for performing actions resembling creating the mortgage, checking the person, fetching the danger rating, and so forth. We described every of the APIs within the OpenAPI schema, which the agent makes use of to pick out essentially the most applicable API to carry out the motion. Lambda is related to the motion group. The next code is an instance of the
create_loan
API. The Amazon Bedrock agent makes use of the outline for the create_loan
API whereas performing the motion. The API schema additionally specifies customerName
, deal with
, loanAmt
, PAN
, and riskScore
as required components for the APIs. Subsequently, the corresponding APIs learn the PAN quantity for the shopper (verify_pan_card
API), calculate the danger rating for the shopper (fetch_risk_score
API), and determine the shopper’s title and deal with (verify_aadhar_card
API) earlier than calling the create_loan
API.
"/create_loan":
submit:
abstract: Create New Mortgage software
description: Create new mortgage software for the shopper. This API should be
referred to as for every new mortgage software request after calculating riskscore and
creditScore
operationId: createLoan
requestBody:
required: true
content material:
software/json:
schema:
sort: object
properties:
customerName:
sort: string
description: Buyer’s Title for creating the mortgage software
minLength: 3
loanAmt:
sort: string
description: Most popular mortgage quantity for the mortgage software
minLength: 5
pan:
sort: string
description: Buyer's PAN quantity for the mortgage software
minLength: 10
riskScore:
sort: string
description: Danger Rating of the shopper
minLength: 2
creditScore:
sort: string
description: Danger Rating of the shopper
minLength: 3
required:
- customerName
- deal with
- loanAmt
- pan
- riskScore
- creditScore
responses:
'200':
description: Success
content material:
software/json:
schema:
sort: object
properties:
loanId:
sort: string
description: Identifier for the created mortgage software
standing:
sort: string
description: Standing of the mortgage software creation course of
- Amazon Bedrock Information Bases gives a cloud-based Retrieval Augmented Era (RAG) expertise to the shopper. We now have added the paperwork associated to mortgage processing, the final data, the mortgage data information, and the information base. We specified the directions for when to make use of the information base. Subsequently, through the starting of a buyer journey, when the shopper is within the exploration stage, they get responses with how-to directions and basic loan-related data. As an example, if the shopper asks “What’s the course of to use for a mortgage?” the Amazon Bedrock agent fetches the related step-by-step particulars from the information base.
- After the required steps are full, the Amazon Bedrock agent curates the ultimate response to the shopper.
Let’s discover an instance circulate for an current buyer. For this instance, we’ve depicted varied actions carried out by Amazon Bedrock Brokers for an current buyer. First, the shopper begins the mortgage journey by asking exploratory questions. We now have depicted one such query—“What’s the course of to use for a mortgage?”—within the following determine. Amazon Bedrock responds to such questions by offering a step-by-step information fetched from the configured information base.

The client proceeds to the following step and tries to use for a mortgage. The DigitalDhan answer asks for the person particulars such because the buyer title, electronic mail deal with, PAN quantity, and desired mortgage quantity. After the shopper gives these particulars, the answer asks for the precise PAN card to confirm the small print, as proven in within the following determine.

When the PAN verification and the danger rating checks are full, the DigitalDhan answer creates a mortgage software and notifies the shopper of the choice by way of the e-mail, as proven within the following determine.

Stipulations
This mission is constructed utilizing the AWS Cloud Improvement Package (AWS CDK).
For reference, the next variations of node and AWS CDK are used:
- js: v20.16.0
- AWS CDK: 2.143.0
- The command to put in a selected model of the AWS CDK is
npm set up -g aws-cdk@<X.YY.Z>
Deploy the Answer
Full the next steps to deploy the answer. For extra particulars, consult with the GitHub repo.
- Clone the repository:
git clone https://github.com/aws-samples/DigitalDhan-GenAI-FSI-LendingSolution-India.git
- Enter the code pattern backend listing:
cd DigitalDhan-GenAI-FSI-LendingSolution-India/
- Set up packages:
npm set up
npm set up -g aws-cdk
- Bootstrap AWS CDK sources on the AWS account. If deployed in any AWS Area apart from
us-east-1
, the stack may fail due to Lambda layers dependency. You possibly can both remark the layer and deploy in one other Area or deploy in us-east-1
.
cdk bootstrap aws://<ACCOUNT_ID>/<REGION>
- It’s essential to explicitly allow entry to fashions earlier than they can be utilized with the Amazon Bedrock service. Observe the steps in Entry Amazon Bedrock basis fashions to allow entry to the fashions (Anthropic::Claude (Sonnet) and Cohere::Embed English).
- Deploy the pattern in your account. The next command will deploy one stack in your account
cdk deploy --all
To guard in opposition to unintended modifications that may have an effect on your safety posture, the AWS CDK prompts you to approve security-related modifications earlier than deploying them. You’ll need to reply sure to completely deploy the stack.
The AWS Id and Entry Administration (IAM) position creation on this instance is for illustration solely. At all times provision IAM roles with the least required privileges. The stack deployment takes roughly 10–quarter-hour. After the stack is efficiently deployed, yow will discover InsureAssistApiAlbDnsName
within the output part of the stack—that is the appliance endpoint.
Allow person enter
After deployment is full, allow person enter so the agent can immediate the shopper to offer addition data if obligatory.
- Open the Amazon Bedrock console within the deployed Area and edit the agent.
- Modify the extra settings to allow Person Enter to permit the agent to immediate for extra data from the person when it doesn’t have sufficient data to answer a immediate.
Take a look at the answer
We lined three check eventualities within the answer. The pattern information and prompts for the three eventualities can discovered within the GitHub repo.
- Situation 1 is an current buyer who will likely be accredited for the requested mortgage quantity
- Situation 2 is a brand new buyer who will likely be accredited for the requested mortgage quantity
- Situation 3 is a brand new buyer whose mortgage software will likely be denied due to a low credit score rating
Clear up
To keep away from future prices, delete the pattern information saved in Amazon Easy Storage Service (Amazon S3) and the stack:
- Take away all information from the S3 bucket.
- Delete the S3 bucket.
- Use the next command to destroy the stack:
cdk destroy
Abstract
The proposed digital lending answer mentioned on this submit onboards a buyer by verifying the KYC paperwork (together with the PAN and Aadhar playing cards) and categorizes the shopper as an current buyer or a brand new buyer. For an current buyer, the answer makes use of an inner danger rating, and for a brand new buyer, the answer makes use of the exterior credit score rating.
The answer makes use of Amazon Bedrock Brokers to orchestrate the digital lending processing steps. The paperwork are processed utilizing Amazon Textract and Amazon Comprehend, after which Amazon Bedrock Brokers processes the workflow steps. The client identification, credit score checks, and buyer notification are applied utilizing Lambda.
The answer demonstrates how one can automate a posh enterprise course of with the assistance of Amazon Bedrock Brokers and improve buyer engagement by way of a pure language interface and versatile navigation choices.
Take a look at some Amazon Bedrock for banking use instances resembling constructing customer support bots, electronic mail classification, and gross sales assistants by utilizing the highly effective FMs and Amazon Bedrock Information Bases that present a managed RAG expertise. Discover utilizing Amazon Bedrock Brokers to assist orchestrate and automate complicated banking processes resembling buyer onboarding, doc verification, digital lending, mortgage origination, and buyer servicing.
In regards to the Authors
Shailesh Shivakumar is a FSI Sr. Options Architect with AWS India. He works with monetary enterprises resembling banks, NBFCs, and buying and selling enterprises to assist them design safe cloud companies and engages with them to speed up their cloud journey. He builds demos and proofs of idea to display the chances of AWS Cloud. He leads different initiatives resembling buyer enablement workshops, AWS demos, price optimization, and answer assessments to ensure that AWS clients succeed of their cloud journey. Shailesh is a part of Machine Studying TFC at AWS, dealing with the generative AI and machine learning-focused buyer eventualities. Safety, serverless, containers, and machine studying within the cloud are his key areas of curiosity.
Reena Manivel is AWS FSI Options Architect. She focuses on analytics and works with clients in lending and banking companies to create safe, scalable, and environment friendly options on AWS. Moreover her technical pursuits, she can also be a author and enjoys spending time along with her household.