An LLM-powered support ticket triage system that automatically classifies customer support tickets, assigns priorities, detects sentiment, and drafts response messages.
The application combines FastAPI, Streamlit, Gemini 2.5 Flash, SQLite, and Docker to demonstrate an end-to-end AI workflow for automating customer support.
Dashboard: https://ticket-triage-app.onrender.com
API Docs: https://ai-ticket-triage-system.onrender.com/docs
Note
Hosted on Render's free tier. Services sleep after ~15 minutes of inactivity, so the first request may take 30–50 seconds.
- 🎯 Automatic ticket classification
- 🚨 Priority prediction (Urgent → Low)
- 😊 Sentiment analysis
- ✍️ AI-generated reply drafts
- ✅ Structured output using Pydantic
- ⚡ Parallel processing with
ThreadPoolExecutor - 💾 SQLite persistence
- 📊 Interactive dashboard with charts
- 📤 CSV export
- 📈 Built-in evaluation script
- 🐳 Docker Compose deployment
| Layer | Technology |
|---|---|
| Language | Python 3.12 |
| Backend | FastAPI |
| Frontend | Streamlit |
| LLM | Gemini 2.5 Flash |
| Validation | Pydantic |
| Database | SQLite |
| Package Manager | uv |
| Concurrency | ThreadPoolExecutor |
| Containerization | Docker & Docker Compose |
Customer Tickets
│
▼
Streamlit Dashboard
│
POST /analyze
▼
FastAPI Backend
│
Gemini 2.5 Flash
│
Structured JSON
(Pydantic)
│
▼
SQLite Database
│
▼
Priority Queue
Charts • Filters • CSV
.
├── api.py
├── app.py
├── database.py
├── eval.py
├── sample_tickets.txt
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
├── uv.lock
├── sample.env
├── screenshots/
└── README.md
git clone https://github.com/21f3001527/ai-support-ticket-triage.git
cd ai-support-ticket-triagecp sample.env .envAdd your Gemini API key.
GOOGLE_API_KEY=your_api_keyGet a free key:
docker compose up --buildOpen:
- Dashboard → http://localhost:8501
- API Docs → http://localhost:8000/docs
Useful commands:
docker compose up -d
docker compose logs -f
docker compose down
docker compose down -vInstall dependencies
uv syncBackend
uv run fastapi dev api.pyFrontend
uv run streamlit run app.pyRun:
uv run python eval.pyExample results:
Category Accuracy : 100%
Priority Accuracy : 75%
Sentiment Accuracy: 100%
The evaluation script tests the same /analyze endpoint used by the application.
- SQLite is intended for single-user demos.
- No authentication or authorization.
- Streamlit is a prototype UI.
- Gemini free tier has daily request limits.
- Ambiguous tickets may occasionally be misclassified.
- Render's free tier does not provide persistent storage, so saved tickets reset after redeployment.
- Team assignment recommendations
- SLA monitoring
- PostgreSQL
- Authentication & user roles
- Email integration
- RAG-powered replies
- Async background processing
Rajeev Kumar
- GitHub: https://github.com/21f3001527
- LinkedIn: https://www.linkedin.com/in/rajeev245/
- Email: rajeeev90767@gmail.com



