π Intelligent Banking Support Powered by LangGraph Β· LLaMA 3.1 Β· Groq
π Try the App Here
π Frontend UI (Streamlit): https://banking-agent-phmivszmcasyzw5fdv3ea3.streamlit.app/
π GitHub Repository: https://github.com/hari9618/Banking-Agent
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.
| 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 |
| 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 |
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
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
git clone https://github.com/your-username/securebank-ai-agent.git
cd securebank-ai-agentpip install -r requirements.txtOr manually:
pip install streamlit langgraph langchain langchain-core langchain-groq python-dotenvCreate 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
streamlit run app.py
β οΈ Always run from the folder containing your.envfile.
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
<img width="957" height="398" alt="LG" src="https://github.com/user-attachments/assets/4dc52af6-8609-45af-bfd9-e42f8d58709f" />
β 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
πΉ 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
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
Hari Krishna
AI Enthusiast | Gen AI Engineer | AI Builder
If you found this project useful:
β Star the repository
π’ Share with your network
π Report issues or suggest features via GitHub Issues
AI LangGraph LangChain Groq LLaMA Banking Assistant Streamlit Python Generative AI AI Agents Chatbot NLP Machine Learning Autonomous Agent FastAPI
