Skip to main content
๐Ÿค–

Ralph

Cross-platform autonomous AI development with 10+ agents

Project Overview

The Problem

AI coding agents hit a wall. After 50+ tool calls, context fills up with failed attempts. They repeat the same mistakes endlessly. There's no way to pass learnings between sessions.

Context windows are finite. Traditional approaches fill them with noise until the agent can no longer function effectively.

The Solution

Ralph implements Geoffrey Huntley's deliberate context rotation strategy. Each iteration starts with a fresh context window. Progress and learnings persist in files, not memory.

Guardrails (signs) accumulate lessons learned, preventing the same mistakes from being repeated across sessions.

Platform Support

๐ŸŽ

macOS

Intel and Apple Silicon with GPU acceleration for local models via Metal.

  • โ€ข Homebrew integration
  • โ€ข Apple Silicon GPU support
  • โ€ข iTerm2 / Terminal.app
๐Ÿง

Linux

Ubuntu, Debian, Fedora, Arch, and Raspberry Pi OS with apt/dnf/pacman support.

  • โ€ข Raspberry Pi 4/5
  • โ€ข Docker support
  • โ€ข Systemd services
๐ŸชŸ

Windows

PowerShell and Batch scripts with winget package manager integration.

  • โ€ข PowerShell 5.1+
  • โ€ข Windows Terminal
  • โ€ข VS Code integration

Key Features

๐Ÿ”„

Context Rotation

Each iteration starts fresh. State is read from files, not agent memory. This prevents context window pollution.

  • โ€ข Fresh context each loop
  • โ€ข File-based state persistence
  • โ€ข Git-based progress tracking
๐Ÿšง

Guardrails System

When agents fail, they write "signs" documenting what went wrong. Future iterations read these first, avoiding repeated mistakes.

  • โ€ข Accumulated lessons
  • โ€ข Failure prevention
  • โ€ข Self-improving loops
๐Ÿค–

10+ AI Agents

Switch between cloud APIs and local models seamlessly. Use what works best for your task and budget.

  • โ€ข Gemini CLI (1M+ tokens, free)
  • โ€ข Claude, OpenAI, Anthropic
  • โ€ข Ollama, LM Studio (local)
โ˜๏ธ

Cloud/CI Deployment

Run on any server or integrate into CI/CD pipelines. Includes Docker, systemd, and pipeline configs.

  • โ€ข AWS, GCP, Azure, DO
  • โ€ข GitHub Actions, GitLab CI
  • โ€ข Docker Compose ready

How It Works

                          RALPH LOOP
                              โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                         โ”‚                         โ”‚
    โ–ผ                         โ–ผ                         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Read   โ”‚           โ”‚   Execute   โ”‚           โ”‚   Commit    โ”‚
โ”‚  State  โ”‚    โ”€โ”€โ”€โ–บ   โ”‚    Agent    โ”‚    โ”€โ”€โ”€โ–บ   โ”‚  Progress   โ”‚
โ”‚  Files  โ”‚           โ”‚    Task     โ”‚           โ”‚   to Git    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚                         โ”‚                         โ”‚
    โ”‚    .ralph/              โ”‚                         โ”‚
    โ”‚    โ”œโ”€โ”€ progress.md      โ”‚                         โ”‚
    โ”‚    โ”œโ”€โ”€ guardrails.md    โ”‚         If not done     โ”‚
    โ”‚    โ””โ”€โ”€ errors.log       โ”‚              โ”‚          โ”‚
    โ”‚                         โ”‚              โ–ผ          โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ROTATE โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    (Fresh Context)
        

Quick Start

# One-line install (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/craigm26/Ralph/main/install.sh | bash

# Run with Gemini (free, 1M+ token context)
./ralph.sh

# Or with local Ollama
./ralph.sh ollama

# Define your task in RALPH_TASK.md
# Ralph works until all checkboxes are checked

Use Cases

๐Ÿ”ง

Multi-Hour Refactors

Set it running overnight. Come back to a refactored codebase with every change committed and documented.

๐Ÿงช

Test Coverage

"Write tests until coverage hits 80%" - Ralph iterates until the success criteria are met.

๐Ÿ“„

Documentation

"Document every public function" - tedious but well-defined tasks are perfect for autonomous execution.

Technical Stack

Supported Agents

Gemini CLI - 1M+ tokens, free tier
Claude Code - Anthropic models
OpenAI - GPT-4o, o1 reasoning
Ollama - Local models, privacy
LM Studio - GUI-based local

Infrastructure

Bash/PowerShell scripts
Git for state persistence
JSON configuration
Docker/Compose support
CI/CD pipeline configs

Project Stats

10+
AI Agents

Cloud and local

6
Platforms

macOS, Linux, Windows, Cloud

MIT
License

Open source

v1.2
Version

Active development

Credits

  • Original Technique: Geoffrey Huntley - The Ralph Wiggum concept of deliberate context rotation
  • Cursor Implementation: Agrim Singh - Early Cursor-based implementation
  • Cross-Platform Port: This implementation extends the technique to support 10+ AI agents across all major platforms

Ready to Try Autonomous AI Development?

Get started with Ralph in minutes. Define your task, run the loop, check back when it's done.