AIOps: AI for IT Operations · Module 06
AI SRE Agents
Agents that investigate incidents: our own LangGraph investigation loop, ops tools through official MCP servers in read-only mode, the open-source AI SRE tools teams use on Kubernetes, and approval before any change.
Học xong bạn làm được
- Build an investigation agent loop with LangGraph
- Give an agent ops tools through MCP servers, with limits enforced in the client
- Run k8sgpt and HolmesGPT on kind and compare them with our loop
- Require approval before any action and pick the right level of auto-remediation
Bài học
- The investigation loop
An investigating agent repeats one loop - form a hypothesis, choose a query that would confirm or rule it out, read the evidence, decide the next step - until a stopping rule fires. Built as a LangGraph graph, each step is a node, the state holds hypotheses and evidence, and explicit limits (steps, tokens, time, confidence) keep it from wandering or looping.
- Ops tools through MCP
The Model Context Protocol lets an agent use ready-made tool servers instead of hand-written API calls. grafana/mcp-grafana with --disable-write gives read-only access to Prometheus, Loki and Tempo through Grafana; containers/kubernetes-mcp-server with read_only = true in its config does the same for a cluster. Flags are a first guard; the real limits are the credentials' permissions, plus timeouts, tool allow-lists and output size caps in the client.
- AI troubleshooting on Kubernetes
Two open-source tools bring AI troubleshooting to Kubernetes - k8sgpt runs built-in analyzers over cluster resources and asks a model to explain what they found, and HolmesGPT (a CNCF Sandbox project) runs an agent loop over read-only toolsets for Kubernetes, Prometheus, Loki and more. Both run against a local kind cluster with Ollama, and comparing them with our own loop shows what a ready-made tool gives and what it hides.
- Approval and remediation
Remediation is where an agent can do real harm, so it comes last and in stages - read-only first, then suggestions a person carries out, then one-click actions behind an approval, and only then narrow automatic actions with an automatic rollback. In LangGraph an approval is an interrupt - the graph pauses, a person decides, the graph resumes - and every proposal, decision and action goes into an audit log.