The AI on-call partner. Detects production incidents, traces root cause, proposes a fix (with your approval), and writes the postmortem.
Companion repo for the Building Nightwatch series.
uv sync
uv run nightwatch simulateYou'll see a simulated incident flow through the four-agent graph:
watcher → analyzer → fixer → postmortem
No AWS or LLM credentials are needed for the simulator — Article 1 ships deterministic stubs so you can see the architecture working end-to-end before any real integrations land.
src/nightwatch/
├── agents/ # watcher, analyzer, fixer, postmortem
├── orchestrator.py # LangGraph wiring
├── state.py # IncidentState (the single source of truth)
├── settings.py # env-driven runtime config
└── cli.py # `nightwatch` entrypoint
- Architecture & scaffolding ← you are here
- The Watcher Agent — real CloudWatch polling
- The Analyzer Agent — LLM-powered root cause analysis
- The Fixer Agent — human-in-the-loop remediation
- The Postmortem Writer — Notion-published reports
- The Orchestrator — supervisor pattern, conditional edges, checkpointing
- PagerDuty integration
- The Next.js dashboard (
../nightwatch-fe) - Production hardening