An intelligent, enterprise-grade complaint management system powered by AI
Features β’ Demo β’ Installation β’ Usage β’ Configuration β’ Contributing
- Overview
- Features
- Architecture
- Technologies Used
- Installation
- Configuration
- Usage
- Project Structure
- API Integration
- Database Schema
- Screenshots
- Contributing
- License
- Contact
The AI-Powered Complaint Management System is a sophisticated web application designed to streamline customer support operations. Built with Streamlit and powered by Google's Gemini AI, this system intelligently handles customer queries, automatically categorizes complaints, assigns agents based on workload and skills, and provides real-time ticket tracking.
- π€ AI-Powered Chatbot using Google Gemini 2.5 Pro
- π Intelligent Ticket Routing with priority detection
- π₯ Smart Agent Assignment based on workload and skills
- π§ Email Notifications for ticket status updates
- π Secure Authentication with password hashing
- π Admin Dashboard for monitoring and management
- πΎ SQLite Database for data persistence
- π RAG (Retrieval-Augmented Generation) for FAQ matching
-
π¨οΈ Interactive Chatbot
- Ask questions and get instant answers from FAQ knowledge base
- Automatic ticket creation when AI cannot resolve the query
- Natural language understanding powered by Gemini AI
-
π« Ticket Management
- Real-time ticket tracking with unique IDs
- View all your tickets in one place
- Automatic categorization (Shipping, Refund, Login, Cancellation)
- Priority assignment (High, Medium, Low)
-
π Feedback System
- Provide feedback on resolved tickets
- Help improve service quality
-
π FAQ Access
- Browse frequently asked questions
- Self-service support resources
-
π Comprehensive Dashboard
- View all tickets across the system
- Monitor ticket status and priority
- Track agent workload distribution
-
π€ Agent Management
- Assign/reassign tickets to agents
- View agent workload and availability
- Skill-based agent matching
-
π Status Updates
- Update ticket status (Pending, In Progress, Resolved, Closed)
- Automatic email notifications to users
- Bulk operations support
-
π Analytics
- Export ticket history to CSV
- Track resolution times
- Monitor system performance
graph TD
A[User Interface - Streamlit] --> B[Authentication Layer]
B --> C{User Type}
C -->|User| D[Chatbot Interface]
C -->|Admin| E[Admin Dashboard]
D --> F[Gemini AI Engine]
F --> G{Can Answer?}
G -->|Yes| H[Return Answer]
G -->|No| I[Create Ticket]
I --> J[SQLite Database]
E --> J
J --> K[Agent Assignment System]
K --> L[Email Notification Service]
L --> M[User]
| Technology | Purpose |
|---|---|
| Python 3.x | Core programming language |
| Streamlit | Web application framework |
| Google Gemini AI | Natural language processing and RAG |
| SQLite | Database management |
| scikit-learn | TF-IDF vectorization |
| FAISS | Vector similarity search |
| pandas | Data manipulation and CSV export |
| smtplib | Email notification system |
| hashlib | Password encryption |
- Python 3.8 or higher
- pip package manager
- Google Cloud account with Gemini API access
- Gmail account for email notifications (optional)
-
Clone the Repository
git clone https://github.com/MuditIsOP/ibm.git cd ibm -
Create Virtual Environment (Recommended)
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Set Up Configuration Create a
.streamlit/secrets.tomlfile in the project root:GOOGLE_API_KEY = "your-google-gemini-api-key" SENDER_EMAIL = "your-email@gmail.com" SENDER_EMAIL_PASSWORD = "your-app-password"
-
Run the Application
streamlit run app.py
-
Access the Application
- Open your browser and navigate to
http://localhost:8501 - Default admin credentials:
- Email:
admin@test.com - Password:
admin123
- Email:
- Open your browser and navigate to
- Visit Google AI Studio
- Create a new API key
- Add the key to your
secrets.tomlfile
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password
- Add your email and app password to
secrets.toml
The system automatically creates and initializes the SQLite database (complaints.db) on first run with three tables:
- users: User authentication and profile information
- tickets: Support ticket records
- agents: Agent information and workload tracking
-
Registration
- Click "Register Here" on the login page
- Enter your email and password
- Confirm password and register
-
Login
- Use your registered email and password
- Access the user dashboard
-
Ask a Question
- Type your query in the chatbot interface
- Receive instant answers from the AI or get a ticket created
-
Track Tickets
- View all your tickets in "My Tickets" section
- Track specific tickets using Ticket ID
- Provide feedback on resolved tickets
-
Login
- Use admin credentials:
admin@test.com/admin123 - Access the admin dashboard
- Use admin credentials:
-
Manage Tickets
- View all tickets in the system
- Update ticket status
- Assign/reassign tickets to agents
-
Monitor Performance
- Check agent workload distribution
- Export ticket data to CSV
- Review system analytics
ibm/
β
βββ app.py # Main Streamlit application
βββ main.py # Alternative entry point
βββ requirements.txt # Python dependencies
βββ complaints.db # SQLite database (auto-generated)
β
βββ .streamlit/
β βββ secrets.toml # API keys and credentials (not in repo)
β
βββ README.md # This file
The system uses Google's Gemini 2.5 Pro model for:
- Query Understanding: Analyzing user intent and sentiment
- Priority Detection: Assigning urgency levels based on keywords and context
- RAG Implementation: Matching queries with FAQ knowledge base
- Automated Responses: Generating contextual answers
def ask_gemini(prompt):
model = genai.GenerativeModel("gemini-2.5-pro")
response = model.generate_content(prompt)
return response.textCREATE TABLE users (
email TEXT PRIMARY KEY,
password_hash BLOB NOT NULL,
salt BLOB NOT NULL,
verified BOOLEAN DEFAULT 0
)CREATE TABLE tickets (
ticket_id TEXT PRIMARY KEY,
query TEXT NOT NULL,
status TEXT NOT NULL,
category TEXT,
priority TEXT,
assigned_to TEXT,
timestamp TEXT,
user_email TEXT,
feedback TEXT,
FOREIGN KEY (user_email) REFERENCES users (email),
FOREIGN KEY (assigned_to) REFERENCES agents (name)
)CREATE TABLE agents (
name TEXT PRIMARY KEY,
category TEXT,
workload INTEGER DEFAULT 0,
available BOOLEAN DEFAULT 1,
skills TEXT
)Contributions are welcome! Here's how you can help:
- Fork the Repository
- Create a Feature Branch
git checkout -b feature/AmazingFeature
- Commit Your Changes
git commit -m 'Add some AmazingFeature' - Push to the Branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow PEP 8 style guidelines
- Add comments for complex logic
- Update documentation for new features
- Test thoroughly before submitting PR
- Email notifications require Gmail with app passwords
- Single admin account only
- Limited to English language queries
- Multi-language support
- Advanced analytics dashboard
- Mobile responsive design
- Integration with Slack/Teams
- Voice input support
- Sentiment analysis visualization
- Role-based access control (RBAC)
- API endpoint for external integrations
This project is licensed under the MIT License - see the LICENSE file for details.
Mudit
- GitHub: @MuditIsOP
- Project Link: https://github.com/MuditIsOP/ibm
- Streamlit for the amazing web framework
- Google Gemini for powerful AI capabilities
- FAISS for efficient similarity search
- All contributors and users of this system
β Star this repository if you find it helpful!
Made with β€οΈ by Mudit