AryaNamekart/autonomous-incident-response-agent
GitHub: AryaNamekart/autonomous-incident-response-agent
一个渐进式构建的 Kubernetes 事件响应 Agent,通过合成数据集与基准评测管道实现 CrashLoopBackOff 故障的自动化根因分析与修复建议。
Stars: 0 | Forks: 0
# 自动化事件响应 Agent(渐进式构建)
我们正按照以下计划中的方案**分阶段渐进式**构建此项目:
`C:\Users\ag551\.claude\plans\https-github-com-madhurprash-langgraph-a-velvety-peacock.md`。
## 阶段 0(当前阶段)
- 项目骨架 + 针对第一类事件的**合成事件数据集**:
**Kubernetes `CrashLoopBackOff`**。
## 快速开始
### 创建 venv + 安装
```
cd "d:\autonomous incident-response agent"
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -U pip
pip install -e ".[dev]"
```
### 生成数据集
```
python -m incident_agent.datasets.crashloopbackoff.generate --out ".\data\synthetic\crashloopbackoff\incidents.jsonl" --n 50
```
### 评估预测(数据集层)
1. 准备一个预测文件(`.jsonl`),每个 incident id 对应一个 JSON,例如:
```
{"schema_version":"1","incident_id":"clb-...","predicted_category":"missing_env_var","predicted_root_cause":"...","predicted_fix_summary":"..."}
```
2. 运行:
```
python -m incident_agent.datasets.eval --dataset ".\data\synthetic\crashloopbackoff\incidents.jsonl" --predictions ".\predictions.jsonl"
```
### 运行测试
```
pytest
```
## Benchmark 运行器
在数据集上运行 Benchmark 并写入产物:
- `predictions..jsonl`
- `report..json`
示例:
```
$env:PYTHONPATH=(Resolve-Path .\src).Path
py -m incident_agent.benchmark --task crashloopbackoff --dataset ".\data\synthetic\crashloopbackoff\incidents.jsonl" --baseline heuristic --out-dir ".\artifacts\benchmarks\crashloop"
```
Baselines:
- `oracle`:从数据集中复制真实值(即 sanity check,其 category accuracy 得分应为 1.0)
- `empty`:不输出任何预测(下界)
- `heuristic`:简单的关键词匹配器(无 AI),用于验证端到端流程
标签:AI评估, LangGraph, LLM代理, 人工智能, 子域名突变, 安全规则引擎, 用户模式Hook绕过, 自动化事件响应, 运维, 逆向工具