SmartSupport is an AI-powered customer support agent that automatically categorizes incoming queries, detects sentiment, and routes each conversation to the right handler all in real time. No rigid decision trees, no hardcoded FAQs. Just a smart agent that knows when to troubleshoot, when to handle billing, and when to escalate.
Note: This is a general-purpose customer support agent. It is not affiliated with any company or product, use it to explore AI-powered support routing
SmartSupport is a multi-node customer support agent built with:
- LangGraph for stateful, graph-based query routing
- Groq (Llama 3.3 70B) for fast, high-quality LLM inference
- Streamlit for a clean, zero-config chat interface
Paste your Groq API key, type a customer query, and the agent handles everything, classifying the issue, reading the sentiment, picking the right handler, and responding with context-aware, empathetic answers.
| Feature | Details |
|---|---|
| π Bring-your-own key | Enter your Groq API key in the sidebar, no .env or server config needed |
| π Auto categorization | Every query is classified as Technical, Billing, or General before routing |
| π¬ Sentiment detection | Positive, Neutral, or Negative, detected automatically on each message |
| π Smart routing | LangGraph conditional edges route to the right handler based on category + sentiment |
| π¨ Escalation logic | Only Negative + Technical queries escalate, other frustrated users still get real help |
| π€ Empathy-aware replies | Negative-sentiment queries get an empathetic opening before the actual answer |
| π Live metadata badges | Every response shows the detected category and sentiment inline |
| Layer | Technology | Purpose |
|---|---|---|
| UI | Streamlit 1.45 | Chat interface, sidebar, session state |
| LLM | Groq Β· Llama 3.3 70B | Fast inference, categorization, response generation |
| Orchestration | LangGraph 1.2 | Stateful agent graph with conditional routing |
βββ .gitignore
βββ README.md
βββ SmartSupport_CustomerSupportAgent.ipynb
βββ app.py
βββ requirements.txt
git clone https://github.com/muqadasejaz/SmartSupport-Customer-Support-Agent
cd SmartSupport-agentpython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtstreamlit run app.pyThe app opens at http://localhost:8501.
Sign up at console.groq.com, go to API Keys, and click Create API Key. It is free.
1. Enter your Groq API key in the sidebar
2. Type a customer query in the chat box
3. The agent categorizes the query and detects sentiment
4. You get a routed, context-aware response instantly
5. Category and sentiment badges appear under each response
6. Click "Clear chat" to start a fresh session
Try these sample queries:
- "My app keeps crashing when I open the dashboard" β Technical
- "I was charged twice this month" β Billing
- "Do you offer live chat support?" β General
- "I've been trying to fix this for three days and nothing works" β Escalated
The diagram below shows how a user message flows through the agent graph:
User sends a message
β
βΌ
Streamlit (app.py)
Passes query into LangGraph workflow
β
βΌ
Node 1 Β· categorize
β Classifies query as: Technical | Billing | General
β
βΌ
Node 2 Β· analyze_sentiment
β Detects sentiment as: Positive | Neutral | Negative
β
βΌ
Conditional Router Β· route_query
β Negative + Technical β escalate
β Technical β handle_technical
β Billing β handle_billing
β General / fallback β handle_general
β
βΌ
Handler Node
β Generates a context-aware, role-appropriate response
β Adds empathetic opening if sentiment is Negative
β
βΌ
Streamlit renders response
β Shows category + sentiment badges
β Appends to chat history
Treating them as two independent nodes gives the router a two-axis decision surface. A frustrated billing complaint and a frustrated technical crash look similar in raw text, but they need completely different handlers. Splitting the signals keeps the routing logic clean and extensible.
Escalating every negative-sentiment query is a common mistake β it leaves frustrated billing or general users with a dead-end message instead of actual help. Only Technical issues with negative sentiment genuinely benefit from a human review. Everything else gets a real LLM response with an empathetic tone.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π§ Customer Support Agent sidebar β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βοΈ Configuration β
β Groq API Key β
β [gsk_β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β main area β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β You: My app keeps crashing on file upload β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π§ Technical π Neutral β β
β β β β
β β π€ This sounds like a client-side upload error. β β
β β Here's what to try: β β
β β 1. Clear your browser cache and retry β β
β β 2. Check the file size β the limit is 10MB β β
β β 3. Try a different browser β β
β β What file format are you uploading? β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β [ Describe your issueβ¦ Send βΆ ] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
git init
git add .
git commit -m "Initial commit β SmartSupport Agent"
git remote add origin https://github.com/muqadasejaz/SmartSupport-Customer-Support-Agent
git push -u origin main- Go to share.streamlit.io
- Click New app
- Select your repository and set Main file path to
app.py - Click Deploy
π‘ No secrets needed users supply their own Groq API key through the sidebar UI.
streamlit>=1.45.0
langchain-core>=0.3.0
langchain-groq>=1.1.2
langgraph>=1.2.0
python-dotenv>=1.0.0
Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "Add my feature" - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
Muqadas Ejaz
BS Computer Science (AI Specialization)
AI/ML Engineer
Kaggle Grand Master
Data Science & Gen AI
π« Connect with me on LinkedIn
π GitHub: github.com/muqadasejaz
π¬ Kaggle: Kaggle Profile
This project is licensed under the MIT License
β If you find this project useful, donβt forget to star the repository!