File size: 2,081 Bytes
49ec473
 
dd57053
 
 
49ec473
dd57053
49ec473
 
 
dd57053
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Sentinel MLOps Agent
emoji: 🛡️
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---

<div align="center">

# 🛡️ Sentinel: Autonomous MLOps Agent
### *Self-Healing Infrastructure Powered by Physics & Gemini 2.5*

[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge&logo=fastapi)](https://fastapi.tiangolo.com/)
[![Gemini](https://img.shields.io/badge/Google%20Gemini-8E75B2?style=for-the-badge&logo=googlebard&logoColor=white)](https://ai.google.dev/)
[![Status](https://img.shields.io/badge/Status-Operational-success?style=for-the-badge)]()

</div>

---

## ⚡ What is Sentinel?
Sentinel is an autonomous monitoring agent that doesn't just alert you when a server crashes—it **investigates why.**

Most MLOps tools rely on static thresholds (*"Alert if CPU > 80%"*). Sentinel uses **Statistical Physics (Z-Scores)** to learn the "normal" baseline of your system and detect subtle **Data Drift**.

When an anomaly is detected, it triggers an AI Agent (**Gemini 2.5 Flash**) to perform **Root Cause Analysis (RCA)** on the system logs automatically.

---

## 🚀 Live Demo: How to Test It
This API is live. You can simulate a "Cyber Attack" right now.

1.  **[Click Here to Open the Swagger UI](/docs)** (or scroll down if embedded).
2.  Click the green **`POST /monitor`** bar.
3.  Click **Try it out**.
4.  **The Test:** Change `cpu_usage` to **900**.
    ```json
    {
      "timestamp": "12:00",
      "service_name": "PaymentGateway",
      "cpu_usage": 900
    }
    ```
5.  Click **Execute**.

### 📉 The Result
You will receive a **CRITICAL** alert containing a full AI investigation report:
> *"Root Cause: Unauthorized crypto-mining process detected. Recommended Fix: Terminate process PID 409..."*

---

## ⚙️ Architecture

```mermaid
graph LR
    A[Live Data Stream] --> B(FastAPI Endpoint)
    B --> C{Anomaly Detector (Z-Score)}
    C -- Normal --> D[Log Metric]
    C -- "Anomaly (>2.5σ)" --> E[Gemini 2.5 RAG Agent]
    E --> F[Retrieve Error Logs]
    F --> G[Generate Incident Report]