umeshbagade/IncAnalyserAI

โ˜… 0Forks 0TypeScriptGitHub โ†—Compare

README

IncAnalyserAI

AI-powered Production Incident Root Cause Analysis Platform

A full-stack application for analysing production incidents with a multi-stage investigation pipeline: Saturn โ†’ DataHub โ†’ Ingestion.

Dashboard Preview Next.js FastAPI TypeScript


๐Ÿ“‹ Prerequisites

  • Node.js v18+ (recommended: v22.17.1)
  • Python 3.10+
  • npm or yarn

๐Ÿš€ Setup Instructions (Fresh Clone)

Follow these steps to set up the project on a new machine after cloning:

1. Clone the Repository

git clone <repo-url>
cd IncAnalyserAI

2. Backend Setup (FastAPI)

cd backend

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate   # On macOS/Linux
# OR
venv\Scripts\activate      # On Windows

# Install Python dependencies
pip install -r requirements.txt

3. Frontend Setup (Next.js)

cd frontend

# Install Node.js dependencies
npm install

4. Run the Application

You need two terminal windows running simultaneously.

Terminal 1 โ€” Start Backend Server

cd backend
source venv/bin/activate   # macOS/Linux
# OR venv\Scripts\activate  # Windows
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

The backend is now running at http://localhost:8000

Terminal 2 โ€” Start Frontend Server

cd frontend
npm run dev

The frontend is now running at http://localhost:3000


๐ŸŽฏ Usage

Landing Page

Open http://localhost:3000 โ€” Browse all incidents, search by ID, or click "New Investigation".

Investigation Dashboard

Navigate to an incident (e.g. http://localhost:3000/inc/INC-2026-07-20-001) to see:

Panel Content
Header INC ID, Flow name, Severity badge, Elapsed timer, Escalate/Settings
Left (30%) Original incident text, Triage summary, Extracted entities, Timeline of events
Bottom-Left Root Cause Analysis (RCA) with confidence bar, Causal chain, Best-Next-Action buttons
Center (45%) Flow DAG (Saturn โ†’ DataHub โ†’ Ingestion) โ€” click nodes to see evidence + live SSE event stream
Right (25%) Context-sensitive Evidence & Citations per selected step โ€” tool calls, runbook links, similar past incidents, feedback

Analysis Flow Order

  1. Saturn โ€” Report-level checks (dashboards, counts, aggregations)
  2. DataHub โ€” Data layer inspection (Oracle, Hive, data dumps)
  3. Ingestion โ€” Pipeline ingestion checks (feeds, loaders, transforms)

๐Ÿ“ Project Structure

IncAnalyserAI/
โ”œโ”€โ”€ backend/                      # FastAPI Backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ main.py               # All REST APIs + SSE streaming
โ”‚   โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”‚   โ””โ”€โ”€ venv/                     # Python virtual environment (gitignored)
โ”œโ”€โ”€ frontend/                     # Next.js 15 Frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ globals.css       # Dark theme + custom utilities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx        # Root layout
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx          # Landing page (incident list)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ inc/[id]/page.tsx # Incident detail + analysis dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx        # Top bar
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ IncidentPanel.tsx # Left panel
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RCAPanel.tsx      # Bottom-left panel
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FlowDAG.tsx       # Center DAG visualization
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LiveEventStream.tsx # SSE event stream
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ EvidencePanel.tsx # Right panel
โ”‚   โ”‚   โ”œโ”€โ”€ data/mockData.ts      # Mock incident data
โ”‚   โ”‚   โ””โ”€โ”€ types.ts              # TypeScript interfaces
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ tsconfig.json
โ”‚   โ””โ”€โ”€ tailwind.config.js
โ””โ”€โ”€ .gitignore

๐ŸŒ API Endpoints

Method Endpoint Description
GET / Service info
GET /health Health check
GET /incidents List all incidents
POST /incidents Start investigation โ†’ returns run_id
GET /incidents/{run_id} Get investigation state
GET /incidents/{run_id}/stream SSE event stream (2s per step)
POST /incidents/{run_id}/feedback Mark step useful/wrong
POST /incidents/{run_id}/approve Approve remediation
GET /knowledge/flows/{id} Flow DAG definitions

๐Ÿ›  Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS, Lucide Icons
  • Backend: FastAPI, Python 3.10+, Uvicorn, SSE streaming
  • Design: Dark theme, Responsive layout, Real-time event streaming

๐Ÿ“„ License

N A