How jang961111-hash/incident-agent-ablation works
This repository improves and measures an AI incident-response assistant for on-call engineers. The main workflow accepts an engineer’s question, routes it to chat or incident handling, gathers monitoring and runbook evidence, drafts a response, and validates it; it recommends actions rather than executing them. The graph can swap in RAG, a judge, cost controls, and tolerant async research. Separate evaluation tooling runs ablations and compares retrieval, answer quality, and judge agreement. Some subsystem links are documented in the README rather than shown in sampled implementation excerpts.
Main entry points: graph_ext.py Configurable graph · mcp_client.py MCP client · run_ablation.py Ablation runner · server.py Chat API
Components 25
Agent runtime
- Chat API
src/server.py - Supervisor graph
src/agent/graph.py - Route and plan
src/agent/graph.py - Research tasks
src/agent/graph.py - Analysis gate
src/agent/graph.py - Answer writing
src/agent/graph.py - Answer validation
src/agent/graph.py - LLM backends
src/agent/openai_llm.py
Evidence and integrations
- MCP client
src/agent/mcp_client.py - Ops MCP server
src/mcp_server.py - Docs MCP server
src/mcp_server_docs.py - Monitoring data
- Runbook resources
src/mcp_server.py
Response improvements
- Runbook retrieval
src/ext/rag.py - Configurable graph
src/ext/graph_ext.py - Pipeline judge
src/ext/judge.py - Fact checking
src/ext/factcheck.py - Cost and cache
src/ext/meter.py
Evaluation
- Run entry point
src/adapter.py - Ablation runner
eval/run_ablation.py - Retrieval metrics
eval/retrieval_metrics.py - Judge agreement
eval/agreement.py - Evaluation judge
eval/judge.py - Evaluation results
Other components
- On-call engineer
Connections 33
- On-call engineer → Chat API: asks
- Chat API → Supervisor graph: invokes
src/server.py - Chat API → MCP client: starts
src/server.py - Chat API → LLM backends: configures
src/server.py - Supervisor graph → Route and plan: runs
src/agent/graph.py - Route and plan → Research tasks: dispatches
src/agent/graph.py - Research tasks → MCP client: queries
src/agent/graph.py - Research tasks → Analysis gate: collects for
src/agent/graph.py - Analysis gate → Answer writing: provides evidence
src/agent/graph.py - Answer writing → Answer validation: submits draft
src/agent/graph.py - Answer validation → Answer writing: requests rewrite
src/agent/graph.py - Answer validation → Chat API: returns answer
src/server.py - MCP client → Ops MCP server: connects
src/agent/mcp_client.py - MCP client → Docs MCP server: connects
src/agent/mcp_client.py - Ops MCP server → Monitoring data: reads
- Ops MCP server → Runbook resources: serves
src/mcp_server.py - Route and plan → MCP client: gets procedure prompt
src/agent/graph.py - Route and plan → LLM backends: routes and plans
src/agent/graph.py - Answer writing → LLM backends: generates
- Configurable graph → Supervisor graph: reuses graph
src/ext/graph_ext.py - Configurable graph → Runbook retrieval: selects runbooks
src/ext/graph_ext.py - Configurable graph → Pipeline judge: validates with
src/ext/graph_ext.py - Configurable graph → Fact checking: checks claims
src/ext/graph_ext.py - Configurable graph → Cost and cache: meters calls
src/ext/graph_ext.py - Runbook retrieval → Runbook resources: ranks against
- Run entry point → Configurable graph: builds
src/adapter.py - Run entry point → MCP client: starts
src/adapter.py - Ablation runner → Run entry point: runs queries
eval/run_ablation.py - Ablation runner → Evaluation judge: scores answers
eval/run_ablation.py - Ablation runner → Fact checking: checks answers
eval/run_ablation.py - Ablation runner → Retrieval metrics: summarizes retrieval
eval/run_ablation.py - Ablation runner → Evaluation results: records
- Judge agreement → Evaluation results: measures agreement