An open API service indexing awesome lists of open source software.

https://github.com/lehuannhatrang/opsgentic

OpsGentic β€” AI Agents for DevOps Automation. Self-healing Kubernetes with AI agents.
https://github.com/lehuannhatrang/opsgentic

ai-agents aiops devops gitops kubernetes python

Last synced: 9 days ago
JSON representation

OpsGentic β€” AI Agents for DevOps Automation. Self-healing Kubernetes with AI agents.

Awesome Lists containing this project

README

          

# πŸ€– OpsGentic β€” AI Agents for DevOps Automation


OpsGentic logo


Self-healing Kubernetes with AI agents.

OpsGentic turns an alert into a reviewed GitOps pull request β€” automated Root Cause Analysis, Validation, and Remediation, with a human in the loop.


OpsGentic website
Kubernetes GitOps
LangGraph multi-agent
Model Context Protocol
vLLM / OpenAI-compatible LLM
Python 3.11+
License: GPLv3
PRs welcome


🌐 Website & Documentation
Β Β·Β  Quickstart
Β Β·Β  Architecture
Β Β·Β  GitHub

---

> **Alert fires β†’ agents find the root cause β†’ propose a minimal manifest fix β†’ open a PR on your GitOps repo β†’ you approve β†’ ArgoCD/Flux applies it.**

> No kubectl, no manual patching.

**OpsGentic** is an open-source **AIOps / agentic SRE** platform for **Kubernetes incident response
and auto-remediation**. A multi-agent [LangGraph](https://github.com/langchain-ai/langgraph)
pipeline performs automated **root cause analysis** on Prometheus/Alertmanager alerts (or a chat
message), then remediates **through GitOps** β€” every change is a reviewable pull request opened on
your **ArgoCD/Flux** repo, never a live `kubectl` mutation. Think of it as an **AI SRE agent** that
turns alerts into self-healing infrastructure, with a human in the loop.

## ✨ Why OpsGentic

- 🧠 **Multi-agent RCA β†’ Validation β†’ Remediation** β€” a stateful LangGraph graph, not a single prompt.
- πŸ”§ **Auto-remediation as code** β€” proposes surgical manifest edits and opens a **GitOps PR** (ArgoCD/Flux applies after merge).
- πŸ™‹ **Human-in-the-loop** β€” pauses for approval before any PR (or PR review when auto-approve is on).
- πŸ”’ **Read-only by design** β€” all cluster/repo reads go through [MCP](https://modelcontextprotocol.io/) servers; no direct k8s client, no kubectl. Writes happen only via Git.
- πŸ” **GitOps-native & multi-repo** β€” discovers the owning repo from ArgoCD/Flux; GitHub / GitLab / Gitea.
- ♻️ **Convergent** β€” a re-fired alert updates the existing PR (comment or one incremental commit) instead of stacking duplicates.
- ⚑ **Async** β€” the API enqueues and returns a `thread_id` to poll; a worker drives the run.
- ✍️ **Editable agent skills** β€” tune agent behavior via markdown prompts (a ConfigMap), no rebuild.
- 🧩 **Bring your own LLM** β€” any OpenAI-compatible endpoint (local **vLLM**, etc.), env-configured.

## 🧩 How it works

```
Prometheus/Alertmanager ─alert─▢ OpsGentic API ─enqueue─▢ Worker
β”‚ RCA β†’ Validation β†’ [approve] β†’ Action
ArgoCD/Flux ◀─sync─ merge ◀─ Pull Request β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

1. A Grafana/Alertmanager webhook (or `POST /chat`) is **enqueued**; the API returns `202 { thread_id }`.
2. The worker runs **RCA** (root-cause hypothesis) β†’ **Validation** (deterministic checks) β†’ **Action**.
3. Action reads the GitOps repo (read-only via MCP), proposes a **minimal manifest edit**, and opens a **PR**.
4. You approve (or auto-approve); ArgoCD/Flux applies the merged change.

Deep dive: **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**.

## πŸš€ Quick start

**One-command demo** β€” provisions the cluster (or a local k3d/minikube/kind), ArgoCD, Prometheus,
the demo apps, and opsgentic; forks the demo repo for you and only asks for a GitHub PAT:

```bash
./hack/demo-up.sh # idempotent; ./hack/demo-down.sh to tear it down
```

**Local dev** β€” no cluster, just the graph:

```bash
python -m venv .venv && . .venv/bin/activate
pip install -e .
cp .env.example .env # set LLM_BASE_URL / LLM_API_KEY (empty = canned fallback)

# try the full graph locally (synchronous, no cluster needed)
opsgentic --file examples/grafana_alert.json --source grafana --approve
```

Full walkthrough β€” one-command demo, local dev, and the manual end-to-end Kubernetes path
(GitHub auth, ArgoCD, Alertmanager webhook, `bootstrap.sh`): **[QUICKSTART.md](QUICKSTART.md)**.

## πŸ“š Documentation

| Doc | What's inside |
| --- | --- |
| [Website](https://lehuannhatrang.github.io/opsgentic/) | Project homepage & docs hub |
| [QUICKSTART.md](QUICKSTART.md) | Install & run β€” dev + Kubernetes, GitHub auth, ArgoCD, Alertmanager webhook, troubleshooting |
| [docs/USAGE.md](docs/USAGE.md) | HTTP API, triggers, full configuration reference, editing agent skills, deploy |
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Agents, async queue/worker, graph flow, remediation & convergence, multi-repo resolution |

## πŸ—ΊοΈ Roadmap

- βœ… Multi-agent RCA / Validation / Remediation on LangGraph, human-in-the-loop gate
- βœ… Read-only MCP gateway (kubernetes-mcp-server, github-mcp-server); no kubectl
- βœ… Agentic GitOps remediation (manifest edits) + re-fire convergence; GitHub / GitLab / Gitea
- βœ… Durable checkpoints + async task queue (Procrastinate/Postgres) + worker
- βœ… Editable agent-skill prompt library (ConfigMap)
- ⏳ Deeper validation skills; observability/tracing; worker autoscaling

## ❓ FAQ

**What is OpsGentic?**
An open-source AI agent for Kubernetes incident response. It reads Prometheus/Alertmanager alerts,
runs automated root cause analysis with a multi-agent LangGraph pipeline, and opens a GitOps pull
request with a minimal manifest fix β€” self-healing Kubernetes with a human in the loop.

**How does OpsGentic remediate incidents without `kubectl`?**
It never mutates the cluster directly. All cluster and repo reads go through read-only MCP servers,
and every change is written as a pull request on your GitOps repo, which ArgoCD or Flux applies
after merge.

**Which LLMs does it support?**
Any OpenAI-compatible endpoint β€” a self-hosted **vLLM** server, OpenAI, or other compatible APIs β€”
configured via environment variables.

**Does it work with ArgoCD and Flux?**
Yes. OpsGentic is GitOps-native and multi-repo: it discovers the owning repository from your
ArgoCD/Flux Applications and supports GitHub, GitLab, and Gitea.

**How do I try it quickly?**
Run `./hack/demo-up.sh` for a one-command demo (cluster + ArgoCD + Prometheus + demo apps), or use
the local-dev path with no cluster. See the **[Quickstart](QUICKSTART.md)**.

## 🀝 Contributing

Issues and PRs are welcome. Licensed under **[GPLv3](LICENSE)**.
Website & docs: **https://lehuannhatrang.github.io/opsgentic/**

---

Keywords: Kubernetes Β· Kubernetes incident response Β· SRE Β· DevOps Β· AIOps Β· AI SRE agent Β· AI agent Β· agentic AI Β· multi-agent Β· LLM Β· vLLM Β· LangGraph Β· MCP Β· Model Context Protocol Β· auto-remediation Β· self-healing Kubernetes Β· self-healing infrastructure Β· root cause analysis Β· RCA Β· GitOps Β· ArgoCD Β· Flux Β· Prometheus Β· Alertmanager Β· alert remediation Β· incident response automation Β· pull request automation