Production-grade, self-hosted AI incident investigation platform built with Spring Boot 3, Spring AI, and 100% open-source infrastructure.
When a production incident occurs, SentinelAI autonomously collects logs and metrics, searches historical incidents and runbooks, correlates evidence across agents, and generates root cause hypotheses with remediation recommendations and postmortem reports.
┌─────────────┐ ┌──────────────┐ ┌─────────────────────────────────────────┐
│ Frontend │────▶│ API Gateway │────▶│ incident-service │ agent-service │
│ React/MUI │ │ Spring Cloud │ │ rag-service │ ingestion-service │
└─────────────┘ └──────────────┘ │ notification-service │
│ │ └─────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌──────────────┐ ┌────────┐ ┌──────────┐ ┌─────────┐
│ Keycloak │ │ Redis │ │Redpanda│ │PostgreSQL│ │ Ollama │
│ (Auth) │ │Rate Limiting │ │ Events │ │ pgvector │ │ (LLM) │
└─────────────┘ └──────────────┘ └────────┘ └──────────┘ └─────────┘
│
┌─────────────────────────┼─────────────────────────┐
▼ ▼ ▼
┌──────────┐ ┌────────────┐ ┌──────────┐
│Prometheus│ │ Grafana │ │ Loki │
└──────────┘ └────────────┘ └──────────┘
| Service | Port | Responsibility |
|---|---|---|
| api-gateway | 8080 | Auth, routing, rate limiting, correlation IDs |
| incident-service | 8081 | Incident CRUD, timeline, reports, Flyway migrations |
| agent-service | 8082 | Multi-agent AI orchestration (Log, Metrics, Historical, Runbook, RCA) |
| rag-service | 8083 | Vector search, embeddings, knowledge retrieval |
| ingestion-service | 8084 | Log/metrics collection from Loki/Prometheus |
| notification-service | 8085 | Event-driven notifications via Redis |
| frontend | 3000 | React dashboard UI |
| Agent | Input | Output |
|---|---|---|
| Log Agent | Loki logs / sample logs | { summary, severity, confidence } |
| Metrics Agent | Prometheus metrics | { anomaly, metric, reason } |
| Historical Incident Agent | Vector search | Similar past incidents |
| Runbook Agent | Hybrid RAG search | Remediation guidance |
| RCA Agent | All agent outputs | { rootCause, confidence, evidence, recommendedActions } |
- Docker & Docker Compose v2
- 8 GB+ RAM (16 GB recommended for Ollama)
- 20 GB disk space
./run.shOr manually:
docker compose up -d| Service | URL | Credentials |
|---|---|---|
| Frontend | http://localhost:3000 | See below |
| API Gateway | http://localhost:8080 | JWT required |
| Keycloak | http://localhost:8180 | admin / admin |
| Grafana | http://localhost:3001 | admin / admin |
| Prometheus | http://localhost:9090 | — |
| Swagger (Incident) | http://localhost:8081/swagger-ui.html | — |
| User | Password | Role |
|---|---|---|
| admin | admin | ADMIN |
| sre | sre | SRE |
| engineer | engineer | ENGINEER |
| viewer | viewer | VIEWER |
./stop.sh- User creates incident via frontend or API
incident.createdevent published to Redpanda- User triggers Run AI Analysis
incident.analysis.startedevent consumed by agent-service- Log Agent analyzes logs from ingestion-service
- Metrics Agent analyzes Prometheus metrics
- Historical Incident Agent retrieves similar incidents via RAG
- Runbook Agent retrieves remediation runbooks
- RCA Agent aggregates all evidence and generates root cause
- Report saved; postmortem generated; user notified
All configuration via .env:
POSTGRES_DB=incidentdb
POSTGRES_USER=incident
POSTGRES_PASSWORD=incident
OLLAMA_MODEL=qwen2.5:7b # Change to qwen3:8b when available
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=admin
REDIS_HOST=redis
KAFKA_BOOTSTRAP_SERVERS=redpanda:9092No secrets in source code.
All APIs proxied through gateway at http://localhost:8080/api/.
POST /api/incidents Create incident
GET /api/incidents List incidents
GET /api/incidents/{id} Get incident
GET /api/incidents/search?q= Search incidents
POST /api/incidents/{id}/analyze Trigger AI analysis
GET /api/incidents/{id}/report Get analysis report
GET /api/incidents/{id}/timeline Get timeline
POST /api/knowledge/search Semantic search
POST /api/knowledge/search/hybrid Hybrid search
GET /api/knowledge/search?q= Keyword search
GET /api/agents/log/{id} Log agent output
GET /api/agents/metrics/{id} Metrics agent output
GET /api/agents/historical?q= Historical search
GET /api/agents/runbooks?q= Runbook search
GET /api/agents/stream/{id} SSE streaming analysis
See requests.http for complete test cases.
mvn clean package -DskipTestsmvn testUses Testcontainers for PostgreSQL integration tests.
sentinel-ai/
├── common/ # Shared DTOs, events
├── api-gateway/ # Spring Cloud Gateway
├── incident-service/ # Incident domain + Flyway
├── agent-service/ # AI multi-agent orchestration
├── rag-service/ # pgvector RAG
├── ingestion-service/ # Loki/Prometheus ingestion
├── notification-service/ # Event notifications
├── frontend/ # React + TypeScript + MUI
├── infra/ # Prometheus, Grafana, Loki, Keycloak
├── docker-compose.yml
├── run.sh / stop.sh
└── requests.http
- Micrometer metrics exposed at
/actuator/prometheuson each service - Structured JSON logging with correlationId, incidentId, requestId
- Grafana dashboards pre-provisioned (SentinelAI Platform Overview)
- Loki for centralized log aggregation
- Health probes at
/actuator/health/livenessand/actuator/health/readiness
- Keycloak JWT authentication with OAuth2 Resource Server
- RBAC roles: ADMIN, SRE, ENGINEER, VIEWER
- Rate limiting via Redis in API Gateway
- CORS configured for frontend origins
- Input validation on all REST endpoints
- Audit logging table in PostgreSQL
- Resilience4j circuit breakers on Ollama, Loki, Prometheus, inter-service calls
- Retries on LLM calls
- Graceful fallbacks to sample logs/metrics when observability stack unavailable
- Graceful shutdown configured on all services
Automatically loaded on startup via Flyway:
- 5 historical incidents
- 5 runbooks
- 2 postmortems
- 5 knowledge documents
- 4 users
| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 3.4, Spring AI 1.0 |
| Build | Maven |
| Database | PostgreSQL 16 + pgvector |
| Messaging | Redpanda (Kafka-compatible) |
| Cache | Redis 7 |
| LLM | Ollama (qwen2.5:7b) |
| Auth | Keycloak 26 |
| Gateway | Spring Cloud Gateway |
| Frontend | React 18, TypeScript, Vite, MUI |
| Observability | Prometheus, Grafana, Loki |
| Containers | Docker Compose |
MIT