Give AutoSRE a production alert. It pulls metrics, reads logs, diagnoses the root cause, runs the fix, and hands you back a written incident report. All autonomously.
AutoSRE mimics exactly what an on-call SRE does: check dashboards, read logs, form a hypothesis, apply a fix, verify recovery. All in one autonomous loop.
A production alert fires: latency spike, disk full, rising error rate.
Query time-series metrics (Prometheus) and search error logs (ELK).
The LLM correlates all signals into a root-cause hypothesis.
Pick and execute the matching Ansible playbook to fix the issue.
Confirm recovery and emit a structured incident report in Markdown.
Designed as a reference implementation. Clean, hackable, and built to show exactly how autonomous AIOps agents work.
Uses a single OpenAI-compatible tool-use loop. Swap providers by changing one line in .env. Works with Groq, Gemini, Ollama, Anthropic, or any OpenAI-compatible endpoint.
Prometheus, ELK, and Ansible are provided as lightweight Flask mocks. The entire stack starts in seconds with a single shell script and zero Docker required.
Each scenario ships with a known ground-truth root cause. You can check the agent's diagnosis against the expected answer to verify it reasoned correctly, not just got lucky.
The mock services follow the same API contracts as real Prometheus, Elasticsearch, and Ansible. Point to your actual endpoints and the agent's reasoning loop works unchanged.
Beyond the laptop demo: webhooks, approval gates, provider fallback, incident history, and an independent rollback safety net.
Run python server.py and POST to /webhook/alertmanager. Incidents are processed one at a time through a serial queue.
Remediation can require operator approval via auto, interactive prompt, or an external webhook before any playbook runs.
Chain providers with LLM_FALLBACK_CHAIN. If metrics stay unhealthy, an independent AUTOSRE_ROLLBACK_PLAYBOOK fires outside the LLM loop.
Every run is stored in SQLite and listed at GET /incidents, alongside Markdown reports under reports/.
Each scenario ships with a known ground-truth root cause so you can verify the agent's reasoning is correct, not just fast.
/data partition at 98%, write failures
No Docker required. Everything runs on plain Python and your choice of LLM provider, including completely free options.
Clone the repo and install the Python requirements.
git clone https://github.com/canyang25/AIOPS.git
cd AIOPS
pip install -r requirements.txt
Copy the example config and uncomment one provider. Groq is free with no credit card required — the fastest way to get started.
cp .env.example .env
# Open .env and set your key, e.g.:
# GROQ_API_KEY=gsk_... (free, no credit card)
# GEMINI_API_KEY=... (free tier)
# LLM_PROVIDER=ollama (fully local)
Spin up lightweight Flask mocks for Prometheus, ELK, and Ansible. Pure Python, no Docker needed.
./start_services.sh
# Mock Prometheus → http://localhost:9091
# Mock Ansible → http://localhost:9092
# Mock ELK → http://localhost:9093
Pick any scenario and watch AutoSRE investigate, remediate, and write the report.
python agent.py db # DB pool exhaustion
python agent.py disk # Disk full
python agent.py network # Network partition
python agent.py --list # List all scenarios
# No API key? Run the offline simulation:
python agent.py db --simulate
AutoSRE uses an OpenAI-compatible tool-use loop; swap the backend
with a single line in .env. Three options run completely free.
| Provider | Cost | Config | Notes |
|---|---|---|---|
| Groq | Free | GROQ_API_KEY=gsk_... |
No credit card · fastest option |
| Gemini | Free tier | GEMINI_API_KEY=... |
Google's models · generous quota |
| Ollama | Local / Free | LLM_PROVIDER=ollama |
100% local · fully private · no internet |
| Anthropic | Paid | ANTHROPIC_API_KEY=sk-ant-... |
Claude, strongest reasoning |
| OpenAI | Paid | OPENAI_API_KEY=sk-... |
GPT-4o · any OpenAI-compatible endpoint |
The mock services follow the same API contracts as the real tools. Swap the URLs and the agent's reasoning loop works unchanged.
Point to your actual Prometheus instance. The agent queries the same PromQL endpoints it uses against the mock.
PROMETHEUS_URL=http://your-prometheus:9090
Replace the mock ELK with your Elasticsearch cluster. Same search API shape; just update the URL and add auth headers if needed.
ELK_URL=http://your-elastic:9200
Swap the mock Ansible API for your AWX/Tower instance or a custom webhook. The remediation step calls the same REST endpoint.
ANSIBLE_URL=http://your-awx:8080