Autonomous, self-healing diagnostics and repair system for data pipelines. This project combines static code analysis, machine learning classification, and LLM-driven patch generation to automatically detect, classify, and fix failures in workflows (e.g., Apache Airflow DAGs).
- Failure Diagnostics: Parses logs and identifies error signatures using both rule-based (Regex) and ML (TF-IDF/Random Forest) classifiers.
- Autonomous Repair: Generates repair plans via LLM (Llama-3.3-70b via Groq), complete with justifications and AST-based code modifications.
- Human-in-the-Loop Review: "Review Queue" isolates high-risk changes (e.g., confidence < 80%) for human approval before application.
- Playbook Retrieval: Uses FAISS vector search to find and apply historical solutions to new errors.
- Rollback Manager: Instantly reverse applied patches with dry-run support.
- Rich Intelligence Dashboard: Visualize ML classifier accuracy, confusion matrix, and system KPIs in real-time.
- Stack: React 18, Vite, React Router v6.
- UI System: Custom built with HTML/CSS, highly stylized terminal aesthetic (JetBrains Mono).
- Service Layer: Centralized
api.tshandles all CRUD operations to the backend. - Error Handling: Custom
PageErrorBoundaryisolates crashes to individual pages.
- Core API: Exposes endpoints for data retrieval, plan generation, and action execution.
- Data Layer: Stores state locally in JSONL files (
episodes_raw.jsonl,repair_plans.jsonl,audit_log.jsonl). - AI Modules:
classifier: ML + Regex failure classification.planner: LLM integration for reasoning and generating repair actions.patcher: AST-based code modifier for applying fixes to.envor python files.playbook: RAG system using FAISS to query past knowledge.
- Docker Compose: Full-stack orchestration (Frontend on Nginx, Backend on Uvicorn).
- Frontend: React, TypeScript, Vite
- Backend: Python 3.10, FastAPI, Uvicorn, Pydantic
- AI/ML: Scikit-Learn (Random Forest), FAISS, Groq API (LLaMA 3)
- DevOps: Docker, Docker Compose
1. Start Backend
# Activate virtual environment
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start FastAPI server
uvicorn main:app --reload --port 8000API runs on http://localhost:8000 | Swagger UI at http://localhost:8000/docs
2. Start Frontend
cd frontend
npm install
npm run devApp runs on http://localhost:5173
# 1. Set your Groq API Key
echo "GROQ_API_KEY=your_api_key_here" > .env
# 2. Build and run containers
docker compose up --build- Frontend:
http://localhost:80 - Backend API:
http://localhost:8000
- Dashboard: High-level KPIs (total episodes, auto-patch rate, MTTR).
- Episodes: Browse raw failure events. Displays the exact error, ML confidence, and which AI classifiers agreed on the issue.
- Repair Plans: View all historical AI-generated plans. Approvals/Rejections are handled here (for pending plans).
- Review Queue: Focused workflow for plans flagged as
Requires Human Approvaldue to low confidence. - Audit Trail: Immutable log of all system actions (plan generations, approvals, rejections, executions).
- Rollback: Manage and revert previously applied patches.
- Intelligence: In-depth ML metrics, confusion matrix, training accuracy plot, and failure class distribution.
- Settings: Dynamic configuration for governance thresholds (e.g., auto-patch confidence levels).
See http://localhost:8000/docs for the interactive OpenAPI spec.
GET /api/dashboard/stats: Returns KPI metrics and failure distributions.GET /api/episodes: Retrieves all logged failure episodes, joined with plan statuses and confidence.GET /api/plans: Retrieves all repair plans.GET /api/review-queue: Fetches pending plans flagged for human review.GET /api/audit: Returns the system event log.GET /api/intelligence: Retrieves ML classification reports, confusion matrix, and agreement rates.
POST /api/review-queue/{plan_id}/approve: Approves and executes a pending plan.POST /api/review-queue/{plan_id}/reject: Rejects a pending plan and archives it.POST /api/rollback/{plan_id}: Reverts an applied plan (supports dry-run via?dry_run=true).PUT /api/settings/thresholds: Updates system governance thresholds.
1. Swagger UI shows blank white screen
- Fix: Hard-refresh your browser (
Ctrl+Shift+R). This is typically a CDN caching issue with the Swagger UI assets, the API itself is working.
2. Frontend stays on "LOADING..." forever
- Fix: Ensure the FastAPI backend is running on port 8000. Check the terminal for python syntax errors. If using Docker, check
docker compose logs backend.
3. Docker compose fails with "variable is not set"
- Fix: You must create a
.envfile in the root directory. At minimum, it should containGROQ_API_KEY=xxxandOPENAI_API_KEY=xxx.
4. ReferenceError or React Crash on a Page
- Fix: The app uses
PageErrorBoundary. Click "RETRY" or check the developer console for the exact stack trace. If a UI variable is missing, verify the backend API payload matchesfrontend/src/app/services/api.ts.