retrAI
A self-solving AI agent loop. Point it at any project, give it a goal, watch it fix itself.
pytest pyright perf-check sql-benchmark shell-goal ai-eval ml-optimize cargo-test bun-test go-testWhat is retrAI?¶
retrAI is an autonomous AI agent that runs a plan → act → evaluate → repeat loop powered by LangGraph and LiteLLM. Give it a goal — failing tests, a slow query, a type error — and it will iteratively fix your code until the goal is achieved.
graph LR
A[START] --> B[Plan]
B --> C[Act]
C --> D[Evaluate]
D -->|"✅ Goal achieved"| E[END]
D -->|"🔄 Continue"| B
D -->|"🛑 Max iterations"| E
Install¶
Use¶
retrai run pytest # fix all failing tests
retrai run pyright # fix type errors
retrai run perf-check # optimise until benchmarks pass
retrai run sql-benchmark # tune a query until it's fast
retrai run ai-eval # describe a goal in English, agent writes tests + code
retrai serve # web dashboard on :8000
retrai tui pytest # rich terminal UI
Key Features¶
| Feature | Description |
|---|---|
| 12 goal types | pytest, pyright, bun-test, npm-test, cargo-test, go-test, make-test, shell-goal, perf-check, sql-benchmark, ai-eval, ml-optimize |
| Multi-model | Claude, GPT-4o, Gemini, Ollama, DeepSeek — anything LiteLLM supports |
| Auto-detection | Scans project files to pick the right goal automatically |
| Web dashboard | Vue 3 + WebSocket real-time graph visualization |
| TUI | Rich Textual terminal with live sparklines, tool tree, and event log |
| HITL | Optional human-in-the-loop approval gates before each iteration |
| Agent memory | Persists learned strategies across runs |
| Pipeline mode | Chain multiple goals in sequence |
| Benchmarks | Compare models side-by-side on the same task |
| AI eval | Describe a goal in English — agent generates the test harness, then implements the solution |
Quick Links¶
- Installation — Get up and running in 60 seconds
- Quick Start — Fix your first failing test
- How It Works — The agent loop explained
- API Reference — REST + WebSocket endpoints