Metadata-Version: 2.4
Name: devops-rca-agent
Version: 0.1.2
Summary: AI Powered DevOps RCA Agent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: typer
Requires-Dist: fastapi
Requires-Dist: langchain
Requires-Dist: langchain-groq
Requires-Dist: langchain-mcp-adapters
Requires-Dist: chromadb
Requires-Dist: python-dotenv
Requires-Dist: rich

# devops-rca-agent

AI-powered DevOps Root Cause Analysis (RCA) agent for failed CI/CD pipelines.

Fetches pipeline step logs (via Bitbucket MCP), classifies the failure, and generates a structured incident report using an LLM.

## Installation

```bash
pip install devops-rca-agent
```

From source:

```bash
pip install .
```

**Requirements:** Python 3.10+, Node.js (for `npx bitbucket-mcp`)

## Quick start (CLI)

```bash
rca-agent analyze \
  --workspace YOUR_WORKSPACE \
  --repo YOUR_REPO \
  --pipeline PIPELINE_UUID \
  --step STEP_UUID \
  --repo-token BITBUCKET_TOKEN \
  --groq-key GROQ_API_KEY \
  --model openai/gpt-oss-120b
```

Prints a markdown incident report to the terminal.

**Response:**

```json
{
  "message": {
    "content": "🚨 PIPELINE FAILURE REPORT ..."
  }
}
```

## What you need

| Item | Purpose |
|------|---------|
| Bitbucket access token | Read pipeline logs |
| Groq API key | LLM RCA generation |
| Pipeline UUID + Step UUID | Identify the failed run/step |

## How it works

1. Receive pipeline failure details  
2. Fetch step logs from Bitbucket  
3. Extract error context and classify failure type  
4. Build an RCA prompt and call the LLM  
5. Return a structured incident report  
