AI & MLOpen Source
Patch.ai
Autonomous software reliability & self-healing AI engine performing PyTorch GNN-driven Root Cause Analysis on runtime crash stack traces to generate safe patch proposals.
⚡ Impact Outcome: Constructs incident-code graphs to diagnose runtime stack trace failures and propose automated self-healing patches.
Tech Stack
Python 3.10+PyTorchNetworkXGraph Neural NetworksClick CLIWatchdogHugging Face Hub
Architecture Concepts
PatchGNN Neural NetworkIncident-Code GraphAutonomous RCALive Telemetry Watcher
Live GitHub Repository README
Live SyncedPatch.ai — Autonomous Reliability & Self-Healing AI Engine
Patch.ai acts as a production immune system for software applications. It ingests application runtime crashes, error stack traces, and telemetry, builds a heterogeneous Incident-Code Graph, performs PyTorch GNN-driven Root Cause Analysis (RCA), and generates safe, risk-scored patch proposals.
Ecosystem Synergy: Reecall.ai + Patch.ai
Developer ───► Reecall.ai (Development Memory / Architectural Context)
│
▼
System Build
│
▼
Production ──► Patch.ai (Runtime Memory / Autonomous Self-Healing)
- Reecall.ai: Preserves code context, architecture decisions, AST structure, and developer intent.
- Patch.ai: Monitors runtime failures, performs Graph Neural Network RCA, predicts root causes, and proposes verified patches.
Directory & Package Architecture
Patch.ai uses a modular Python package structure mirroring :
reecall.aipatch.ai/
├── cli/ # Command line interface (`patch-ai`)
├── configs/ # Configuration defaults
├── dataset/ # Incident dataset generator & PyTorch dataloaders
├── features/ # Failure heuristics, feature mapping, & crash clustering
├── graph/ # Heterogeneous Incident-Code Graph builder & store
├── inference/ # Root Cause Search, retriever, & risk ranker
├── memory/ # Patch prompt context builder & risk scorer
├── model/ # PyTorch PatchGNN neural network & vector embeddings
├── parser/ # Stack trace scanner, AST symbol parser, import analyzer
├── patch_ai/ # Package initialization
├── tests/ # Pytest suite
├── watcher/ # Live telemetry log stream observer
├── train.py # End-to-end GNN training pipeline
├── train_dataset.py # Synthetic crash incident dataset generator
├── infer.py # CLI inference entrypoint for stack trace RCA
├── eval_model.py # Model evaluation & RCA recall benchmark
└── upload_hf.py # Hugging Face Hub model uploader
Installation & Setup
bash
git clone https://github.com/om-ghante/patch.ai.git
cd patch.ai
# Install in editable mode
pip install -e .
Quick Start
1. Generate Synthetic Incident Dataset
bash
python train_dataset.py --samples 500 -o data/dataset.json
2. Train PatchGNN Model
bash
python train.py /path/to/target/repo --epochs 50 --output data/checkpoints
3. Diagnose Crash Trace & Suggest Patch
bash
python infer.py /path/to/target/repo "ZeroDivisionError in calculate_metrics" --top-k 3
CLI Usage
bash
# Scan repository and build incident graph
patch-ai scan /path/to/repo
# Run RCA on a stack trace file
patch-ai diagnose /path/to/repo /path/to/trace.log
# Generate patch proposal
patch-ai patch /path/to/repo /path/to/trace.log
# Monitor live log directory for runtime exceptions
patch-ai watch /path/to/logs
License
MIT License © 2026 Om Ghante.