Empowering faster, fairer, and smarter loan decisions using IBM Watson AI
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.
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.
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.
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.
LoanAgent offers a secure, cloud-based portal that revolutionizes the loan experience:
- 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
- Secure dashboard for reviewing applications
- AI insights for risk scoring and scheme eligibility
- Document uploads & approvals in one place
- Automated communication with applicants
| 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. |
| 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 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
| 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 |
- Python 3.8 or newer
- Git
- Email account with SMTP access (Gmail, Outlook, Yahoo, etc.)
git clone <your-repository-url>
cd IBM_Bank_Agentcd backendOn macOS/Linux:
python3 -m venv venv
source venv/bin/activateOn Windows:
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtcp ../.env.template .envFor 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 PortalGmail Setup Steps:
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password: Gmail App Passwords
- 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-passwordFor Yahoo:
SMTP_SERVER=smtp.mail.yahoo.com
SMTP_PORT=587
SMTP_USERNAME=your-email@yahoo.com
SMTP_PASSWORD=your-app-passwordpython agent.pyThe application will be available at: http://127.0.0.1:5001/
- Register/Login: Create an account or login with existing credentials
- Complete Application: Fill out the comprehensive loan application form
- Watson AI Assessment: Get instant AI-powered eligibility assessment
- Upload Documents: Submit required documents based on AI recommendations
- Track Progress: Monitor application status in your dashboard
- Email Notifications: Receive HTML email updates on application progress
- Admin Login: Access the staff portal with admin credentials
- Review Applications: View all pending loan applications with documents
- Watson AI Insights: See AI assessment results and recommendations
- Make Decisions: Approve, reject, or request revisions
- Send Notifications: Automatic HTML email notifications to applicants
- 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
# 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- Admin Login: admin@bank.com / admin123
- Test User: user@test.com / password123
- Gmail "Less secure apps": Use App Passwords instead of regular password
- Outlook authentication: Ensure 2FA is enabled and use app-specific password
- Port issues: Try port 465 with SSL if 587 with STARTTLS doesn't work
- Firewall: Ensure outgoing SMTP ports are not blocked
- Port already in use: Change the port in agent.py or kill existing process
- Dependencies: Ensure all packages in requirements.txt are installed
- CSV files: Application creates necessary CSV files automatically
- File uploads: Ensure proper permissions for file upload directory
- Bank Name: Update
BANK_NAMEin .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
The application uses CSV files for data storage:
users.csv: User authentication and profile datacomprehensive_loans.csv: Loan application detailsdocument_uploads.csv: File upload trackinguser_alerts.csv: User notification systemadmin_alerts.csv: Administrator notificationsnotifications.csv: Email notification log
- Password hashing with bcrypt
- Session-based authentication
- File upload validation
- SQL injection prevention
- CSRF protection
- Secure email transmission with SSL/TLS
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.
- 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!