Skip to content

hari9618/Banking-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏦 SecureBank AI Agent πŸ€–πŸ’³

πŸš€ Intelligent Banking Support Powered by LangGraph Β· LLaMA 3.1 Β· Groq


🧩 Tech Badges


πŸš€ Live Demo

πŸ‘‰ Try the App Here

πŸ”— Frontend UI (Streamlit): https://banking-agent-phmivszmcasyzw5fdv3ea3.streamlit.app/

πŸ”— GitHub Repository: https://github.com/hari9618/Banking-Agent


πŸ“Œ Project Overview

SecureBank AI Agent is an intelligent, LangGraph-powered autonomous banking assistant designed to automate customer support entirely.

Traditional banking chatbots follow rigid rule trees that break the moment a user asks something unexpected. SecureBank AI Agent solves this with a hybrid architecture β€” combining fast rule-based routing for known queries (balance, transactions, FAQs) with full LLM reasoning via Groq's LLaMA 3.1 for complex, open-ended questions.

The result is a banking assistant that is fast, accurate, and capable of handling real-world conversations β€” all within a sleek, interactive Streamlit chat interface.


✨ Key Features

Feature Description
🧠 Intent Classification Automatically detects balance, transaction, FAQ, or general queries
πŸ”€ Intelligent Routing LangGraph routes each query to the right handler node
πŸ€– LLM Reasoning Groq + LLaMA 3.1 handles complex, open-ended questions
πŸ“‹ Rule-Based FAQ Engine Instant keyword-matched answers for common banking questions
πŸ’° Account Balance Retrieval Displays live-formatted balance cards per customer
πŸ“Š Transaction History Generates and displays recent transaction records
πŸ›‘οΈ Error Handling Handles rate limits, API errors, and model issues gracefully
πŸ”‘ Secure Key Management API key loaded via .env β€” never hardcoded
🎨 Interactive Chat UI Streamlit chat interface with quick-action sidebar buttons
⚑ Rate Limit Protection Built-in throttling and automatic retry logic

πŸ› οΈ Tech Stack

Technology Purpose
🐍 Python 3.10+ Core programming language
🎨 Streamlit Interactive frontend chat UI
πŸ”— LangGraph Stateful AI workflow & node routing engine
🦜 LangChain LLM integration and message formatting
⚑ Groq API Ultra-fast LLM inference
🧠 LLaMA 3.1 (8B Instant) Language model for intelligent responses
πŸ” python-dotenv Secure environment variable management

πŸ—οΈ Project Architecture

SecureBank-AI-Agent/
β”‚
β”œβ”€β”€ app.py                  # Streamlit Frontend + LangGraph workflow
β”œβ”€β”€ .env                    # API keys (not committed)
β”œβ”€β”€ requirements.txt        # Python dependencies
└── README.md
β”‚
β”‚   ── Internal Architecture ──
β”‚
β”œβ”€β”€ 🎨 UI Layer             # Streamlit chat interface + sidebar quick actions
β”œβ”€β”€ πŸ”€ LangGraph Workflow   # StateGraph with classify β†’ route β†’ handle nodes
β”œβ”€β”€ πŸ€– LLM Layer            # ChatGroq (LLaMA 3.1) via LangChain
└── πŸ—„οΈ  Mock Database Layer  # Customer profiles + transaction generation

Workflow Diagram

User Input
    β”‚
    β–Ό
[classify node] ──► intent detected
    β”‚
    β–Ό
[route function]
    β”‚
    β”œβ”€β”€β–Ί "balance"  ──► [handle_balance]  ──► Balance Card UI
    β”œβ”€β”€β–Ί "txn"      ──► [handle_txn]      ──► Transaction Table UI
    β”œβ”€β”€β–Ί "faq"      ──► [handle_faq]      ──► FAQ Answer UI
    └──► "other"    ──► [handle_other]    ──► LLM (Groq + LLaMA 3.1)
                                                    β”‚
                                                    β–Ό
                                              AI Response UI

βš™οΈ Installation Guide

1️⃣ Clone Repository

git clone https://github.com/your-username/securebank-ai-agent.git
cd securebank-ai-agent

2️⃣ Install Dependencies

pip install -r requirements.txt

Or manually:

pip install streamlit langgraph langchain langchain-core langchain-groq python-dotenv

3️⃣ Setup Environment Variables

Create a .env file in the project root:

GROQ_API_KEY=your_groq_api_key_here

πŸ”‘ Get your free Groq API key at console.groq.com

4️⃣ Run the App

streamlit run app.py

⚠️ Always run from the folder containing your .env file.


🧠 How It Works

1️⃣  User types a message or clicks a Quick Action in the sidebar
        β”‚
2️⃣  LangGraph StateGraph receives the input
        β”‚
3️⃣  classify node detects intent:
        β”œβ”€β”€ "balance"  β†’ contains keywords like balance, funds, how much
        β”œβ”€β”€ "txn"      β†’ contains keywords like transaction, history, recent
        β”œβ”€β”€ "faq"      β†’ matches FAQ keyword map (rates, loans, KYC, etc.)
        └── "other"    β†’ everything else
        β”‚
4️⃣  route function directs to the correct handler node
        β”‚
5️⃣  Handler executes:
        β”œβ”€β”€ Rule-based β†’ instant response (balance / txn / faq)
        └── LLM-based  β†’ Groq API call β†’ LLaMA 3.1 generates response
        β”‚
6️⃣  Formatted response rendered in Streamlit chat UI

πŸ“· Application Preview

<img width="957" height="398" alt="LG" src="https://github.com/user-attachments/assets/4dc52af6-8609-45af-bfd9-e42f8d58709f" />


πŸ“š What I Learned

βœ” Building stateful AI agents with LangGraph StateGraph
βœ” Designing hybrid rule-based + LLM systems for reliability
βœ” Integrating Groq API with LangChain for fast LLM inference
βœ” Implementing intent classification and conditional routing
βœ” Building production-grade error handling (rate limits, model deprecation)
βœ” Deploying interactive AI apps with Streamlit
βœ” Managing LLM client caching with @st.cache_resource


🎯 Future Improvements

πŸ”Ή Real banking API integration (Plaid / RazorpayX)
πŸ”Ή User authentication & multi-account support
πŸ”Ή Voice input support
πŸ”Ή RAG-based document Q&A (loan agreements, terms)
πŸ”Ή SHAP-based explainability for model decisions
πŸ”Ή Multilingual support (Hindi, Telugu, etc.)
πŸ”Ή Persistent chat history with vector database
πŸ”Ή Fraud detection alert system


πŸ™ Acknowledgements

Special thanks to everyone who supported this project:

🏫 Innomatics Research Labs β€” For providing a strong AI learning environment
πŸ‘¨β€πŸ« Manohar Chary V. Sir β€” For guidance and continuous mentorship

And a heartfelt thank you to:
Raghu Ram Aduri Sir Β· Kanav Bansal Sir Β· Vishwanath Nyathani Sir Β· Kalpana Katiki Reddy Ma'am


πŸ‘¨β€πŸ’» Author

Hari Krishna
AI Enthusiast | Gen AI Engineer | AI Builder


⭐ Support

If you found this project useful:

⭐ Star the repository
πŸ“’ Share with your network
πŸ› Report issues or suggest features via GitHub Issues


πŸ“’ Tags

AI LangGraph LangChain Groq LLaMA Banking Assistant Streamlit Python Generative AI AI Agents Chatbot NLP Machine Learning Autonomous Agent FastAPI

About

πŸš€ Agentic AI Banking Assistant built with LangGraph and Groq, enabling automated customer support, smart query routing, and real-time responses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages