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.
- Host: GitHub
- URL: https://github.com/lehuannhatrang/opsgentic
- Owner: lehuannhatrang
- License: gpl-3.0
- Created: 2026-06-20T06:44:38.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-07-08T02:55:52.000Z (13 days ago)
- Last Synced: 2026-07-08T04:20:28.850Z (13 days ago)
- Topics: ai-agents, aiops, devops, gitops, kubernetes, python
- Language: Python
- Homepage:
- Size: 3.85 MB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π€ OpsGentic β AI Agents for DevOps Automation
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.
π 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