How hemanthh35/autonomous-ai-agent-for-it-incident-summarisation works
Project Type and Purpose
• This is a full-stack AI-powered incident management system.
• Purpose: Collect incident data via a React frontend, analyze with FastAPI backend using ML (root cause prediction, summarization, similarity search), and display results & analytics.
File Structure
• Top-level:
• frontend/ – React UI (components for form, search, dashboard, history, demo)
• main.py, summarizer.py, vector_store.py – FastAPI app and core ML modules
• predictor/ – training script, pre-trained model, synthetic logs
• incident_history.csv – CSV persistence for reported incidents
• Key patterns:
• Clear separation: frontend vs backend
• Backend follows MVC-ish structure: API (main.py) → service modules (predictor, summarizer, vector_store) → data store (CSV & FAISS)
• No relational DB; uses CSV and FAISS index
Additional Insights from README
• Frontend: React, Tailwind, Recharts, Axios
• Backend: FastAPI, Pydantic, Uvicorn, CORS
• ML: scikit-learn (logistic regression), Hugging Face T5-small, sentence-transformers, FAISS
• Endpoints: /predict, /summarize, /search, /history
a. Main Components
1. React Frontend (Browser)
– Components: Incident Form, Search, Dashboard, History, Demo
– HTTP Client (Axios)
2. FastAPI Backend (main.py)
– API Layer: PredictController, SummarizeController, SearchController, HistoryController
– ML Services:
• RootCauseService (uses logistic regression model)
• SummarizationService (calls T5-small transformer)
• SimilarityService (sentence-transformers + FAISS index)
– Data Layer: CSV persistence (incident_history.csv), vector store
3. Machine Learning Models
– LogisticRegression model (root_cause_model.pkl)
– T5-small transformer (downloaded at runtime)
– SentenceTransformer embeddings + FAISS index
4. Data Sources
– CSV file for incident history
– Synthetic training data (predictor/synthetic_incident_logs_10000.csv)
5. External Dependencies
– Hugging Face model hub
– FAISS library
b. Relationships and Interactions
• Browser ↔ React UI components ↔ Axios → Backend endpoints
• /predict → loads TF-IDF features → logistic regression → returns root cause
• /summarize → passes text to T5 model → returns summary
• /search → generates embeddings → queries FAISS index → returns similar incidents
• /history → reads/writes incident_history.csv → returns list
• Backend persists new incidents to CSV and updates FAISS index
c. Architectural Patterns and Principles
• Layered architecture: Presentation (frontend) → API → Service → Data
• Modular ML services: each capability in its own module
• Stateless backend: TensorFlow/PyTorch models loaded in memory, no session state
• CSV as simple persistence for quick prototyping
• Vector DB for similarity search
d. Technologies, Frameworks, Libraries
• Frontend: React 18, Tailwind CSS, Recharts, Axios
• Backend: FastAPI, Uvicorn, Pydantic
• ML: scikit-learn, transformers, sentence-transformers, faiss-cpu
• Data: CSV, FAISS index file
Detailed Capture of Essential Elements
• Break backend further into sub-components rather than a single block
• Data flow for each endpoint:
• Incident submission → /predict & /summarize → write to CSV → update FAISS
• Similarity search → /search → vector_store query → return matches
• History read → /history → CSV read → send list
• Model loading at startup (optional annotation)