“AI SRE” became a product category in 2026, and nearly every article about it is a vendor page. If you already run Prometheus, Loki and Grafana, you can build a useful assistant yourself and learn exactly where these tools help and where they mislead. This is the design behind my open-source promql-agent.
What the assistant does
You ask a question in plain English:
uv run promql-agent -q "What is the current CPU usage?"
uv run promql-agent -q "show recent error logs"
uv run promql-agent --incident "HighCPU" "critical"
Behind it is a small loop: question → plan → pick tools → generate PromQL or LogQL → execute → summarise. The orchestration uses LangGraph; the tools are thin clients for Prometheus and Loki.
The architecture
- Planner: the model decides what it needs to know (metrics, logs, or both) and which time range.
- Tools: each tool does one thing, such as running an instant PromQL query, a range query, or a LogQL search. Tools return data, not opinions.
- Query generation: the model writes PromQL or LogQL, the tool executes it, and errors go straight back to the model so it can correct the query.
- Summary: the model explains what the numbers mean and shows the queries it ran.
Always show the query next to the answer. An on-call engineer trusts an answer they can re-run in Grafana.
Guardrails that matter
The lesson every AI SRE team learned in 2026, including the big vendors: an assistant that confidently blames the wrong thing is worse than no assistant. Build these in from day one:
- Read-only access. The assistant queries; it does not restart, scale or delete.
- Evidence with every claim. Each conclusion cites the query and the data behind it.
- Show what was ruled out. Listing rejected hypotheses stops responders chasing a symptom.
- Time bounds. Every query has an explicit range, so answers are reproducible.
- Health checks for the tools themselves (
--health,--tools-health): if Prometheus is unreachable, say so instead of guessing.
Test it with chaos, not demos
A demo that answers “what is CPU usage?” proves little. The repo includes a local Prometheus, Loki and Grafana stack and Litmus chaos experiments, so you can break things on purpose and check whether the assistant finds the real cause. Treat those runs as evals: keep the scenarios, score the answers, and rerun them whenever you change the prompt or the model.
Where it fits in incident response
Use it for the slow, repetitive part of an incident: gathering context, running the first ten queries, summarising logs. Keep humans on decisions. That is the same runbook-first idea behind SLOs for LLM features: measure first, act second.
FAQ
Do I need a paid AI SRE product?
Not to start. If you already run Prometheus, Loki and Grafana, an open-source assistant with read-only tools covers the most valuable part: fast, explained investigation.
Which model should power it?
One that is good at structured output and tool calling. Start with a strong hosted model, then test cheaper or local models against your chaos scenarios before switching.
Can it fix incidents automatically?
It should not, at first. Keep it read-only, measure how often it is right, and only then consider approved, narrow actions.