Incident Compression Engine
AI-assisted grouping and resolution suggestion for enterprise support tickets using Google Gemini.
Features
- 200 synthetic support tickets across 6 categories
- AI-powered clustering and root cause analysis via Gemini
- REST API with FastAPI
- Minimal web UI for viewing tickets and clusters
Quick Start
1. Install Dependencies
pip install -r requirements.txt
2. Configure Gemini API Key
cp .env.example .env
# Edit .env and add your Gemini API key:
# GEMINI_API_KEY=your_key_here
Get a key at: https://makersuite.google.com/app/apikey
Note: The app works without a key, but uses fallback analysis instead of AI.
3. Run the Server
uvicorn main:app --reload
Open http://localhost:8000 in your browser.
Usage
- View the ticket list on the main page
- Click "Run Analysis" to cluster tickets
- Switch to Clusters tab to see:
- Grouped incidents by category
- AI-generated root cause analysis
- Suggested resolution steps
- Confidence scores
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tickets | List tickets (supports skip, limit, category, severity) |
| POST | /api/cluster | Run clustering + AI analysis |
| GET | /api/clusters | Get clustered results with root cause & resolution |
| GET | /api/status | System health check |
Ticket Categories
- Authentication Failure
- Database Connection Error
- Configuration Mismatch
- Permission Issue
- Service Timeout
- Integration Failure
Project Structure
ICE/
├── main.py # FastAPI app
├── models.py # SQLAlchemy models
├── database.py # Database setup
├── gemini_service.py # Gemini API integration
├── clustering.py # Clustering logic
├── seed_data.py # Synthetic data generator
├── requirements.txt # Dependencies
├── .env.example # Environment template
└── static/
└── index.html # Web UI
Tech Stack
- Backend: Python, FastAPI, SQLAlchemy, SQLite
- AI: Google Gemini API
- Clustering: scikit-learn (K-Means)
- Frontend: Vanilla HTML/CSS/JS