How dimashenkov/ai-incident-investigator works
AI SRE is a prototype Kubernetes incident investigator: a simulated Datadog alert and fixture-backed observations feed specialized agents, a root-cause conclusion, and a redacted Slack report. A separate Slack thread bot answers follow-up questions. Its documented improvement loop runs scenarios, scores results, diagnoses failures, and keeps prompt changes only when evaluation supports them. Source-index imports and excerpts support the internal assembly, context, validation, merge, and provider relationships; other workflow and integration links rely on README statements, since the generated workflow artifacts are not in the supplied tree.
Main entry points: assemble.ts Incident assembly · context.ts Agent contexts · redact.ts Output redaction · provider.ts Provider contract
Components 25
Incident investigation
- Incident assembly
src/core/assemble.ts - Schema validation
src/schema/validate.ts - Agent contexts
src/agents/context.ts - Agent slices
src/agents/slice.ts - Model configuration
src/core/configuration.ts - Result merge
src/core/merge.ts - Root cause
src/core/assemble.ts - Incident report
src/core/report.ts
Observation providers
- Provider contract
src/providers/provider.ts - Provider registry
src/providers/registry.ts - Fixture providers
src/providers/fixtures.ts - Kubernetes provider
src/providers/kubernetes.ts - Fallback provider
src/providers/rogue.ts
Slack interaction
- Output redaction
src/core/redact.ts - Slack publisher
src/providers/slack-post.ts - Slack listener
src/providers/slack.ts - Thread index
src/providers/thread-index.ts - Thread replies
src/core/reply.ts - Thread builder
src/core/thread.ts
Evaluation loop
- Scenario runner
scripts/run-scenarios.mjs - Run scorer
scripts/score-run.mjs - Eval and keep rule
src/core/eval.ts - Eval command
scripts/eval.mjs
Other components
- Datadog alert
- Slack channel
Connections 28
- Datadog alert → Incident assembly: triggers
README.md - Incident assembly → Fixture providers: reads fixtures
src/core/assemble.ts - Incident assembly → Provider registry: selects provider
- Provider registry → Provider contract: implements
src/providers/registry.ts - Fixture providers → Provider contract: implements
src/providers/fixtures.ts - Kubernetes provider → Provider contract: implements
src/providers/kubernetes.ts - Fallback provider → Provider contract: implements
src/providers/registry.ts - Incident assembly → Schema validation: validates incident
src/core/assemble.ts - Incident assembly → Agent contexts: provides incident
- Agent contexts → Agent slices: builds contexts
src/agents/context.ts - Agent contexts → Model configuration: reads configuration
src/agents/context.ts - Agent contexts → Root cause: supplies context
README.md - Root cause → Result merge: concludes for merge
src/core/assemble.ts - Result merge → Schema validation: checks result
- Result merge → Incident report: provides verdict
- Incident report → Output redaction: formats for posting
README.md - Output redaction → Slack publisher: redacts output
README.md - Slack publisher → Slack channel: posts report
README.md - Slack channel → Slack listener: receives questions
README.md - Slack listener → Thread index: indexes threads
- Slack listener → Thread replies: routes question
- Thread replies → Thread builder: builds answer
- Thread replies → Output redaction: redacts reply
README.md - Output redaction → Slack channel: posts reply
README.md - Scenario runner → Datadog alert: submits scenario
README.md - Scenario runner → Run scorer: records runs
- Run scorer → Eval command: supplies scores
scripts/eval.mjs - Eval command → Eval and keep rule: applies keep rule
scripts/eval.mjs