Skip to content
Β 
Β 

Repository files navigation

πŸ’Ό LoanAgent – AI-Powered Banking Portal

Empowering faster, fairer, and smarter loan decisions using IBM Watson AI


πŸ“Œ Introduction

The Indian banking and financial sector, while rapidly digitizing, still faces critical challenges in streamlining the loan application processβ€”particularly in small and mid-sized banks and NBFCs. From slow approvals to lack of scheme awareness, customers and staff alike face a complex, inefficient system.

LoanAgent is an AI-powered digital portal that leverages IBM Watson, cloud computing, and automation to transform the entire loan journeyβ€”making it faster, more accurate, and more inclusive for all.


🚨 Problem Statement

Despite digitization, loan workflows remain problematic:

  • πŸ•’ Loan approvals can take days to weeks, especially for rural or new customers.
  • 🧾 Staff conduct manual document checks, increasing workload and error rates.
  • ❌ Customers often miss out on government schemes due to lack of awareness.
  • ❓ Poor communication leaves applicants in the dark about their application status.

🎯 Objective

LoanAgent aims to:

  • πŸ’‘ Deliver end-to-end digital loan application, assessment, and approval.
  • πŸ€– Use IBM Watson AI to automate eligibility checks and ensure compliance with RBI guidelines.
  • 🎯 Provide personalized scheme recommendations based on user profile.
  • πŸ“’ Ensure real-time transparency through notifications and status updates.

πŸ’‘ Why This Problem?

Manual and opaque processes:

  • Limit outreach to underserved communities
  • Overburden banking staff
  • Result in low scheme adoption in rural India
  • Pose compliance risks under increasing regulation

Solution? An AI-powered, transparent, and scalable system.


πŸš€ Solution Overview

LoanAgent offers a secure, cloud-based portal that revolutionizes the loan experience:

πŸ”Ή For Customers:

  • Conversational AI assistant for queries and guidance
  • Instant eligibility check with real-time results
  • Scheme recommendations based on their profile
  • Live status tracking with automated email alerts

πŸ”Ή For Staff/Admins:

  • Secure dashboard for reviewing applications
  • AI insights for risk scoring and scheme eligibility
  • Document uploads & approvals in one place
  • Automated communication with applicants

🌟 Key Features

Feature Description
πŸ—£οΈ LoanAgent Conversational AI assistant for guidance, FAQs, and status
βœ… AI Eligibility Check Powered by IBM Watson for fast and accurate loan assessment
🧠 Smart Scheme Recommender Shows only eligible government/private loan schemes
πŸ“‹ Staff Dashboard Unified panel for document review, approvals, and insights
πŸ“§ Automated Notifications HTML email alerts for approvals, missing docs, etc.

πŸ› οΈ Technical Implementation

Component Details
πŸ” Security Session-based auth, bcrypt hashing, file validation
🧠 AI Integration IBM Watson AI for eligibility, scheme matching, and document review
πŸ’Œ Communication SMTP integration for HTML email notifications
πŸ”— Backend Flask + Python with IBM IAM authentication and REST APIs
🌐 Frontend Responsive HTML/CSS/JS UI for customers & staff
☁️ Deployment Vercel (frontend + backend), IBM Cloud (AI Agent)
πŸ§ͺ Testing & DevOps Postman for API testing, Git/GitHub for version control

🧠 IBM Resources Used

  • 🎯 IBM Watson AI – Trained on Indian financial data for explainable, compliant decisions
  • ☁️ IBM Cloud – Secure, scalable infrastructure for AI and application hosting
  • πŸ” IBM IAM – Authentication and authorization for safe API access

πŸ“ˆ Impact

Metric Result
⚑ Loan Processing Time Reduced from weeks to minutes
πŸ“Š Scheme Adoption Increased by 30% via personalized suggestions
🌍 Financial Inclusion Improved awareness in rural and underserved regions
βœ… Compliance & Transparency Enhanced traceability for staff and applicants

Local Development

οΏ½πŸ› οΈ Setup Instructions

1. Prerequisites

  • Python 3.8 or newer
  • Git
  • Email account with SMTP access (Gmail, Outlook, Yahoo, etc.)

2. Clone the Repository

git clone <your-repository-url>
cd IBM_Bank_Agent

3. Backend Setup

a. Navigate to backend directory:

cd backend

b. Create and activate virtual environment:

On macOS/Linux:

python3 -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate

c. Install dependencies:

pip install -r requirements.txt

4. SMTP Email Configuration

a. Copy the environment template:

cp ../.env.template .env

b. Edit the .env file with your email settings:

For Gmail:

SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
BANK_EMAIL=your-bank-email@gmail.com
BANK_NAME=AI Banking Portal

Gmail Setup Steps:

  1. Enable 2-Factor Authentication on your Gmail account
  2. Generate an App Password: Gmail App Passwords
  3. Use the App Password (not your regular password) in SMTP_PASSWORD

For Outlook/Hotmail:

SMTP_SERVER=smtp-mail.outlook.com
SMTP_PORT=587
SMTP_USERNAME=your-email@outlook.com
SMTP_PASSWORD=your-password

For Yahoo:

SMTP_SERVER=smtp.mail.yahoo.com
SMTP_PORT=587
SMTP_USERNAME=your-email@yahoo.com
SMTP_PASSWORD=your-app-password

5. Start the Application

python agent.py

The application will be available at: http://127.0.0.1:5001/

🎯 How to Use

For Loan Applicants:

  1. Register/Login: Create an account or login with existing credentials
  2. Complete Application: Fill out the comprehensive loan application form
  3. Watson AI Assessment: Get instant AI-powered eligibility assessment
  4. Upload Documents: Submit required documents based on AI recommendations
  5. Track Progress: Monitor application status in your dashboard
  6. Email Notifications: Receive HTML email updates on application progress

For Administrators:

  1. Admin Login: Access the staff portal with admin credentials
  2. Review Applications: View all pending loan applications with documents
  3. Watson AI Insights: See AI assessment results and recommendations
  4. Make Decisions: Approve, reject, or request revisions
  5. Send Notifications: Automatic HTML email notifications to applicants

πŸ“§ Email System Features

  • HTML Email Templates: Professional, responsive email design
  • Application Status Updates: Automatic notifications for all status changes
  • Document Requests: Specific instructions for missing documents
  • Admin Notifications: Alerts for new applications and uploads
  • Secure SMTP: SSL/TLS encryption for email transmission
  • Fallback Logging: Emails logged when SMTP is not configured

πŸ”§ Configuration Options

Environment Variables (.env file):

# SMTP Email Settings
SMTP_SERVER=your-smtp-server
SMTP_PORT=587
SMTP_USERNAME=your-email@domain.com
SMTP_PASSWORD=your-app-password
BANK_EMAIL=bank@domain.com
BANK_NAME=Your Bank Name

# Watson AI Settings (optional)
WATSON_API_KEY=your-watson-key
WATSON_URL=your-watson-url

Default Credentials:

πŸ” Troubleshooting

SMTP Issues:

  1. Gmail "Less secure apps": Use App Passwords instead of regular password
  2. Outlook authentication: Ensure 2FA is enabled and use app-specific password
  3. Port issues: Try port 465 with SSL if 587 with STARTTLS doesn't work
  4. Firewall: Ensure outgoing SMTP ports are not blocked

Application Issues:

  1. Port already in use: Change the port in agent.py or kill existing process
  2. Dependencies: Ensure all packages in requirements.txt are installed
  3. CSV files: Application creates necessary CSV files automatically
  4. File uploads: Ensure proper permissions for file upload directory

🎨 Customization

  • Bank Name: Update BANK_NAME in .env file
  • Email Templates: Modify create_html_email_template() function in agent.py
  • UI Theme: Edit CSS styles in frontend files
  • Watson AI Rules: Customize assessment logic in assess_loan_eligibility() function

πŸ“‹ Database Schema

The application uses CSV files for data storage:

  • users.csv: User authentication and profile data
  • comprehensive_loans.csv: Loan application details
  • document_uploads.csv: File upload tracking
  • user_alerts.csv: User notification system
  • admin_alerts.csv: Administrator notifications
  • notifications.csv: Email notification log

πŸ”’ Security Features

  • Password hashing with bcrypt
  • Session-based authentication
  • File upload validation
  • SQL injection prevention
  • CSRF protection
  • Secure email transmission with SSL/TLS

πŸ“ˆ Watson AI Assessment

The system includes intelligent loan assessment based on:

  • Income-to-loan ratio analysis
  • Credit score evaluation
  • Employment stability check
  • Debt-to-income ratio
  • Loan-to-value ratio for secured loans
  • Age and experience factors

Note: This application is designed for educational and demonstration purposes. For production use, implement additional security measures, use a proper database, and follow banking compliance requirements.

On Windows:

python -m venv venv .\venv\Scripts\activate

On macOS / Linux:

python3 -m venv venv source venv/bin/activate

Your terminal prompt should now show (venv) at the beginning.

c. Install Python dependencies:

pip install -r requirements.txt

d. Create the environment variables file: Create a new file named .env inside the backend folder. This file will store your secret credentials. Add the following content to it:

API_KEY="your-real-ibm-cloud-api-key" AGENT_ENDPOINT="your-watsonx-agent-deployment-url"

Important: Replace the placeholder text with your actual IBM Cloud API Key and your Watsonx Agent's deployment URL.

  1. Running the Application To run the application, you need to start both the backend server and the frontend interface.

a. Start the Backend Server: Make sure you are in the backend directory and your virtual environment is activated. Then, run the following command:

python agent.py

The server will start, and you should see output indicating it's running on http://127.0.0.1:5000. Keep this terminal window open.

b. Launch the Frontend: Open a new terminal or use your computer's file explorer to navigate to the frontend directory. Double-click the index.html file. This will open the chat application in your default web browser.

You can now start chatting with your virtual banking assistant!

thank you

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages