How tanujkumar24/customer_ticket_resolver_with_ai works
Project type and purpose
• This is a full-stack Python application built with Streamlit as the UI layer and a lightweight backend “MCP” (Multi-Class Predictor) model server.
• Purpose: Automate customer-support ticket processing by classifying intent/urgency, generating summaries or reply drafts via OpenAI GPT, and optionally logging tickets to Google Sheets or sending emails.
File structure
Top-level files and directories:
• main.py – Streamlit frontend entry point
• mcp_server.py – Flask/FastAPI-style backend serving NLP model predictions
• register_ticket.py/test_euri.py – utility or test scripts
• tools/ – helper modules:
– classify_ticket.py – intent/urgency classifier
– generate_reply.py – wraps GPT API calls
– gmail_sender.py – handles email notifications
– sheet_connector.py – Google Sheets logging
• google_creds.json – credentials for Google API
• pyproject.toml, requirements.txt, .python-version, uv.lock – build/configuration/dependency lock
Extract architecture hints from the README
• Workflow graph:
Customer → Streamlit Form → MCP Server → LLM Response Generator → Display
↓
Google Sheet Logger
• Key components called out: Streamlit UI, MCP server, LLM integration, Google API integration.
Main components
a. User Agent (Web Browser)
b. Streamlit Frontend (main.py)
c. MCP Model Server (mcp_server.py + classify_ticket.py)
d. LLM Service (OpenAI GPT through generate_reply.py)
e. Persistence/Logging
• Google Sheets via sheet_connector.py
• Optionally emails via gmail_sender.py
f. Auxiliary/Test Modules (register_ticket.py, test_euri.py)
g. External services/APIs: OpenAI API, Google API, SMTP
Relationships & Data Flows
• Streamlit → MCP Server: “gRPC/REST request with raw text”
• MCP Server → classify_ticket module: “internal function call”
• MCP Server → LLM Service: “calls generate_reply.py → OpenAI GPT API”
• LLM Response → MCP Server → Streamlit for display
• Conditional branches:
• MCP Server → sheet_connector → Google Sheets
• Streamlit or MCP Server → gmail_sender → SMTP server
• Test scripts operate offline or via wrapper calls
Architectural patterns & design principles
• Separation of concerns: UI vs. ML inference vs. external integration
• Modular codebase (tools/ directory for pluggable functionality)
• Service-oriented backend (MCP as independent microservice)
• External API abstraction layers (generate_reply.py, sheet_connector.py, gmail_sender.py)
Technology & Framework callouts
• Frontend: Streamlit framework (main.py)
• Backend: Python microservice, could be FastAPI or Flask in mcp_server.py
• NLP/AI: custom classifier + OpenAI GPT via REST
• Data Logging: Google Sheets API (sheet_connector.py)
• Email: SMTP integration (gmail_sender.py)
• Testing: pytest or custom script (test_euri.py)
• Deployment hints: supports Docker/Kubernetes, Streamlit Cloud, Heroku