How siddhant-pawar/streamlit-ticketassist-rag-llm-helpdesk works
Project Type and Purpose
• This is a full-stack, multi-page Streamlit application for ticket management (Help Desk) with an integrated Retrieval-Augmented Generation (RAG) chatbot.
• The system handles user/admin authentication, CRUD operations on tickets (MySQL), PDF ingestion & vector search (LangChain + FAISS), AI chat, and video upload/streaming.
High-Level Architecture Components
A. User Interface (Streamlit Multipage)
• chatboy.py: entry point, renders login/register sidebar, routes to pages.
• backend/main.py: initializes Streamlit session, user/admin menus.
• Other pages: home.py, dashboard.py, cuad.py, intergationopration.py, llmper.py, video.py, listalldata.py, account_details.py, useroparation.py, useraccountdetail.py, register.py, upload pages.
B. Business Logic / Backend Modules
• Ticket CRUD (backend/cuad.py): create, update, delete, fetch ticket records + email notifications via SMTP.
• Dashboard & Analytics (backend/dashboard.py): data retrieval, Pandas & Plotly charts.
• Generic CRUD (backend/intergationopration.py): Streamlit wrapper for read, update, delete.
• User Operations (backend/useroparation.py & useraccountdetail.py): same as above but scoped to individual user.
• Registration (backend/register.py): new user signup.
C. Data Storage
• MySQL Database: ticketdb, users table, tdatabase table.
• .env for sensitive config (OPENAI_API_KEY, DB credentials).
D. RAG Chatbot Subsystem
• PDF Processing (backend/llmper.py): file upload → PyPDF2 parsing → text splitter → FAISS vector store.
• Vector Search & LLM (OpenAI via LangChain): ChatChain for question answering.
E. File Storage
• PDFs: /pdfs upload folder + faiss_db.
• Videos: /backend/uploaded_videos directory.
F. External Services
• OpenAI API for LLM queries.
• SMTP mail server (smtp.gmail.com) for ticket emails.
Interactions and Data Flow
1. User/Admin logs in via Streamlit UI → main.py authenticates against MySQL.
2. Depending on role, UI routes to pages:
• Ticket pages call CRUD modules → MySQL connection (database.py) → returns results → UI updates.
• Dashboard page reads from MySQL, uses Pandas/Plotly to render analytics.
• PDF Upload page writes to /pdfs, llmper.py builds FAISS index.
• Chat page loads vector store, sends user question to OpenAI, returns answer.
• Video page uploads files to /uploaded_videos → UI lists and streams mp4/avi.
3. Email notifications triggered on ticket creation via SMTP.
Architectural Patterns & Principles
• Layered Architecture:
• Presentation: Streamlit front-end
• Application Logic: backend/*.py modules
• Data Access: database.py + MySQL connector
• Infrastructure: file system, OpenAI, SMTP
• Single Responsibility: each backend script has one domain focus (CRUD, analytics, chat, video).
• Session State: Streamlit session for user state and chat history.
• RAG Pattern: hybrid of vector store retrieval + LLM.