Williamh2798/runbook-responder

GitHub: Williamh2798/runbook-responder

基于 UiPath Maestro Case 编排的 AI 智能体 IT 事件响应系统,将生产告警转化为受管 Case,提供 AI 辅助根因调查与强制人工审批的修复执行流程。

Stars: 0 | Forks: 0

# Runbook Responder **由 UiPath Maestro Case 编排的智能体 IT 事件响应。** 当生产环境告警触发时,AI 智能体会进行分诊并调查根本原因。UiPath Maestro Case 通过受管的阶段管理每个事件——在任何修复操作运行之前,必须由人工进行审批。 专为 [UiPath AgentHack 2026](https://uipath-agenthack.devpost.com/) 构建 · **赛道 1:UiPath Maestro Case** ## 业务问题 生产事件往往是混乱的:告警如洪水般涌入,工程师在不同的工具之间频繁切换上下文,而修复工作往往缺乏审计追踪或审批节点。Runbook Responder 会将每个告警转化为一个**受管的 Maestro Case**,提供 AI 辅助调查,并在执行任何破坏性操作前进行强制的人工审批。 ## 解决方案概览 ``` Alert (PagerDuty/Datadog/demo) │ ▼ ┌───────────────────────────────────────────────────┐ │ UiPath Maestro Case │ │ Triage → Investigate → Approve → Remediate → Verify │ └─────────┬─────────────────────┬─────────────────────┘ │ │ ▼ ▼ Agent Builder Coded Agent (triage/classify) (Python + LangChain, built with Cursor) │ │ └──────────┬──────────┘ ▼ Human approval task (SRE approve/reject fix) ``` ## Agent 类型 | 组件 | 类型 | |---|---| | 分诊 / 分类 | **Low-code** — UiPath Agent Builder 或 API Workflows | | 根本原因调查 | **Coded agent** — Python + LangChain(使用 **Cursor** 构建) | | Case 编排 | **Low-code** — UiPath Maestro Case | | 人工审批节点 | **Low-code** — Maestro 人工任务 | | 修复执行 | **Low-code** — UiPath API Workflows + RPA(演示中为模拟) | **此解决方案同时使用了 Coded Agents 和 Low-code Agents。** ## 使用的 UiPath 组件 - **UiPath Maestro Case** — 事件 case 生命周期和审计时间线 - **UiPath Agent Builder** — 告警分诊和分类 - **UiPath API Workflows** — 向 coded 调查 agent 发起 HTTP 调用 - **UiPath Automation Cloud** — 编排和治理层 - **UiPath for Coding Agents (Cursor)** — 构建 Python 调查 agent 和 API ## 前置条件 - Python 3.11+ - 具备 Maestro Case 访问权限的 UiPath Automation Cloud(UiPath Labs 沙盒) - 可选:用于 LLM 驱动调查的 `OPENAI_API_KEY`(无此配置时可使用基于规则的后备机制) ## 快速开始 ### 1. 克隆并安装 ``` git clone https://github.com/Williamh2798/runbook-responder.git cd runbook-responder python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt cp .env.example .env ``` ### 2. 启动 API ``` uvicorn api.main:app --reload --host 0.0.0.0 --port 8000 ``` 打开 **http://localhost:8000/docs** 查看交互式 API 文档。 ### 3. 运行演示场景 ``` # 从 OOM 告警开启一个 case python demo/trigger_alert.py oom-order-service # 完整 triage + 调查(本地 demo 不需要 UiPath) python demo/trigger_alert.py oom-order-service --full ``` **演示场景:** | Slug | 场景 | 预期操作 | |---|---|---| | `oom-order-service` | 部署后 JVM 堆内存耗尽 | `rollback_deploy` | | `auth-token-expired` | 过期的服务 token 导致 401 激增 | `revoke_token` | | `upstream-timeout` | 支付网关无法访问 | `restart_service` | ### 4. 连接到 UiPath Maestro Case 请按照分步指南操作:**[uipath/SETUP.md](uipath/SETUP.md)** ## API 端点(用于 UiPath API Workflows) | 方法 | 端点 | 用途 | |---|---|---| | `POST` | `/webhooks/alert` | 接收告警,打开 case | | `POST` | `/agents/triage` | 分诊 agent | | `POST` | `/agents/investigate` | Coded 调查 agent | | `POST` | `/remediation/execute` | 执行已批准的修复 | | `GET` | `/cases/{case_id}` | Case 时间线 / 审计追踪 | | `POST` | `/demo/run/{slug}` | 端到端演示场景 | ## 项目结构 ``` runbook-responder/ ├── agents/ │ └── investigation_agent.py # Coded RCA agent (Cursor-built) ├── api/ │ ├── main.py # FastAPI webhook + agent endpoints │ └── models.py # Shared schemas ├── demo/ │ ├── incidents.py # Realistic demo scenarios │ └── trigger_alert.py # CLI to fire demo alerts ├── uipath/ │ └── SETUP.md # Maestro Case wiring guide ├── docs/ │ └── architecture.md # Architecture deep-dive ├── requirements.txt └── LICENSE # MIT ``` ## 演示视频检查清单 您不超过 5 分钟的视频应展示: 1. 告警触发(使用 `demo/trigger_alert.py`) 2. Maestro Case 打开并进入 **Investigate** 阶段 3. Coded agent 返回根本原因及建议的修复方案 4. 出现人工审批任务 — SRE 予以批准 5. 执行修复;case 关闭并带有审计追踪 6. 提及使用 **Cursor** 构建 coded agent(加分项) ## 许可证 MIT 许可证 — 详见 [LICENSE](LICENSE)。仅适用于原始解决方案代码;UiPath 平台组件仍受 UiPath 许可条款约束。 ## 作者 William Henry · UiPath AgentHack 2026
标签:AI智能体, IT运维, LangChain, Python, Socks5代理, UiPath, 无后门, 轻量级, 逆向工具