Skip to content

Repository files navigation

SENTINEL

AI-Powered Industrial Safety Intelligence Platform

SENTINEL detects compound industrial risks — situations where no single alarm is catastrophic, but the combination is. Gas breach + hot work permit + worker in zone is a different problem than any of those alone. SENTINEL fuses sensor telemetry, permit-to-work state, a Neo4j plant knowledge graph, and local regulation/incident RAG into one real-time operations dashboard.

Status: Phases 1–46 (Phase 46: Plant Map layout redesign).
Operator flow: Simulator → Operations → Plant Map → AI Commander → Incident Reports · docs/phase-46-status.md


Why it exists

Industrial plants generate safety-critical data across disconnected systems. A gas leak triggers one alarm; an active welding permit triggers another. But gas leak + hot work + worker in zone = catastrophe — and no existing system connects these dots in real time with explainable context.

SENTINEL correlates multi-domain signals, enriches HIGH/CRITICAL alerts with graph context (who is exposed, what equipment and permits are nearby, which hazards apply), and retrieves the regulations and similar incidents that matter.


Architecture

flowchart LR
  subgraph Sources
    DEMO["/demo Control Center"]
    CLI["Simulator CLI"]
  end

  subgraph Backend["Backend :8000"]
    API["POST /telemetry<br/>POST /demo/*"]
    RISK["Deterministic<br/>Risk Engine"]
    ENR["Graph Enrichment<br/>soft-fail"]
    RAG["Local RAG<br/>ST + FAISS"]
    WS["WS /ws/alerts"]
  end

  subgraph Intelligence
    N4J[(Neo4j<br/>plant graph)]
    CORPUS["Mock regulations<br/>+ incidents"]
  end

  subgraph Frontend["Frontend :3000"]
    SIM["Simulator /simulator"]
    OPS["Operations /"]
    MAP["Plant Map /heatmap\n(emergency map)"]
    CMD["AI Commander /alerts"]
    FACTORY["Plant Reference /factory"]
    REPORTS["Reports /reports"]
    LEGACY["Legacy /demo · /demo-mode"]
  end

  DEMO --> API
  CLI --> API
  SIM -->|"POST /telemetry"| API
  API --> RISK
  RISK -->|HIGH/CRITICAL| ENR
  ENR -.-> N4J
  RISK --> WS
  WS --> OPS & MAP & CMD
  CMD --> DRAW["Intelligence · Graph · RAG"]
  DRAW --> RAG
  RAG --> CORPUS
  LEGACY -->|"POST /demo/run"| API
Loading

Compound risk path (demo day):

sequenceDiagram
  participant Judge
  participant Demo as /demo
  participant API as Backend
  participant Risk as Risk Engine
  participant Graph as Neo4j
  participant UI as Ops / Alerts / Heatmap

  Judge->>Demo: Run Gamma or Delta
  Demo->>API: POST /api/v1/demo/run
  loop telemetry events
    API->>Risk: multi-zone compound signals
    Risk-->>API: HIGH / CRITICAL
    API->>Graph: enrich zone (soft)
    API-->>UI: WS IncidentAlert + graph_context
  end
  Judge->>UI: Open alert / zone
  UI->>API: POST /intelligence/explain
  API-->>UI: Relationship summary + Graph + incident report + regs
Loading

Full design notes: docs/architecture.md · Phase reports under docs/phase-*-status.md


Quick Start (local)

# 1. Setup
git clone <repo-url> ET-AI && cd ET-AI
cp .env.example .env
python -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
pip install -r backend/requirements.txt
pip install -r ai-services/requirements.txt
cd frontend && npm install && cd ..

# 2. Backend
cd backend && uvicorn app.main:app --reload --port 8000
# OR: docker compose up --build

# 3. Frontend (new terminal)
cd frontend && npm run dev

# 4. Optional — Neo4j + seed (for non-empty graph panels)
docker compose --profile infra up -d neo4j
# wait ~30s for Bolt, then:
PYTHONPATH=ai-services python -m ai_services.graph.seed
Service URL
Demo Mode (start here) http://localhost:3000/demo-mode
Live Ops http://localhost:3000
Live Alerts → Command Center http://localhost:3000/alerts
Interactive Digital Twin http://localhost:3000/heatmap
Architecture / Features / Tech /architecture · /features · /tech-stack
Demo Health http://localhost:3000/demo-health
Factory reference (Apex twin) http://localhost:3000/factory
Scenario Studio http://localhost:3000/demo
After Action Reports http://localhost:3000/reports
API Docs http://localhost:8000/docs
Health http://localhost:8000/api/v1/health
Copilot health http://localhost:8000/api/v1/copilot/health
Multi-agent health http://localhost:8000/api/v1/agents/health
Prediction health http://localhost:8000/api/v1/prediction/health
Reports API health http://localhost:8000/api/v1/reports/health
WebSocket ws://localhost:8000/ws/alerts
Neo4j Browser http://localhost:7474 (neo4j / sentinel_dev)

Judge path (5–7 minutes): open /demo-mode → one-click Critical H₂S Leak → Twin → Live Alerts → Incident Command → After Action Report. Shortcuts: ? help · G Studio · T Twin · I Incident · R Reports. Details: docs/judge-walkthrough.md.

Legacy 60s path: /demoGamma → Live Alerts → CRITICAL drawer.


What works today

Capability Where
Deterministic compound risk scoring backend/app/services/risk_engine.py
Live HIGH/CRITICAL WebSocket alerts WS /ws/alerts
Demo Control Center (Alpha–Delta multi-zone) /demo
Live operations (telemetry feed, timeline, risk trend) /
Zone operational dashboards /zones, /zones/[id]
Synthetic plant risk heatmap + neighbour bleed /heatmap
Local RAG + Phase 10 incident report POST /api/v1/intelligence/explain
Neo4j graph enrichment + metrics (soft-fail) graph_context on alerts + explain
Plant seed (workers, equipment, permits, hazards) python -m ai_services.graph.seed
Digital Twin Foundation (Apex plant world) /factory/* + frontend/lib/factory/
AI Scenario Studio (industrial builder) /demo + frontend/lib/scenario-studio.ts
AI Safety Copilot (explain / what-if) Alert drawer + zone dashboard · /api/v1/copilot/*
Multi-agent emergency response Same Copilot UI · /api/v1/agents/* (5 agents + orchestrator)
Predictive Incident Intelligence Incident Command Center panel · /api/v1/prediction/*
AI After Action Report /reports, /reports/[incidentId] · /api/v1/reports/*
Judge Experience & Demo Mode /demo-mode · explorers · shortcuts · /demo-health
AI Incident Command Center /incidents/[alert_id] from Live Alerts
Interactive Digital Twin (SVG) /heatmap (nav Twin)

Intentionally out of scope for this hackathon build: PostgreSQL persistence, auth, Mapbox/GIS, computer vision. Copilot / agents / prediction / AAR default to local rule/mock paths (set COPILOT_PROVIDER + API keys for cloud LLMs on chat only).

Implementation status: Phases 1–36 complete (Phase 36 = AI Commander conversation redesign only). See docs/roadmap.md · docs/phase-36-status.md.


Repository structure

ET-AI/
├── backend/                 # FastAPI — risk engine, WS, demo API, enrichment
├── frontend/                # Next.js 14 — ops, alerts, heatmap, zones, factory, demo
├── frontend/lib/factory/    # Apex digital twin metadata (no JSX)
├── simulator/               # Alpha–Delta scenarios (CLI + shared catalog)
├── ai-services/
│   ├── ai_services/graph/   # Neo4j connection, schema, queries, seed
│   └── rag/                 # Local embeddings + FAISS + explainer
├── deployment/neo4j/        # schema.cypher, queries.cypher
├── docs/                    # Continuity + judging docs
├── docker-compose.yml
└── .github/workflows/ci.yml

Tech stack

Layer Technology
Backend FastAPI, Pydantic, WebSockets
Risk Deterministic compound rules (no ML)
Frontend Next.js 14, TypeScript, Tailwind, shadcn/ui, Recharts
Graph Neo4j 5 + official Python driver
RAG SentenceTransformers + FAISS (HashEmbedder fallback)
Demo Shared simulator.scenarios catalog
CI GitHub Actions, Ruff, mypy, ESLint, pytest, Vitest

Testing

# Backend + graph + simulator + RAG
PYTHONPATH=.:ai-services:backend:simulator pytest backend/tests tests/unit ai-services/rag/tests -q

# Frontend unit tests + production build
cd frontend && npm test -- --run && npm run build

Judging & continuity docs

Document Audience
docs/demo-script.md Live demo walkthrough
docs/presentation-outline.md Pitch slides outline
docs/judge-faq.md Anticipated judge questions
docs/current-state.md What exists right now
docs/phase-15-status.md Judging UI polish
docs/phase-14-status.md Live operations dashboard
docs/phase-13-status.md Graph Context experience
docs/api-contracts.md Stable REST + WS contracts
docs/feature-status.md Feature tracker

Team

Developer Domain
A Backend, risk engine, simulator, demo API
B Frontend, dashboard, heatmap, demo UI
C Neo4j graph, RAG, enrichment, seed

License

Hackathon project — license TBD.

About

Problem Statement 1 : AI-Powered Industrial Safety Intelligence for Zero-Harm Operations

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages