An agentic AI system that autonomously observes failing builds/tests, generates competing hypotheses, tests fixes, and learns from outcomes — all while making its reasoning transparently visible in real-time.
🏆 Built for the 2026 Agentathon
This is NOT a chatbot. This is NOT an automation script. This is an AUTONOMOUS AGENT.
REPAIR.ai is a goal-driven autonomous agent that follows the core agentic loop:
╭──────────────────────────────────────────╮
│ AGENTIC LOOP │
│ │
│ PERCEIVE ──▶ REASON ──▶ ACT ──▶ LEARN │
│ ▲ │ │
│ └───────────────────────────┘ │
╰──────────────────────────────────────────╯
| Phase | Description |
|---|---|
| 👁️ PERCEIVE | Observes CI/build/test failures with deterministic signal extraction |
| 🧠 REASON | Generates 3-5 competing hypotheses with confidence scores |
| ⚡ ACT | Plans and executes safe, minimal, reversible fixes |
| 📚 LEARN | Reflects on outcomes and stores patterns for future |
Watch hypotheses compete in real-time! Each hypothesis has a confidence score that updates dynamically as evidence comes in.
╔══════════════════════════════════════════════════════════════╗
║ 🏆 HYPOTHESIS TOURNAMENT - Round 3 ║
╠══════════════════════════════════════════════════════════════╣
║ 🥇 Package typo: lodsh→lodash [██████████████████░░] 90% ⬆️ ║
║ 🥈 Missing type definitions [████████████░░░░░░░░] 60% ⬇️ ║
║ 🥉 Dependency version conflict [████████░░░░░░░░░░░░] 40% ➡️ ║
╚══════════════════════════════════════════════════════════════╝
|
TIER 1: Deterministic Fixes (Fast Path)
|
TIER 2: LLM-Powered Fixes (Smart Path)
|
- jsonrepair — Automatically fixes malformed LLM JSON output
- Simplified retry — Reduces prompt verbosity on each retry
- Temperature decay — Lowers temperature for more deterministic retries
- Confidence clamping — Values always between 0.1-0.95
Inject failures on-demand to prove system robustness:
| Injection Type | Description |
|---|---|
new_failure |
Introduces package typo |
flaky_test |
Adds fake dependency |
dependency_break |
Breaks existing dependency |
- 🎮 Live hypothesis tournament visualization
- 📜 Event timeline with full history
- ⏪ Time travel slider (replay past states)
- 🎉 Success celebration modal with confetti!
# 1. Clone the repository
git clone https://github.com/shiri-09/REPAIR.ai.git
cd REPAIR.ai
# 2. Install dependencies
npm install
# 3. Set up environment variables
cp .env.example .env
# Add your GROQ_API_KEY (free at console.groq.com)
# 4. Reset demo to broken state
reset-demo.bat # Windows
./reset-demo.sh # Linux/Mac
# 5. Run the demo
npm run demoThen open: http://localhost:3000 🌐
┌─────────────────────────────────────────────────────────────────────┐
│ REPAIR.ai Architecture │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
│ │ OBSERVATION │────▶│ REASONING │────▶│ EXECUTION │ │
│ │ LAYER │ │ ENGINE │ │ LAYER │ │
│ │ (Deterministic) │ │ (LLM-Powered) │ │ (Sandboxed) │ │
│ └─────────────────┘ └─────────────────┘ └───────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │
│ │ MEMORY │◀────│ REFLECTION │◀────│ SAFETY │ │
│ │ SYSTEM │ │ MODULE │ │ GATES │ │
│ │ (SQLite DB) │ │ (Belief Update) │ │ (Rollback) │ │
│ └─────────────────┘ └─────────────────┘ └───────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ TRANSPARENCY UI (WebSocket Real-Time) │ │
│ └─────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
REPAIR.ai/
├── src/
│ ├── index.ts # Main REPAIRSystem class
│ ├── cli.ts # Command-line interface
│ ├── types/ # TypeScript type definitions
│ │
│ ├── observation/ # 👁️ OBSERVATION LAYER
│ │ └── index.ts # Error parsing, evidence extraction
│ │
│ ├── reasoning/ # 🧠 REASONING ENGINE
│ │ ├── index.ts # Main ReasoningEngine
│ │ ├── llm-client.ts # LLM abstraction (Groq/Gemini/Ollama)
│ │ ├── hypothesis-generator.ts # Multi-hypothesis generation
│ │ ├── hypothesis-tournament.ts # Tournament & ranking
│ │ └── reflection-module.ts # Outcome reflection
│ │
│ ├── planner/ # 📋 ACTION PLANNING
│ │ └── index.ts # Fix planning with deterministic path
│ │
│ ├── mcp/ # 🎮 MCP RUNTIME
│ │ ├── runtime.ts # Core repair loop
│ │ ├── memory.ts # SQLite memory system
│ │ └── adversarial.ts # Adversarial injection
│ │
│ └── ui/ # 📺 TRANSPARENCY UI
│ ├── index.ts # Express + WebSocket dashboard
│ └── ws-server.ts # Real-time updates
│
├── examples/
│ ├── broken-app/ # Demo target (intentionally broken)
│ └── broken-app-backup/ # Original broken state backup
│
└── reset-demo.bat # Reset demo script
| Feature | Description |
|---|---|
| 🔄 Reversible Actions | Pre-execution snapshots for instant rollback |
| 🎯 Blast Radius Assessment | Minimal, moderate, or significant impact warning |
| Low/medium/high with appropriate controls | |
| ✅ Command Whitelisting | Only approved commands can execute |
| 🔁 Loop Prevention | Maximum attempt limits to prevent infinite loops |
REPAIR.ai supports multiple LLM providers:
| Provider | Model | Cost | Setup |
|---|---|---|---|
| Groq (Recommended) | Llama 3.3 70B | 🆓 FREE | GROQ_API_KEY |
| Gemini | Gemini Pro | 💳 Paid | GEMINI_API_KEY |
| Ollama | Mistral/Llama | 🆓 FREE | Local install |
# LLM Providers (at least one required)
GROQ_API_KEY=your_groq_key # FREE at console.groq.com
GEMINI_API_KEY=your_gemini_key # Optional fallback
PRIMARY_LLM=groq # groq | gemini | ollama
# Ollama (optional, for local LLM)
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=mistral
# Safety Settings
MAX_REPAIR_ATTEMPTS=10
MAX_HYPOTHESIS_COUNT=5
# UI
UI_PORT=3000| Command | Description |
|---|---|
npm run demo |
Run demo with transparency UI |
npm run repair -- fix --project ./path --log build.log |
Repair specific project |
npm run ui |
Start UI only |
npm run dev |
Development mode (watch) |
npm run typecheck |
TypeScript type checking |
npm test |
Run tests |
import { REPAIRSystem } from 'repair-ai';
const repair = new REPAIRSystem({
projectPath: './my-project',
enableUI: true,
uiPort: 3000,
});
const result = await repair.repair({
projectPath: './my-project',
buildLog: 'npm ERR! notarget No matching version...',
exitCode: 1,
command: 'npm install',
});
if (result.success) {
console.log('✅ Fixed:', result.hypothesis.description);
console.log('📝 Changes:', result.action.changes);
}| Metric | Value |
|---|---|
| 🎯 Fix Rate (Known Patterns) | 100% |
| ⏱️ Average Fix Time | <30 seconds |
| 🔄 LLM Error Recovery | 80-90% |
| 💡 Hypothesis Generation | 3-5 in <5 seconds |
|
TypeScript 5.7 |
Node.js 20+ |
Express Web Server |
SQLite Memory DB |
| Component | Technology |
|---|---|
| 🧠 LLM Primary | Groq (Llama 3.3 70B) |
| 🔌 Real-time | WebSocket (ws) |
| 🛠️ JSON Hardening | jsonrepair |
| ✅ Validation | Zod |
| 💻 CLI | Commander.js |
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode development
npm run dev
# Run tests
npm test
# Type check
npm run typecheckThis project is licensed under the MIT License - see the LICENSE file for details.