sentinel-agent-system
by RahemShakeel
README.md
# Sentinel — Autonomous System Health Guardian
Sentinel is a multi-agent infrastructure monitoring platform for a
cloud-native environment. Beyond investigating anomalies in real time, it
also acts as the platform's natural-language interface to operational
telemetry, letting administrators query infrastructure health without
writing SQL.
Four specialized agents — Monitor, Diagnostician, Remediation, and Data
Intelligence — collaborate through a LangGraph state machine, coordinated
entirely through a single standardized MCP gateway.
## Architecture
The core workflow is a circular LangGraph state machine: Monitor detects
anomalies, Diagnostician determines a likely root cause using a RAG
knowledge base, Remediation attempts an appropriate fix (respecting
safety guardrails), and Verify confirms whether the fix worked. If
verification fails, the graph loops back to Diagnostician, up to a
configurable retry limit.
All agents interact with the system exclusively through an MCP
(Model Context Protocol) gateway — no agent talks to the database, the
logs, or the knowledge base directly. This keeps every tool call
auditable and swappable behind one interface.
## Features
- **Four CrewAI agents**, each scoped to only the MCP tools its role
requires
- **RAG-backed diagnosis** over a curated set of operational runbooks,
using Sentence-Transformers embeddings and FAISS similarity search
- **Natural-language-to-SQL** interface over the infrastructure telemetry
database, with graceful degradation for out-of-scope questions
- **Safety guardrails** that block high-risk remediation commands (e.g.
service reboots) when the system is under critical load — verified to
block correctly under real conditions, not just in theory
- **Self-healing retry loop**: failed verifications automatically route
back to diagnosis rather than silently failing
- **Full observability** via LangSmith tracing on every NL2SQL call
## Tech stack
| Layer | Tools |
|---|---|
| Agent orchestration | CrewAI |
| Workflow / state machine | LangGraph |
| Tool gateway | FastMCP |
| LLM inference | Groq (`openai/gpt-oss-120b`) |
| Embeddings + retrieval | Sentence-Transformers (`all-MiniLM-L6-v2`), FAISS |
| Observability | LangSmith |
| Database | SQLite |
## Setup
```bash
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
```
Create a `.env` file with:
GROQ_API_KEY=your_key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your_langsmith_key
LANGCHAIN_PROJECT=sentinel-agent-system
## Running a demo
```bash
python demo.py
```
This runs the full pipeline against a sample server, printing each
agent's reasoning as it moves through Monitor → Diagnose → Remediate →
Verify, including a live demonstration of the retry loop if verification
fails on the first attempt.
## Deliverables note
The Post-Mortem Report, LangSmith NL2SQL trace screenshots, and workflow
diagrams were submitted separately, per assignment instructions.This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues